From Sanskriti Khandelwal | Product & Market Analysis
LLM Nondeterminism: 80 Answers at Temperature 0, and What Each API Promises
On this page
Thinking Machines Lab sent one prompt to an open model 1,000 times at temperature 0 and got back 80 different completions. Temperature 0 was supposed to make the answer fixed. LLM nondeterminism survives it because the server batches your request with other people's traffic, and the batch size changes the arithmetic. Your eval scores and audit records inherit that noise.
Key takeaways
- Temperature 0 removes sampling randomness, not arithmetic variation. In a test by Thinking Machines Lab, 1,000 identical temperature 0 requests to Qwen3-235B produced 80 distinct completions, all identical for the first 102 tokens.
- The main cause is batch size, not GPU concurrency. Common inference kernels change their reduction order when the batch changes, and the batch changes with server load you cannot see or control.
- No major closed API guarantees identical outputs. OpenAI, Azure OpenAI and Google document their seed parameters as best effort, Anthropic states temperature 0 is not fully deterministic, and only Mistral's reference promises deterministic results.
- Determinism is buyable on self-hosted stacks, at a price. SGLang reports an average 34.35% slowdown for its deterministic mode, and vLLM ships batch invariance as a beta feature behind one environment variable.
Short answer
Temperature 0 still gives different answers because the model's logits are not computed identically on every call. Hosted APIs group your request with others, and the batch size changes the order in which numbers are summed. Tiny rounding differences then flip a near-tied token, and the rest of the output follows the new path.
This post is written for the practitioner: the engineer who owns an eval harness, a regression suite or an audit log, and needs to know which differences are real. That reader converts on mechanism and copyable settings, so that is what follows.
What LLM nondeterminism is, and what temperature 0 actually controls
LLM nondeterminism means identical inputs produce different outputs across calls. It is worth separating two sources, because only one of them is under your control.
The first source is sampling. A model produces a score, called a logit, for every possible next token. Temperature reshapes those scores before a token is drawn at random. At temperature 0 the draw is skipped and the highest scoring token always wins, which is called greedy decoding.
The second source is the logits themselves. Greedy decoding is a pure function of the logit vector. If the vector arrives slightly different on two calls, greedy decoding faithfully picks a different winner whenever two tokens are nearly tied. Temperature 0 says nothing about whether the vector is reproducible.
That second source is what this post is about. Vendors document it in careful language. Google's Vertex AI reference says that at temperature 0 responses are "mostly deterministic, but a small amount of variation is still possible". The word "mostly" is doing all the work in that sentence.
The Thinking Machines experiment: 1,000 runs, 80 answers
In September 2025, Horace He and colleagues at Thinking Machines Lab published "Defeating Nondeterminism in LLM Inference". The headline test was simple and easy to reproduce. They asked Qwen3-235B, in non-thinking mode, to "Tell me about Richard Feynman" 1,000 times at temperature 0, generating 1,000 tokens each time.
They got 80 unique completions. The most common one appeared 78 times. Every completion was identical for the first 102 tokens, then the paths split at token 103.
The divergence point is worth reading closely. All 1,000 completions contained the phrase "Feynman was born on May 11, 1918, in". Then 992 continued "Queens, New York" and 8 continued "New York City". Both are defensible answers, which is exactly why the two tokens were close enough to flip.
Our own arithmetic on their numbers: 99.2% of runs took the majority path at the first split, yet only 7.8% of runs matched the single most common full output. Small per-token flip rates compound over a long generation. A 1,000 token answer gives the noise 1,000 chances to land.
The same test with their batch-invariant kernels switched on produced 1,000 identical completions. That control run is what turns the post from an observation into a diagnosis.
Why temperature 0 still gives different outputs: the batch-size mechanism
The popular explanation for LLM nondeterminism is "concurrency plus floating point". Thinking Machines argues it is not wrong, but it does not explain what you see from an API.
Floating point addition is not associative. Adding the same numbers in a different order can give a slightly different result, because each step rounds. That is true and it is the raw material for every effect in this post.
But the post shows that the same matrix multiplication, repeated on the same GPU with the same data, returns bitwise identical results every time. In its words, the forward pass of an LLM is "run-to-run deterministic". The kernels used in inference do not rely on the atomic adds that make some GPU code race. So the order of addition is fixed for a given input shape.
The input shape is the part you do not control. A hosted endpoint packs your request into a batch with other users' requests, and how many depends on load at that instant. Many kernels pick a different strategy for different batch sizes, splitting a sum into more or fewer chunks to keep the GPU busy. Different chunks mean a different addition order.
The post's demonstration is blunt. Multiplying the first row of a matrix on its own, then taking the first row of the full 2,048 row multiplication, gave results that differed by a maximum of 1669.25 in their example. Same row, same weights, different neighbours. The authors summarise the root cause as the server load, and therefore the batch size, varying nondeterministically.
From the server's point of view, everything is deterministic. From your point of view, the result depends on traffic you cannot see. We think that framing should replace "GPUs are random" in every internal doc, because it tells you where the fix lives.
Three kernels that must hold their order
Batch invariance means a row's result does not depend on how many other rows share the batch. Thinking Machines identifies three operations that need it: RMSNorm, matrix multiplication and attention.
For matrix multiplication, the fix is to compile one kernel configuration and use it for every shape, avoiding split-K and stream-K strategies. The post says this gives up about 20% of performance against cuBLAS. For attention during decoding, the fix is a fixed split size along the cached keys and values rather than a fixed number of splits. A 1,000 token cache split into four chunks of 250 is not invariant. Three chunks of 256 plus one of 232 is.
What each major API documents about seeds and determinism
If you buy inference rather than run it, the batch is the vendor's business. What you can control is which parameters you send and what you log. Here is what each vendor's own documentation says, read on 21 November 2026.
| API | Seed parameter | What the docs promise | Change signal |
|---|---|---|---|
| OpenAI Chat Completions | seed, marked Beta | "Determinism is not guaranteed" | system_fingerprint in each response |
| OpenAI Responses | None listed in the create reference | Temperature lower values are "more focused and deterministic" | None documented for this purpose |
| Azure OpenAI | seed, Preview | "Determinism isn't guaranteed with reproducible output" | system_fingerprint |
| Google Vertex AI (Gemini) | seed, in a Preview section | "Best effort", "Deterministic output isn't guaranteed" | None documented |
| Anthropic Claude | None in the Messages reference we read | Temperature 0 "will not be fully deterministic" | None documented |
| Mistral | random_seed | "Different calls will generate deterministic results" | None documented |
Quotes are from each vendor's API reference or glossary as fetched on the date above. "None listed" means we did not find the parameter in the reference, not that the vendor has ruled it out. Documentation changes without notice, so re-check before you build on any row.
OpenAI and Azure: a seed plus a fingerprint
OpenAI's Chat Completions reference describes seed as a Beta feature and adds that determinism is not guaranteed. It points you to system_fingerprint, which identifies the backend configuration that served the request. If the fingerprint changes between two calls, a difference in output is expected. OpenAI's own archived cookbook example ran five requests at temperature 0 with the same seed and still showed differing text.
Azure's version of the same feature is still labelled Preview. Its documentation adds a useful warning: identical calls with larger max_tokens values generally produce less deterministic responses. That matches the compounding effect in the Feynman test. The Responses API create reference, OpenAI's newer interface, lists temperature but no seed at all.
Anthropic and Google: no guarantee, stated plainly
Anthropic's glossary is the most direct. It says that even with temperature set to 0, results "will not be fully deterministic", and that identical inputs might produce different outputs across calls. It applies that statement to third-party cloud providers serving Claude as well.
Google offers a seed on Vertex AI and calls it best effort. It also notes that changing other parameters, such as temperature, can change the response even with the same seed. Neither vendor documents a fingerprint, so you cannot tell from the response whether the backend changed.
Our position on the seed parameter is unpopular: it is the wrong place to spend your attention. On every closed API that documents one, it reduces sampling variance and leaves the batch-size effect untouched, because the batch is upstream of sampling. At temperature 0 there is no sampling left for the seed to fix.
Mistral: the strongest promise, untested here
Mistral's API reference describes random_seed as making different calls "generate deterministic results". That is the only unqualified promise in the table. We have not tested it, and we would not put that sentence in a contract without a test of your own under real load.
Reproducible LLM outputs you can run yourself: vLLM and SGLang
If reproducibility is a hard requirement, self-hosting an open-weights model is currently the only route where you control the batch. Two open-source servers now ship a switch for it.
vLLM enables batch invariance with one environment variable, VLLM_BATCH_INVARIANT=1. Its documentation calls the feature beta, lists validated families including Llama 3, Qwen3 dense and mixture-of-experts models, DeepSeek-V3 and GPT-OSS, and warns that performance may drop. SGLang added a --enable-deterministic-inference flag from version 0.5.3, compatible with chunked prefill, CUDA graphs and its radix cache.
Determinism costs throughput, and the published numbers let you size it.
SGLang's own benchmark put the average slowdown at 34.35% across its FlashInfer and FlashAttention 3 backends, with most settings between 25% and 45%. Treat both sets of figures as vendor-run benchmarks of their own software on a small model. They tell you the order of magnitude, not your bill.
Tensor parallel and mixture-of-experts limits
The caveats matter more than the headline. At the time of its post, SGLang said mixture-of-experts models were not yet supported and that only one- and two-way tensor parallel setups were deterministic. vLLM's docs say batch invariance under tensor parallelism is not yet supported for all-reduces whose size is not a multiple of 16 bytes. Large models spread across many GPUs are where these gaps bite.
A January 2026 paper, LLM-42 by Gond, Kamath, Ramjee and Panwar, takes a different route. It keeps the fast kernels, then replays candidate tokens under a fixed reduction schedule and rolls back any that would differ. Its argument is that batch-invariant kernels tie determinism too tightly to kernel design, while its overhead scales only with the traffic that needs determinism. That approach is a research result, not a production default.
What LLM nondeterminism does to your evals
This is where the issue stops being academic. If the same model on the same benchmark gives different scores on different runs, a single eval run cannot tell you whether a prompt change helped.
Atil and colleagues measured this directly. They ran five models, including GPT-4o and Llama-3-70B, on eight BBH and MMLU subtasks, 10 times each at temperature 0 with a fixed seed. They report accuracy variations up to 15% across naturally occurring runs, and a gap of up to 70% between the best and worst possible performance. The paper is a preprint and the models it tested are a generation old, which is a reason to rerun it on yours, not to dismiss it.
Score the parsed answer, not the raw string
The paper's most useful contribution is a pair of metrics. TARr@N counts the share of questions where all N raw responses are string-identical. TARa@N counts the share where the parsed answers agree, even if the wording differs. The gap between the two tells you how much of your variance is cosmetic.
Most eval suites only need the second one. If a grader extracts "B" from two differently worded explanations, the variance did not change your score. Build the parser first, then measure agreement on parsed answers over at least a few repeated runs. The mechanics of setting that up are covered in the guide to building an LLM eval suite, and the added cost of repeated runs is priced in the breakdown of LLM evaluation cost per release.
| Practice | Weak version | Version that holds up |
|---|---|---|
| Run count | One run per prompt change | Several runs per change, report the spread |
| Comparison | Raw output string match | Parsed answer agreement (TARa@N style) |
| Settings | Temperature 0 and assume it is fixed | Temperature 0 plus logged seed and fingerprint where offered |
| Regression tests | Golden output snapshots that fail on any token change | Assertions on extracted fields, schema and key facts |
| LLM judges | One judge call per item | Repeated judge calls, with agreement measured |
The last row deserves its own warning. If your grader is itself an LLM, its verdicts carry the same noise as the model being graded. The research on how far judges agree with each other and with humans is collected in the review of LLM judge agreement and bias studies. Our view is blunt: a single run of an eval suite against a hosted API is an anecdote, and a leaderboard built from single runs is a ranking of anecdotes. That is one reason public LLM leaderboards disagree with each other.
What nondeterminism does to AI audits and regulated records
Audit teams often assume they can reproduce a past decision by replaying the prompt. Against a hosted API, that assumption fails twice. The batch at replay time is different, and the backend may have changed underneath the same model name.
The practical rule follows directly. Store the exact request, the exact response, the model identifier, every sampling parameter, and the fingerprint where the vendor returns one. If you ran a regulated workflow, we would treat the stored response as the record and any replay as a fresh, separate decision.
That is a cheaper discipline than it sounds, and most of it belongs in a log you should keep anyway. The field-by-field version is set out in the agent audit log specification. For banks working under model risk guidance, how nondeterminism should be documented in a validation file is covered in the SR 11-7 LLM validation file.
One more use case makes determinism worth paying for. Thinking Machines showed that in reinforcement learning, small numeric differences between the sampler and the trainer quietly make "on-policy" training off-policy. Their run without a correction saw reward collapse near the same step where divergence between the two spiked. With bitwise-identical sampler and trainer, that divergence stayed flat at 0. If you fine-tune with RL, this is the strongest reason to care.
Where this argument is weakest
Three objections deserve a straight answer, and two of them partly win.
Determinism is not correctness
A deterministic model returns the same wrong answer every time. Bitwise reproducibility makes a failure easier to debug, but it does nothing for accuracy. A team that spends a quarter chasing identical outputs while its error rate is unchanged has optimised the wrong number.
Prompt sensitivity may swamp it
Batch-size noise is small per token. Changing one word in a prompt, reordering few-shot examples, or upgrading a model version usually moves outputs far more than serving noise does. We have no head-to-head measurement of the two effects on a modern hosted model, and we did not find one. If your eval variance is large, check prompt and version drift before blaming kernels, and see the post on agent drift monitoring in production for that side of the problem.
The fix is mostly out of a buyer's hands
Batch invariance is a serving decision. No closed vendor in our table offers a documented deterministic mode, and a 34% to 60% throughput cost gives them little reason to. For most teams on hosted APIs, the realistic response is statistical, more runs and better parsing, rather than mechanical. That limits how much practical value this post's mechanism section delivers to anyone who cannot self-host.
Frequently asked questions
Why does temperature 0 give different outputs?
Temperature 0 makes the model always pick the highest scoring token, but the scores themselves can differ slightly between calls. Hosted servers batch your request with other traffic, and the batch size changes the order in which inference kernels add numbers. Rounding then shifts the scores, and a near-tied token can flip. Thinking Machines Lab traced most API nondeterminism to this batch-size effect in 2025.
Does the OpenAI seed parameter make outputs reproducible?
Only partly. OpenAI's Chat Completions reference marks seed as a Beta feature and states that determinism is not guaranteed. It tells you to compare the system_fingerprint field, which changes when the backend configuration changes. Matching seed and fingerprint makes identical outputs more likely, not certain. The newer Responses API reference does not list a seed parameter at all, as of November 2026.
Is Claude deterministic at temperature 0?
No. Anthropic's own glossary states that even with temperature set to 0, results will not be fully deterministic, and that identical inputs can produce different outputs across API calls. It applies this to third-party cloud providers serving Claude as well. The Messages API reference we reviewed lists no seed parameter, so logging full responses is the reliable way to keep a reproducible record.
How do you get reproducible LLM outputs?
On hosted APIs you cannot fully guarantee it, so log every request and response and compare parsed answers across several runs. For true reproducibility, self-host an open-weights model on a server with batch-invariant kernels. vLLM enables this with VLLM_BATCH_INVARIANT=1 as a beta feature, and SGLang offers an enable-deterministic-inference flag, both at a throughput cost.
What is batch invariance in LLM inference?
Batch invariance means a request's result does not depend on how many other requests are processed alongside it. Standard kernels change how they split sums as batch size changes, which alters rounding. Batch-invariant kernels fix the reduction order for RMSNorm, matrix multiplication and attention regardless of batch size, which makes outputs bitwise identical across runs at the cost of some speed.
How many times should I run an LLM eval?
More than once, and enough to see the spread. A 2025 preprint by Atil and colleagues found accuracy varying by up to 15% across 10 runs of the same benchmark at temperature 0 with a fixed seed. Run each condition several times, report the range rather than one score, and treat differences smaller than that range as noise rather than improvement.
Where to start
Pick the eval or regression suite your team trusts most and run it five times, unchanged, against the same model this week. Score it on parsed answers. The spread you see is your noise floor, and any past "improvement" smaller than it should be re-examined.
Then open your production logs and check whether you store the full response, the model identifier, the sampling parameters and the fingerprint where one exists. If any of those is missing, add it before the next audit asks for a replay you cannot produce.
References
- Horace He and Thinking Machines Lab, Defeating Nondeterminism in LLM Inference, 10 September 2025. Used for the 1,000 run experiment, the batch-invariance mechanism, timings and the RL finding. Code at batch_invariant_ops.
- Atil et al., Non-Determinism of "Deterministic" LLM Settings, arXiv 2408.04667, v5 April 2025. Used for run-to-run accuracy variation and the TAR metrics.
- Gond, Kamath, Ramjee and Panwar, LLM-42: Enabling Determinism in LLM Inference with Verified Speculation, arXiv, January 2026. Used for the verify and rollback alternative.
- LMSYS, Towards Deterministic Inference in SGLang, 22 September 2025. Used for slowdown figures and tensor parallel limits.
- vLLM, Batch Invariance documentation, retrieved 21 November 2026. Used for the environment variable, beta status and limits.
- OpenAI, Chat Completions API reference and reproducible outputs cookbook; Microsoft, Azure OpenAI reproducible output. Retrieved 21 November 2026.
- Google Cloud, Vertex AI content generation parameters, retrieved 21 November 2026. Used for seed and temperature wording.
- Anthropic, Claude glossary, and Mistral, API reference, both retrieved 21 November 2026. Used for temperature and random_seed wording.
Weakest point in the source base: every performance figure here comes from the teams that built the software, on small models, and we did not run any determinism test ourselves. Vendor documentation was read on 21 November 2026 and can change without notice.
Related reading