Why temperature 0 still gives different answers

Temperature 0 makes a language model take the top candidate every time, yet the same prompt can still produce different text. The cause: who else is on the server.

Popo
On this page

A language model normally draws its next word by probability, so the same question gets different answers. Set the temperature to 0 and there's no draw: it takes the most likely token at every step. The answer should then be the same every time. In practice it often isn't.

How different, measured

In September 2025 Thinking Machines Lab measured it. They sent the prompt "Tell me about Richard Feynman" to Qwen3-235B 1,000 times at temperature 0, generating 1,000 tokens each time:

Different answers out of 1,000 runs at temperature 0

Ordinary inference80 answers
Batch-invariant inference1 answer
Data from Thinking Machines Lab. The most common of the 80 answers appeared only 78 times. With the calculation rewritten so batch size can't affect it, all 1,000 answers were identical.

So the randomness isn't in the model. With the calculation done another way, the same model gives one answer every time.

Computers don't add in any order

On paper, the order of an addition makes no difference. With the floating-point numbers computers use, it does, because each step is rounded to a fixed number of digits:

OrderSumResult
Left first(0.1 + 1e20) − 1e200.0
Right first0.1 + (1e20 − 1e20)0.1
Adding 0.1 to a huge number loses it entirely: there aren't enough digits to hold both. Subtract the huge numbers first and 0.1 survives.

You can check it in any Python:

Terminal
python3 -c "print((0.1 + 1e20) - 1e20, 0.1 + (1e20 - 1e20))"0.0 0.1

Working out one token takes a huge number of additions. Usually the differences are far too small to matter. But when two candidates are nearly tied, a difference in the last digits can decide which comes first.

What changes the order: other people's requests

Rounding alone doesn't explain it: do exactly the same sums in exactly the same order and you get exactly the same result. Something has to change the order between runs. A common explanation is that the GPU's parallel work finishes in random order. The Thinking Machines team found that isn't the main reason.

The main reason is batching. To use the hardware efficiently, a server processes many people's requests together. How many it groups depends on how busy it is at that moment, and the size of the group changes how the sums are split up:

  1. 1Requests arriveYours and other people’s
  2. 2The server groups themBatch size depends on load
  3. 3The sums run in a different orderTiny rounding differences
  4. 4Two close candidates swapThe text diverges from there

Your prompt and settings never changed. How busy the server was did.

The four steps summarize the mechanism described in the post. Nothing leaks between requests; only the size of the batch matters.

In their words, the load on the server is "effectively nondeterministic" from the user's point of view. It isn't specific to GPUs either: services running on CPUs or TPUs have the same source of variation.

Why one swapped token changes everything

The model writes one token at a time, and each token becomes part of the text it reads next. Swap one, and every later step starts from a different text. A difference in the last decimal place can end as a different paragraph.

What this means for you

  • In a chat app: you can't set the temperature in ChatGPT or Claude, so answers vary for the ordinary reason, the draw. A different answer doesn't mean the first one was wrong.
  • Through an API: don't build anything that needs identical text twice. Compare the meaning or the structure, or save the first answer and reuse it.
  • When comparing models: one run proves little. Ask several times and look at how often the answer is right.
  • If you run the model yourself: identical output is possible, at the cost of some speed, if the inference software supports batch-invariant calculation.

Getting the same answer twice also says nothing about whether it's true. A model can be consistently wrong, as explained in why models make things up.