You ran the same prompt twice, with temperature set to 0, and got two different answers. Either something is broken, or “temperature 0” never promised what you thought it did. Since late 2026 there is a second surprise: on the newest models from Anthropic, OpenAI and Google, you can no longer send the setting at all.

Short answer: temperature 0 means “always pick the highest-scoring token.” It does not mean “always compute the same scores.” The first is a rule about choosing; the second depends on the hardware, the batch your request lands in and the provider’s code. All provider documentation below was checked on November 27, 2026.

What temperature 0 does and does not fix

A model produces a score (a logit) for every token in its vocabulary, then the sampler turns scores into a choice. Temperature rescales the scores before sampling; at 0 the sampler simply takes the top one. Google’s prompting guide describes it this way: “A temperature of 0 is deterministic, meaning that the highest probability response is always selected.”

That sentence is true of the selection step. It says nothing about whether two runs produce the same scores. If a score for the runner-up token moves by a tiny amount and the top two were close, the “highest probability” token changes, and every token after it changes too, because each new token is conditioned on the previous ones.

Two separate things can differ between two identical requests:

  1. The scores. Floating-point addition is not associative, so adding the same numbers in a different order gives a slightly different total.
  2. The order of addition. GPU kernels can use a different reduction strategy depending on the batch size, and the batch size depends on how many other requests the server is handling at that moment.

Measured: one million numbers, five orders

To see the first effect without any model, I summed the same 1,000,000 float32 values (standard normal, fixed seed 2026) in five orders with NumPy 2.5:

Summation order Result
NumPy default (pairwise) -154.327545
Running total, left to right -154.322220
Running total, right to left -154.339462
Running total, shuffled -154.336364
Running total, sorted ascending -167.397858
Float64 reference -154.327533

Five orders, five different answers, and the float64 reference sits closest to the pairwise sum. The sorted case is the extreme: float32 loses so much precision once the running total gets large that the result is off by about 13. Nobody sums a vocabulary score that way, but the table shows the mechanism: same inputs, different order, different output, with no bug anywhere.

How often does a different order change the chosen token?

A different total only matters if it changes which token wins. To estimate how often that is plausible, I built a toy output layer: a 1,024-dimensional hidden vector, a 32,000-token vocabulary and random weights, so the logits have a standard deviation of about 1.5. For each of 2,000 random hidden vectors I computed the logits twice in float32, once accumulating the 1,024 inputs in eight chunks front to back and once back to front. Then I looked at the gap between the top two logits.

  • The two orders differed by at most 1.4 x 10^-6 on any logit (median 9.5 x 10^-7). In 2,000 steps, the top-1 token was identical every time.
  • But real inference does not always keep logits in float32. The spacing between representable bfloat16 values near a logit of 4 to 8 is 0.03125 (2^-5). Here is how many steps had a top-two gap smaller than that spacing:
Top-two gap smaller than Share of steps Expected steps in a 500-token answer
0.001 0.40% 2.0
0.01 2.50% 12.5
0.03125 (one bfloat16 step) 8.25% 41.2
0.0625 15.25% 76.2

The reading is not “8% of tokens flip.” It is that when the numerical noise is as coarse as one bfloat16 step, about one decoding step in twelve in this toy is close enough that a different summation order could change the winner, and a 500-token answer contains dozens of them. With float32 noise around 10^-6, none of the 2,000 steps was at risk. The precision of the pipeline decides how often the tie-break is up for grabs.

This is a toy with random weights, not a measurement of any production model. Real logit gaps are not distributed like this, so the exact percentages will not transfer. The pattern does: the noise size is set by the arithmetic, and the chance of a flip is the share of steps whose gap is smaller than the noise.

What a real model does

A real measurement exists. Thinking Machines Lab sampled 1,000 completions of the prompt “Tell me about Richard Feynman” from Qwen3-235B-A22B-Instruct-2507 at temperature 0, 1,000 tokens each, and got 80 unique completions, the most common appearing 78 times. All of them matched for the first 102 tokens. At the 103rd, 992 completions continued “Queens, New York” and 8 wrote “New York City”. A small difference at one token, then two different answers.

Their diagnosis was not the usual “GPU threads finish in random order.” They write that the forward pass of an LLM involves no operations that need atomic adds, so from the inference server’s side it is run-to-run deterministic, and that the real cause is a lack of batch invariance: the result for your request depends on the batch size, which depends on the parallel requests on the server. With their batch-invariant kernels enabled, all 1,000 completions were identical.

So there are two honest statements. The same request on the same machine with the same batch is repeatable. The same request on a shared inference service, where you do not control the batch, may not be.

What the providers say

Provider Does the API accept temperature 0? Determinism statement checked Nov 27, 2026
Anthropic Not on newer models. From API version 2026-10-21, a request with temperature, top_p or top_k returns a 400 error at any value. Older models on the older version still accept it. The Opus 5.5 migration guide says that if you used temperature = 0 for determinism, it “never guaranteed identical outputs on prior models.”
OpenAI Not for GPT-6.2. The GPT-6.2 guide says to omit temperature and top_p in both Chat Completions and Responses requests. In the API specification, seed makes “a best effort to sample deterministically” and “Determinism is not guaranteed.” The system_fingerprint field is marked deprecated.
Google Not for Gemini 3.6 and later. The Gemini 3.6 notes say the API ignores these parameters now and will return errors in future generations. The same page says: “To improve determinism, define a system instruction with explicit rules for your specific use case.”

Two details are easy to miss. First, Anthropic’s thinking documentation lists the models, including Opus 4.7, Opus 5.5, Sonnet 5.5 and Haiku 5.5, on which a non-default value already returns a 400 error on every request; the 2026-10-21 version extends that to every model. Second, Google’s prompting guide still carries the sentence about temperature 0 quoted above, and a note a few lines below it says Gemini 4 and Gemini 3.6+ models ignore custom values for temperature, top_p and top_k. The old explanation and the new behavior sit on the same page.

What to do instead

If you need the same output every time, treat the model as a source of candidates and make repeatability a property of your system, not of the sampler:

  • Store the answer. Cache the first response against a hash of the prompt and settings, and replay it. This is the only approach that is exactly repeatable.
  • Constrain the output. A fixed schema, a short enumerated answer set or a classification label leaves fewer places for a near-tie to matter. A one-token label can still flip, but a 500-token essay has hundreds of chances.
  • Test the distribution, not one run. Run your evaluation prompts several times and count how often the answer changes. Thinking Machines’ 80 unique answers in 1,000 runs is the kind of number you want for your own prompts.
  • Pin what you can. Record the model name, the API version and any seed you sent, and treat a changed system_fingerprint or model version as a reason to re-run the evaluation.
  • Self-hosting is different. If you run the model yourself, batch-invariant kernels made all 1,000 runs identical in the Thinking Machines test, though the authors say they have not put significant effort into optimizing their speed.

Reporting & Sources

Checked November 27, 2026:

The summation table and the toy output-layer figures are my own runs (NumPy 2.5.3 on Python 3.13, seeds 2026 and 7, float32 accumulation, bfloat16 spacing computed from its 8-bit significand). They show how rounding noise relates to top-two gaps, not how often any specific commercial model changes its answer.