←back to thread

358 points andrewstetsenko | 1 comments | | HN request time: 0.198s | source
Show context
sysmax ◴[] No.44360302[source]
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.

replies(2): >>44360561 #>>44360985 #
soulofmischief ◴[] No.44360985[source]
> AI can very efficiently apply common patterns to vast amounts of code, but it has no inherent "idea" of what it's doing.

AI stands for Artificial Intelligence. There are no inherent limits around what AI can and can't do or comprehend. What you are specifically critiquing is the capability of today's popular models, specifically transformer models, and accompanying tooling. This is a rapidly evolving landscape, and your assertions might no longer be relevant in a month, much less a year or five years. In fact, your criticism might not even be relevant between current models. It's one thing to speak about idiosyncrasies between models, but any broad conclusions drawn outside of a comprehensive multi-model review with strict procedure and controls is to be taken with a massive grain of salt, and one should be careful to avoid authoritative language about capabilities.

It would be useful to be precise in what you are critiquing, so that the critique actually has merit and applicability. Even saying "LLM" is a misnomer, as modern transformer models are multi-modal and trained on much more than just textual language.

replies(3): >>44361085 #>>44363335 #>>44364768 #
koonsolo ◴[] No.44363335[source]
I learned neural networks around 2000, and it was old technology then. The last real jump we saw was going from ChatGPT 3.5 to 4, and that is more than 2 years ago.

It seems you don't recollect how much time passed without any big revolutions in AI. Deep learning was a big jump. But when the next jump comes? Might be tomorrow, but looking at history, might be in 2035.

According to what I see, the curve has already flattened and now only a new revolution could get us to the next big step.

replies(2): >>44366251 #>>44366294 #
scrivna ◴[] No.44366251[source]
Agree, the AI companies aren’t able to improve the base models so they’re pivoting to making add-ons like “agents” which seem to only be instructions atop the base models.
replies(1): >>44367255 #
1. soulofmischief ◴[] No.44367255[source]
Progress is progress. Just as a raw base models need RL to be useful, an agentic layer allows us to put these probabilistic machines on rails.