|
|
Log in / Subscribe / Register

Good, bad and probabilistic

Good, bad and probabilistic

Posted May 26, 2026 12:12 UTC (Tue) by SLi (subscriber, #53131)
Parent article: Reviewing kernel patches with LLMs

> Sashiko sits somewhere in between those two and shares properties, both good and bad, with both. For example, the output is probabilistic, so different results will be produced each time it is run. That is like human reviewers in some ways, since maintainers and others will often spot different problems each time they review a patch set.

This is indeed both good and bad and frustrating since you cannot non-probabilistically rerun a language model with a tweaked prompt and observe the effects.

Now I think we need to separate two axis of probabilistic here. Getting different results every time you run LLMs is *not* a fundamental property of LLMs. It's just evaluation of a function. Nothing non-deterministic about that. Now, we often intentionally inject randomness (called temperature)—it tends to make the outputs better for many kinds of tasks—but even that is, in principle, captured by a single seed and rerunning the same LLM with the same temperature and the same seed gives you the same results. So it's non-deterministic in the sense of a Python program that sets the random seed to 42 and returns the same results every time, using randomness from that.

That's the theory at least. *Practically*, how we run LLMs makes them less repeatable, but this is really just a question of us choosing to optimize running them in a way that introduces noise. You can think of it as analogous to how FPUs alternate between rounding up or down, combined with how in threaded code scheduling decisions can change which rounding got used for which operation.

Again, I think we *could* choose to make it completely deterministic. There probably would be a price; I suspect it wouldn't be very large in computational terms, but it's likely there and someone would need to do the work (I'd also expect it to require deep enough knowledge of the accelerators that it may need vendor support).


to post comments

Good, bad and probabilistic

Posted May 29, 2026 16:14 UTC (Fri) by aphedges (subscriber, #171718) [Link]

I think that one of the biggest problems with making LLMs deterministic is that it seems that almost no software (in ML or in general) actually has tests to detect nondeterminism. I've made some fixes where that nondeterminism was causing me problems (such as Make Optimizer.state_dict() nondeterministic (#37347) in PyTorch), but there are so many outstanding nondeterminism bugs (such as Nondeterminism in simple_cycles() in NetworkX, itself caused by a CPython implementation decision) that a huge effort would be needed to resolve it. I'm not very optimistic in that happening anytime soon...


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds