ExplainerSI evaluation

LLM nondeterminism: why the same input gets different answers

Why the same request to an LLM can return different answers even at temperature 0: sampling, floating-point order, server load, hardware and serving changes under one model ID.

Cover of the full report: LLM nondeterminism: why the same input gets different answers
The research behind this article, with every source listed. 19 pages.

Key points

From the Summary of the full report

  1. Temperature 0, the setting that makes a model take its most probable token at every step, narrows variation without removing it. In a September 2025 experiment, 1,000 temperature-0 runs of one prompt on an open-weights model produced 80 different completions [1], and model providers' own documentation says identical requests can still return different outputs [12, 15].
  2. Repeated runs at fixed settings move measured accuracy. A 2024 study of five models from different families, each run ten times at temperature 0 with a fixed seed, found accuracy varying by up to 15% between runs [2].
  3. Floating-point addition can round differently when its order changes, and inference servers change that order with the number of requests they process together [1, 20, 33]. In a September 2025 experiment, GPU routines (kernels) that keep the order fixed whatever the batch size, which its authors call batch-invariant, made all 1,000 temperature-0 completions of one prompt identical [1].

Send the same prompt to the same model with the same settings twice, and the two answers can differ. LLM nondeterminism is that variation: output that changes for a request that has not changed. Part of it is by design: one provider's API sets the default temperature at 1, and another uses a random seed unless the caller fixes one, so at default settings each token is drawn at random [14, 15]. The rest survives when sampling is switched off, and it comes from how inference servers do arithmetic, how they batch requests and how a model is served over time.

In a September 2025 experiment on an open-weights model, 1,000 runs of one prompt at temperature 0 produced 80 different completions [1]. A 2024 study of five models from different families, each run ten times at temperature 0, top-p 1 and a fixed seed, found accuracy varying by up to 15% between runs [2]. For anyone testing an agent before it goes live, a single run is one sample from a spread of possible answers.

Where LLM nondeterminism comes from

At each step a language model assigns a probability to every token in its vocabulary, and a decoding rule picks one. Sampling draws at random from that distribution, so any token with a non-zero probability can be chosen [28]. Temperature reshapes the distribution: one provider's API reference describes higher values as more random and lower values as more focused [14]. Top-p, or nucleus sampling, keeps only the tokens in the top share of the probability mass [14, 27]. Greedy decoding skips the draw and always takes the most probable token, which is what temperature 0 means [1, 15].

Sampling explains why answers vary at default settings. The causes that survive greedy decoding fall into four groups.

Cause What can differ between two identical requests Sources
Floating-point order The order in which the GPU adds numbers [1, 20]
Batch composition How many other requests share the server's batch [1, 33]
Hardware and precision GPU type, GPU count, number format, tensor-parallel size [3, 34]
Serving stack Router, sampling code and compiler behind one model ID [11, 24]

Temperature 0 is not a determinism switch

One model provider's glossary states that results are not fully deterministic even with temperature set to 0, and that identical inputs can produce different outputs across API calls [12]. Another calls temperature-0 responses mostly deterministic, with a small amount of variation still possible [15].

Measured figures agree. A study of a widely used hosted chat model on 829 code-generation problems, five requests per problem, counted the problems where the five programs produced no equal test output [5]. On CodeContests that share was 75.76% at the default temperature of 1 and 43.64% at temperature 0 [5]. On HumanEval it fell from 47.56% to 18.29% [5]. A January 2026 preprint found a unique output fraction of 0.240 for a hosted model and 0.093 for an 8-billion-parameter open-weights model on exact repeats at temperature 0, against 0.987 for both at 0.7 [32].

Some model families take the setting away. One provider's documentation states that its newest families ignore custom temperature, top-p and top-k values [16].

Batch invariance: the load on the server is part of the input

The usual explanation is floating-point arithmetic. Rounding A + B and then adding C can give a different result from adding A to the rounded B + C, so computations that look identical can differ even when every operation follows the IEEE 754 standard [20].

The September 2025 post "Defeating Nondeterminism in LLM Inference" argues that this is only half the story [1]. The post finds that the GPU routines (kernels) in a language model's forward pass, matrix multiplication included, give the same bits on every run for the same input [1]. What they lack is batch invariance: a result for one request that stays the same however many other requests are processed alongside it [1]. Servers batch requests for speed, and kernels' reduction orders vary with batch size, so the order of additions for one user's request shifts with the load [1, 33]. From one user's side, the other users are a hidden part of the input. The post's authors argue that varying load is the main reason nearly all inference endpoints are nondeterministic [1].

Their experiment shows the effect. All 1,000 completions of "Tell me about Richard Feynman" matched for the first 102 tokens [1]. At token 103, 992 continued with "Queens, New York" and 8 with "New York City" [1]. With kernels rewritten so that each element's reduction order stays fixed whatever the batch size, all 1,000 completions were identical [1].

Hardware, precision and expert routing

A NeurIPS 2025 study ran open-weights models of 7 to 8 billion parameters under 12 configurations: two GPU types (L40S and A100), two GPU counts and three batch sizes [3]. Under the 16-bit bfloat16 (BF16) format with greedy decoding, a reasoning model distilled from a larger one showed a standard deviation of up to 9% in accuracy on AIME'24, and response lengths that differed by up to 9,000 tokens [3]. Under 32-bit floating point (FP32), results were near-perfectly reproducible [3]. In reasoning models, the authors note, minor rounding differences in early tokens can cascade into divergent chains of thought [3].

Running a model across a different number of GPUs moves results too. A 2025 paper found that identical inputs gave different outputs when the tensor-parallel size changed, even under greedy decoding, and built kernels that give bit-wise identical results regardless of that size [34].

Sparse mixture-of-experts models add a mechanism of their own. Under capacity limits, tokens from different sequences compete for places in expert buffers, so such a model is deterministic only at the level of the batch [25]. Tokens that overflow an expert are not processed by that layer [26]. No source reviewed shows this in a particular hosted model. A code-generation study lists it, for the hosted model it tested, only as one hypothesis [5].

The same model ID, a different serving stack

One model provider's documentation says each ID identifies a pinned version with fixed weights, while the serving infrastructure around it, including the request router, safety classifiers and sampling logic, can change, occasionally with minor differences in behavior [11]. Aliases move further: another provider's latest aliases are hot-swapped with each new release, with two weeks' notice [17].

Infrastructure changes can also be faults. A model provider's September 2025 postmortem describes three infrastructure bugs that intermittently degraded responses between August and early September 2025 [24]. A context window routing error reached 16% of one model's requests in the worst hour, on 31 August, and an approximate top-k operation sometimes returned wrong results, only for certain batch sizes and model configurations [24]. The provider's evaluations did not capture the degradation users reported [24].

Version changes are a separate effect. Two dated versions of one widely used hosted model, three months apart in 2023, scored 84% and 51% on the same prime-number questions [6].

Can you make LLM output deterministic?

Partly, and at a cost. Hosted seeds are best effort. One provider's 2023 guide said outputs are mostly identical when the seed, the parameters and a system fingerprint match, with a small chance that they differ [13]. Its current API reference marks both the seed and the fingerprint deprecated and states that determinism is not guaranteed [14]. Another provider says the same of its seed [15].

Open inference engines go further. vLLM offers a batch-invariant mode, and its documentation limits reproducibility to the same hardware and the same vLLM version [22, 23]. Over 50 trials on an 8-billion-parameter open-weights model, SGLang's deterministic mode returned one unique output in every test, against up to 18 in normal mode, and in offline tests most of its slowdowns fell between 25% and 45% [21]. A January 2026 preprint makes determinism a per-request option, so its cost scales with the share of traffic that asks for it [33].

What it means for testing an agent

Agents compound the effect. A January 2026 guide from one model provider notes that a task that passed on one run might fail on the next [31]. In an April 2026 preprint at temperature 1.0, agents picked the same tools in the same order with a mean similarity of 0.87, while the consistency of their arguments averaged 0.69 [35]. pass^k, the chance that all k trials succeed, scores whether an agent succeeds every time [10]. Agent evaluation metrics shows how it is computed.

The sources point to three habits. Score repeated runs with error bars, and do not lower the temperature only to reduce variance, which a 2024 paper on error bars advises against unless the new temperature is the one under study [8]. Record the prompts, code, generation settings and model version behind every score [9, 30]. Test rephrasings as separate inputs, since formatting changes alone moved one open-weights model by up to 76 accuracy points [7]. Evaluations often score a single output per example [4]. What agent benchmarks measure covers how public agent benchmarks score and the flaws audits have found in them, and the black-box evaluation protocol sets out repeated trials on pinned versions.

Rillor's agent tests before go-live run on an organization's own tasks with black-box logging and replayable runs, and score consistency: the same decision across repeated runs, rephrasings and model versions.

Read the full report

The full report sets out each cause with its measured figures, what seeds, fingerprints and deterministic modes promise, what deterministic inference costs in open engines, and all 35 sources.

The full report

LLM nondeterminism: why the same input gets different answers

The research behind this article, with every source listed. 19 pages.

  1. Summary
  2. Background
  3. Method
  4. Findings
  5. Implications
  6. Limits of this analysis
  7. Sources

Sources

  1. Defeating Nondeterminism in LLM Inference. Horace He in collaboration with others at Thinking Machines, Thinking Machines Lab, Connectionism, 10 September 2025, viewed 7 November 2026. https://thinkingmachines.ai/blog/defeating-nondeterminism-in-llm-inference/
  2. Non-Determinism of "Deterministic" LLM Settings. Berk Atil and others, arXiv:2408.04667, version 5, 2 April 2025 (first version 6 August 2024), viewed 7 November 2026. https://arxiv.org/abs/2408.04667
  3. Understanding and Mitigating Numerical Sources of Nondeterminism in LLM Inference. Jiayi Yuan and others, NeurIPS 2025, arXiv:2506.09501, version 2, 24 October 2025, viewed 7 November 2026. https://arxiv.org/abs/2506.09501
  4. The Good, The Bad, and The Greedy: Evaluation of LLMs Should Not Ignore Non-Determinism. Yifan Song, Guoyin Wang, Sujian Li and Bill Yuchen Lin, arXiv:2407.10457, 15 July 2024, viewed 7 November 2026. https://arxiv.org/abs/2407.10457
  5. An Empirical Study of the Non-determinism of ChatGPT in Code Generation. Shuyin Ouyang, Jie M. Zhang, Mark Harman and Meng Wang, ACM Transactions on Software Engineering and Methodology, arXiv:2308.02828, version 2, 17 October 2024, viewed 7 November 2026. https://arxiv.org/abs/2308.02828
  6. How is ChatGPT's behavior changing over time? Lingjiao Chen, Matei Zaharia and James Zou, arXiv:2307.09009, version 3, 31 October 2023, viewed 7 November 2026. https://arxiv.org/abs/2307.09009
  7. Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design. Melanie Sclar, Yejin Choi, Yulia Tsvetkov and Alane Suhr, ICLR 2024, arXiv:2310.11324, version 2, 1 July 2024, viewed 7 November 2026. https://arxiv.org/abs/2310.11324
  8. Adding Error Bars to Evals: A Statistical Approach to Language Model Evaluations. Evan Miller, arXiv:2411.00640, 1 November 2024, viewed 7 November 2026. https://arxiv.org/abs/2411.00640
  9. Lessons from the Trenches on Reproducible Evaluation of Language Models. Stella Biderman, Hailey Schoelkopf and others, arXiv:2405.14782, version 3, 31 May 2026, viewed 7 November 2026. https://arxiv.org/abs/2405.14782
  10. τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains. Shunyu Yao, Noah Shinn, Pedram Razavi and Karthik Narasimhan, arXiv:2406.12045, 17 June 2024, viewed 7 November 2026. https://arxiv.org/abs/2406.12045
  11. Model IDs and versioning, Claude Platform documentation. Anthropic, viewed 7 November 2026. https://platform.claude.com/docs/en/about-claude/models/model-ids-and-versions
  12. Glossary, Claude Platform documentation. Anthropic, viewed 7 November 2026. https://platform.claude.com/docs/en/about-claude/glossary
  13. How to make your completions outputs consistent with the new seed parameter. Shyamal Anadkat, OpenAI Cookbook, 6 November 2023, viewed 7 November 2026. https://developers.openai.com/cookbook/examples/reproducible_outputs_with_the_seed_parameter
  14. Create chat completion, API reference. OpenAI, viewed 7 November 2026. https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create
  15. Content generation parameters, Gemini Enterprise Agent Platform documentation. Google Cloud, last updated 7 November 2026, viewed 7 November 2026. https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/capabilities/content-generation-parameters
  16. Text generation, Gemini API documentation. Google, viewed 7 November 2026. https://aistudio.google.com/docs/text-generation
  17. Gemini models, Gemini API documentation. Google, viewed 7 November 2026. https://aistudio.google.com/docs/models
  18. Floating Point and IEEE 754 Compliance for NVIDIA GPUs. NVIDIA, CUDA 13.5 documentation, viewed 7 November 2026. https://docs.nvidia.com/cuda/floating-point/index.html
  19. Towards Deterministic Inference in SGLang and Reproducible RL Training. The SGLang Team, LMSYS Org, 22 September 2025, updated 24 September 2025, viewed 7 November 2026. https://www.lmsys.org/blog/2025-09-22-sglang-deterministic/
  20. Batch Invariance, vLLM documentation. vLLM project, 4 November 2026, viewed 7 November 2026. https://docs.vllm.ai/en/latest/features/batch_invariance/
  21. Reproducibility, vLLM documentation. vLLM project, 7 October 2026, viewed 7 November 2026. https://docs.vllm.ai/en/latest/usage/reproducibility/
  22. A postmortem of three recent issues. Anthropic, 17 September 2025, viewed 7 November 2026. https://www.anthropic.com/research/a-postmortem-of-three-recent-issues
  23. From Sparse to Soft Mixtures of Experts. Joan Puigcerver, Carlos Riquelme, Basil Mustafa and Neil Houlsby, ICLR 2024, arXiv:2308.00951, version 2, 27 May 2024, viewed 7 November 2026. https://arxiv.org/abs/2308.00951
  24. Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity. William Fedus, Barret Zoph and Noam Shazeer, Journal of Machine Learning Research, arXiv:2101.03961, version 3, 16 June 2022, viewed 7 November 2026. https://arxiv.org/abs/2101.03961
  25. The Curious Case of Neural Text Degeneration. Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes and Yejin Choi, ICLR 2020, arXiv:1904.09751, version 2, 14 February 2020, viewed 7 November 2026. https://arxiv.org/abs/1904.09751
  26. Generation strategies, Transformers documentation. Hugging Face, viewed 7 November 2026. https://huggingface.co/docs/transformers/main/en/generation_strategies
  27. Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile, NIST AI 600-1. National Institute of Standards and Technology, July 2024, viewed 7 November 2026. https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.600-1.pdf
  28. Demystifying evals for AI agents. Anthropic, 9 January 2026, viewed 7 November 2026. https://www.anthropic.com/research/demystifying-evals-for-ai-agents
  29. Quantifying non deterministic drift in large language models. Claire Nicholson, arXiv:2601.19934, 12 January 2026, viewed 7 November 2026. https://arxiv.org/abs/2601.19934
  30. LLM-42: Enabling Determinism in LLM Inference with Verified Speculation. Raja Gond, Aditya K Kamath, Ramachandran Ramjee and Ashish Panwar, arXiv:2601.17768, version 2, 30 January 2026, viewed 7 November 2026. https://arxiv.org/abs/2601.17768
  31. Deterministic Inference across Tensor Parallel Sizes That Eliminates Training-Inference Mismatch. Ziyang Zhang, Xinheng Ding, Jiayi Yuan and others, arXiv:2511.17826, version 2, 29 May 2026 (first version 21 November 2025), viewed 7 November 2026. https://arxiv.org/abs/2511.17826
  32. How Consistent Are LLM Agents? Measuring Behavioral Reproducibility in Multi-Step Tool-Calling Pipelines. Abel Yagubyan, arXiv:2605.28840, 23 April 2026, viewed 7 November 2026. https://arxiv.org/abs/2605.28840

Notices

NVIDIA, AMD, Ceph, Kubernetes and related product names are trademarks of their owners and are used only to identify products. No affiliation or endorsement is implied.

Superintelligence (SI) outputs can be wrong. Important decisions should include human review.

Test your agent before it goes live.

Send us the tasks your agent handles, the model versions it runs on and the decisions it is trusted with.

Evaluate an agent