← Back to context

Comment by petcat

6 days ago

Compilers can generate wrong output in many different ways. And they're all analogous to the same ways that a sophisticated LLM can generate wrong outputs.

The compiler relies on:

* Careful use of the ENV vars and CLI options

* The host system, or the compilation of the target executable (for cross-compiling)

* It relies on the source code specifically

How is this really different from careful prompt engineering, and an extensive proposal/review/refine process?

They are both narrowing the scopes and establishing the guardrails for what the solution and final artifact will be.

> proposal/review/refine process

This is essentially what a sophisticated compiler, or query optimizer (Postgres) does anyway. We're just doing it manually via prompts.

And none of that means it isn't non-deterministic. Compilers still satisfy the, given the exact same environment and input, you get the same output. It doesn't matter the number of inputs. So long as f(3, 2) always gives 5, it's deterministic. Doesn't matter what f(x,y) does so long as it always gives the same output per input. LLM generation does not do this. If given f(3,2), sometimes it says 5, sometimes 6, sometimes 1001, sometimes 2.

And we are talking compilers, not query optimizers, so I don't really care what they do.

  • It seems that the person you’re replying to is also deterministic. No matter how many times you explain what “deterministic” means, they fail to understand it.

> How is this really different from careful prompt engineering, and an extensive proposal/review/refine process?

So different that those concepts don't even exist.

I don't have to carefully prompt my compiler in case it might misinterpret what I'm saying. My compiler comes with a precisely specified language.

I never, ever, review the output of my compiler.

  • > I don't have to carefully prompt my compiler in case it might misinterpret what I'm saying.

    Yes you do. You give it flags, you give it ENV vars.

    > My compiler comes with a precisely specified language.

    No, it doesn't.

    > I never, ever, review the output of my compiler.

    Yes, that's the whole point of the exercise. Have you ever reviewed the -S output from GCC? No? So do you really know what your code is doing?

    • > Yes, that's the whole point of the exercise. Have you ever reviewed the -S output from GCC? No? So do you really know what your code is doing?

      Because I gave it some code in a different language and it mechanically translated it through a deterministic, clearly documented process.

You can't guarantee that an LLM will yield the same answer twice, given the same input, by design. You can with compilers. That's the point being made here.