Hacker News new | ask | show | jobs
by tuetuopay 31 days ago
They’re not, and will never be in their current form and architecture.

Compilers are mechanical and engineered to produce a correct output. A compiler emitting incorrect machine code is exceedingly rare, and considered a bug. They have heuristics and probabilities in them, but those are to pick between a set of known-good outputs.

An AI is a bag of weights outputting a probability of the most plausible token that follows [1]. It is inherently probabilistic in nature and its output is organic (by design, they’re designed to mimic human speech), as opposed to mechanical like a compiler.

A compiler follows hard rules. An AI does its best.

And to be fair, AIs are no better than human in this regard: humans are pretty bad at generating correct code without mechanical tools to keep them in line (compilers, linters, formatters). It’s not a wonder we use the same tools to keep LLM output in line as we do humans. (And, to be fair, LLMs are better than humans at oneshotting valid code).

[1]: to those that tell me this vision of an LLM is outdated: nope. The heavy lifting is done in the probability generation. Debates about understanding are not relevant here, and the net output of an LLM is a probability vector over raw tokens. This basic description can be contrasted to a compiler whose output is a glorified Jinja template.

1 comments

Question: What do you think the word "effectively" means in the comment above?
Not OP, but it means nothing, because it's not "effectively" becoming a compiler.

Think about it from an information theory standpoint:

A compiler takes at least the exact amount of information it needs to produce a result, and produces exactly that result every time (unless it's bad at its job or has a bug).

An LLM always takes far less information than would actually be needed to fully describe the desired output, and extrapolates from that. It fetches contexts and such to give itself a glut of assumedly relevant information, but the prompt always contains less information than necessary to produce the code it generates. If it did fully contain enough information, then you've just written a far more verbose version of the program in human language.

You're rebutting a comment that says something like: "LLMs are literally becoming compilers"

No one said that

I interpret it as "in practice", "now". Non-native English speaker here, so I may have missed your meaning.

If you meant they’re now better at mimicking compilers, sure, but they’re only mimicks.

Yes, I am saying there's no functional difference (for practical purposes) between a deterministic transformation like a compiler and a perfect probabilistic transformation like an LLM.

We do not have "perfect" probabilistic transformation, and we probably never will (in part because it's hard to know what exactly that even means), but the gap between the two is shrinking every day.

Ergo:

> they're becoming (effectively) more and more similar every day.