Better HN
topnewbestaskshowjobs
Log inSign up

sysmax

190 karma · joined Sep 8, 2022 (4y ago) · 45 submissions

Submissions

comment 1y ago · link · parent

I am working on a GUI for delegating coding tasks to LLMs, so I routinely experiment with a bunch of models doing all kinds of things. In this case, Claude Sonnet 3.7 handled it just fine, while Llama-3.3-70B just couldn't get it. But that is literally the simplest example that illustrates the problem.

When I tried giving top-notch LLMs harder tasks (scan an abstract syntax tree coming from a parser in a particular way, and generate nodes for particular things) they completely blew it. Didn't even compile, let alone logical errors and missed points. But once I broke down the problem to making lists of relevant parsing contexts, and generating one wrapper class at a time, it saved me a whole ton of work. It took me a day to accomplish what would normally take a week.

Maybe they will figure it out eventually, maybe not. The point is, right now the technology has fundamental limitations, and you are better off knowing how to work around them, rather than blindly trusting the black box.

comment 1y ago · link · parent

AI can very efficiently apply common patterns to vast amounts of code, but it has no inherent "idea" of what it's doing.

Here's a fresh example that I stumbled upon just a few hours ago. I needed to refactor some code that first computes the size of a popup, and then separately, the top left corner.

For brevity, one part used an "if", while the other one had a "switch":

    if (orientation == Dock.Left || orientation == Dock.Right)
        size = /* horizontal placement */
    else
        size = /* vertical placement */

    var point = orientation switch
    {
        Dock.Left => ...
        Dock.Right => ...
        Dock.Top => ...
        Dock.Bottom => ...
    };
I wanted the LLM to refactor it to store the position rather than applying it immediately. Turns out, it just could not handle different things (if vs. switch) doing a similar thing. I tried several variations of prompts, but it very strongly leaning to either have two ifs, or two switches, despite rather explicit instructions not to do so.

It sort of makes sense: once the model has "completed" an if, and then encounters the need for a similar thing, it will pick an "if" again, because, well, it is completing the previous tokens.

Harmless here, but in many slightly less trivial examples, it would just steamroll over nuance and produce code that appears good, but fails in weird ways.

That said, splitting tasks into smaller parts devoid of such ambiguities works really well. Way easier to say "store size in m_StateStorage and apply on render" than manually editing 5 different points in the code. Especially with stuff like Cerebras, that can chew through complex code at several kilobytes per second, expanding simple thoughts faster than you could physically type them.

comment 1y ago · link · parent

Not exactly. Let's say, you-the-human are trying to fix a crash in the program knowing just the source location. You would look at the code and start hypothesizing:

* Maybe, it's because this pointer is garbage.

* Maybe, it's because that function doesn't work as the name suggests.

* HANG ON! This code doesn't check the input size, that's very fishy. It's probably the cause.

So, once you get that "Hang on" moment, here comes the boring part of of setting breakpoints, verifying values, rechecking observations and finally fixing that thing.

LLM's won't get the "hang on" part right, but once you point it right in their face, they will cut through the boring routine like no tomorrow. And, you can also spin 3 instances to investigate 3 hypotheses and give you some readings on a silver platter. But you-the-human need to be calling the shots.

comment 1y ago · link · parent

>The same kind of bias keeps resurfacing in every major system: Claude, Gemini, Llama, clearly this isn’t just an OpenAI problem, it’s an LLM problem.

It's not an LLM problem, it's a problem of how people use it. It feels natural to have a sequential conversation, so people do that, and get frustrated. A much more powerful way is parallel: ask LLM to solve a problem. In a parallel window, repeat your question and the previous answer and ask to outline 10 potential problems. Pick which ones appear valid, ask to elaborate. Pick your shortlist, ask yet another LLM thread to "patch" the original reply with these criticisms, then continue the original conversation with a "patched" reply.

LLMs can can't tell legitimate concerns from nonsensical ones. But if you, the user, do, they will pick it up and do all the legwork.

comment 1y ago · link · parent

I think, there's nuance. If a human can solve a problem without second thoughts and hesitations (Hey, stop, this doesn't look right. Are there other options?), an LLM will tear through it at breakneck speed.

But if there are things worth hesitating and weighing, LLM will fly past them at cruising speed.

There are plenty of problems of both kinds.

comment 1y ago · link · parent

That's not how you do it. Ask it first to create exhaustive tests around the first version. Tell it what to test for. Then, ask to change specific things, one at a time, re-run tests between the steps, and ask it to fix things. Rinse-repeat-review. It is faster than doing by hand, but you still need to be calling the shots.

comment 1y ago · link · parent

You need to do it in smaller, incremental steps. Outline the overall architecture in your head, ask the AI to create empty structs/classes. Build it. Ask it to implement one part, leaving others empty. Test it. Ask it to add the next thing, and so on.

Every step should only affect a handful of classes or functions, that you can still keep in your head and easily verify. Basically, same thing as if you were doing it by hand, but at a higher abstraction level, so faster and less mentally tiring.

Shameless plug: I am working on a new cross-platform IDE designed for just this kind of workflow. It has basic C/C++ support already: https://sysprogs.com/CodeVROOM/?features=why

comment 1y ago · link · parent

LLMs are a glorified regex engine with fuzzy input. They are brilliant at doing boring repetitive tasks with known outcome.

- Add a 'flags' argument to constructors of classes inherited from Record.

- BOOM! Here are 25 edits for you to review.

- Now add "IsCaseSensitive" flag and update callers based on the string comparison they use.

- BOOM! Another batch of mind-numbing work done in seconds.

If you get the hang of it and start giving your LLMs small, sizable chunks of work, and validating the results, it's just less mentally draining than to do it by hand. You start thinking in much higher-level terms, like interfaces, abstraction layers, and mini-tests, and the AI breeze through the boring work of whether it should be a "for", "while" or "foreach".

But no, don't treat it as another human capable of making decisions. It cannot. It's a fancy machinery for applying known patterns of human knowledge to the locations where you point based on a vague hint, but not a replacement for your judgement.

comment 1y ago · link · parent

I think, they are trying to push back against generated pages. I faced this exact problem myself. We recently published an interactive source code navigation tool [0] where you can find examples for commonly used functions from some embedded SDKs. Google indexed it immediately and almost immediately it got a spike of views.

Then, an interesting thing happened. Most pages simply disappeared from the results. Search console shows them as indexed, no problems, no manual actions, but if you google up those functions, there results are not there.

It took some statistical analysis to figure out that they appear to be capping the number of pages. Out of all the pages Google crawled, it picked some percentage of the "most important" ones and it's showing those. The importance, by the looks of it, was computed from the number of incoming links, prioritizing pages for common stuff like int32_t that nobody googles.

It's not ideal, but it kinda makes sense. It's 2024. You can use AI to generate plausible content for any search query you can think of. And unless they put some kind of limits, we'll get overrun with completely useless LLM-churned stuff.

[0] https://sourcevu.sysprogs.com/

comment 1y ago · link · parent

Well, to be perfectly honest, it's hard question for an LLM that reasons in tokens and not letters. Reminds me of that classic test that kids easily pass and grownups utterly fail. The test looks like this: continue a sequence:

  0 - 1
  5 - 0
  6 - 1
  7 - 0
  8 - 2
  9 - ?
Grownups try to find a pattern in the numbers, different types of series, progressions, etc. The correct answer is 1 because it's the number of circles in the graphical image of the number "9".

comment 1y ago · link · parent

LLMs are a very good tool for a particular class of problems. They can sift through endless amounts of data and follow reasonably ambiguous instructions to extract relevant parts without getting bored. So, if you use them well, you can dramatically cut down the routine part of your work, and focus on more creative part.

So if you had that great idea that takes a full day to prototype, hence you never bothered, an LLM can whip out something reasonably usable under an hour. So, it will make idea-driven people more productive. The problem is, you don't become a high-level thinking without doing some monkey work first, and if we delegate it all to LLMs, where will the next generation of big thinkers come from?

comment 2y ago · link · parent

I was just messing around with LLMs all day, so had a few test cases open. Asked it to change a few things in a ~6KB C# snippet in a somewhat ambiguous, but reasonable way.

GPT-4 did this job perfectly. Qwen:72b did half of the job, completely missed the other one, and renamed 1 variable that had nothing to do with the question. Llama3.1:70b behaved very similar to Qwen, which is interesting.

OpenCoder:8b started reasonably well, then randomly replaced "Split('\n')" with "Split(n)" in unrelated code, and then went completely berserk, hallucinating non-existent StackOverflow pages and answers.

For posterity, I saved it here: https://pastebin.com/VRXYFpzr

My best guess is that you shouldn't train it on mostly code. Natural language conversations used to train other models let them "figure out" human-like reasoning. If your training set is mostly code, it can produce output that looks like code, but it will have little value to humans.

Edit: to be fair, llama3.2:3b also botched the code. But it did not hallucinate complete nonsense at least.

43.

Live Tracing of Linux Kernel Code(sysprogs.com ↗)

1 points · by sysmax · 3y ago · discuss

44.

Show HN: Hosting Web Apps on Raspberry Pi Pico W(visualgdb.com ↗)

7 points · by sysmax · 4y ago · discuss

45.

PicoHTTPServer - Host Responsive Web Apps on Raspberry Pi Pico W(github.com ↗)

2 points · by sysmax · 4y ago · discuss

12