Comment by hansvm

3 days ago

Compilers have a ton of hard optimization passes, and many of those are solved well enough via stochastic algorithms. Nobody actually fully optimizes register allocation or whatever, and a few random restarts can go a long way toward some better performance.

Every professional compiler I've ever used has given me the ability to choose what optimization level to use. No professional LLM I've ever used has given me any choice whatsoever to modify the temperature.

This argument is conflating determinism as in "byte-for-byte reproducible builds" with determinism as in "builds are semantically correct".

The fact that a traditional PL compiler output can have different performance, based on stochastic optimizations, is not in dispute. But, we consider the compiler flawed and inappropriate for use when it will randomly produce incorrect machine code. Under normal circumstances, we can infer that "correct" source code will produce "correct" builds every time it is fed through a valid compiler.

The problem people have with slop and vibe coding is that there is no formal semantics to even define correctness of the LLM/agent output.

With no formal semantics to constrain the outputs, you have to treat each prompt/inference run as a fuzzy search. What it "finds" may or may not match your intended semantics. It is merely a candidate that might correspond to your ambiguously specified semantic intent.

It is magical and lazy thinking that leads people to use this fuzzy search process in "I'm feeling lucky" mode.

No compiler does optimal register allocation, because optimal register allocation is an NP-complete problem.

Chaitin et al.: "Register allocation via coloring".

https://en.wikipedia.org/wiki/Register_allocation

  • Yes? And stochastic methods are one way to approximate optimal NP solutions. In the context of register allocation, you'd be most likely to see that when modeling actual runtime optimality rather than minimizing spill or whatever. Mainstream compilers don't do that, but mainstream compilers don't incorporate many SOTA techniques.