3 ms·
> I feel like I'm fighting a losing battle but I don't see why so many people consider LLMs innately non-deterministic ... Because LLMs are artificial neural n
by AdieuToLogic 1mo ago
> I feel like I'm fighting a losing battle but I don't see why so many people consider LLMs innately non-deterministic ...
Because LLMs are artificial neural networks[0] (ANN), which are statistical in nature, and thus intrinsically non-deterministic. Pretty much every AI algorithm has randomness involved in its definition and many (most?) incorporate probabilities.
0 - https://en.wikipedia.org/wiki/Neural_network_(machine_learning) https://en.wikipedia.org/wiki/Neural_network_(machine_learni...
- ChadNauseam 1mo agoNow that you mention it, I think "statistical" might be a good word choice as it probably closely matches what people mean when they say an LLM is nondeterministic. However, on a technical level, neural network inference truly is inherently deterministic. The only nondeterminism in LLMs is parallelism-dependency in the way floating point operations are carried out and in the decoding strategy
- vrighter 1mo agoonly if you bias your "random sampling of the distributions it gives" Fixing the seed is still intentional bias. Or you could force it to always take the one token with the highest probability, but that is still biased sampling. Deterministic, sure, but intentionally wrong just to avoid a technically
- ChadNauseam 1mo agoThere's nothing inherently biased or intentionally wrong with greedy decoding. Why would there be? Let's say you're trying to predict what an expert doctor would say to a patient with cancer. You think there's a 99% chance the doctor would say "start chemotherapy" and a 1% chance the doctor would say "don't worry about it". If you have to pick one to output, you'll pick "start chemotherapy". It would be crazy to say the best thing to do is to roll a 100-sided die to determine your answer. A language model is literally in that exact situation.
- AdieuToLogic 1mo ago> The only nondeterminism in LLMs is parallelism-dependency in the way floating point operations are carried out and in the decoding strategy This assertion is "oddly" similar to the GPT answer "neural network inference determinism" produced: Neural network inference is often non-deterministic due to factors like floating-point arithmetic and concurrent execution, which can lead to variations in output even with the same input. Surely this is but a coincidence. Regarding your previous statement: > However, on a technical level, neural network inference truly is inherently deterministic. This holds for a vanishingly small set of conditions, none of which include randomness, nor when context and transformers are involved, let alone underlying model evolution (thus making model use over time non-deterministic).
- ChadNauseam 1mo ago> This assertion is "oddly" similar to the GPT answer "neural network inference determinism" produced My statement and GPT's statement are both correct answers to the same question, so I think it makes sense that they would be similar. Are you accusing me of having paraphrased an LLM in writing my answer? I did not, I just remembered having read Thinky's post on the subject [0], which GPT has probably read also. > This holds for a vanishingly small set of conditions, none of which include randomness, nor when context and transformers are involved, let alone underlying model evolution (thus making model use over time non-deterministic). There are plenty of ways to introduce nondeterminism into any system. By your standards, I doubt you could point to a single deterministic system in the world. print("hello, world") is only deterministic if your CPU is properly shielded from cosmic rays and your OS isn't out of memory etc. There are some inherently nondeterministic processes, like the stochastic methods used to train models or the random sampling used at inference time if you have temperature!=0, but inference under greedy decoding is conceptually deterministic. [0]: https://thinkingmachines.ai/blog/defeating-nondeterminism-in-llm-inference/ https://thinkingmachines.ai/blog/defeating-nondeterminism-in...