Ask a chat assistant the same question twice and you will often get two different answers. For a casual chat that is fine. For a test suite, a customer-facing bot or a compliance report, it is a real problem.
This article explains where that variation comes from, why "just set temperature to 0" no longer holds, and how to design work that tolerates it.
What temperature actually does
A language model does not pick one next word. It produces a probability for every possible next token, and a sampling step chooses one of them.
Temperature controls how adventurous that choice is. Google's Vertex AI documentation says a temperature of 0 means the highest-probability tokens are always selected, while higher values give more diverse or creative results. Top-P works alongside it, limiting the choice to the most likely tokens until their probabilities add up to the top-P value.
The same Google page adds two caveats that matter. Lower temperatures give predictable but not completely deterministic results, and even a fixed seed is only a "best effort", with deterministic output not guaranteed.
What's changing
"Same prompt, same answer" was never a safe assumption, and vendors are now taking the knob away.
Temperature 0 still varies. In September 2025 Horace He of Thinking Machines Lab sent the same prompt, "Tell me about Richard Feynman", to the Qwen3-235B model 1,000 times at temperature 0. The run produced 80 different completions, which first split at the 103rd token: some said "Queens, New York", others "New York City".
The cause is the server, not the model. The Thinking Machines team argue that the usual explanation (parallel maths plus floating-point rounding) is incomplete, and that the real culprit is a lack of batch invariance: how busy the server is changes the batch size, the batch size changes the numerics, and from the user's side the output looks random. With batch-invariant kernels, all 1,000 completions were identical, though the deterministic setup was slower (42 seconds against 26 seconds in their test).
Accuracy moves too, not just wording. A study by Atil and colleagues, first posted to arXiv in 2024 and revised in April 2025, ran five LLMs configured to be deterministic on eight common tasks, ten times each. Accuracy varied by up to 15% across runs, the gap between best and worst possible results reached up to 70%, and none of the five models gave repeatable accuracy on every task.
Vendors are taking the dial away. Anthropic's API release notes say that on Claude Sonnet 5, launched 30 June 2026, setting temperature, top-p or top-k to non-default values returns a 400 error, and code moved to Claude Haiku 5.5 can hit the same error. Google's documentation says custom temperature values are ignored on Gemini 3.6 Flash and later, and recommends 1.0 as the starting value.
So a sampling setting can't make an LLM repeatable; repeatability has to be designed into the work around the model.
What this looks like in real work
The examples below are illustrative scenarios, not case studies.
Example: A QA engineer writes a test that checks the bot's reply equals one exact sentence. It passes on Monday and fails on Tuesday with no code change. The fix is to test what matters (the refund amount is correct, the policy link is present) rather than the exact wording.
Example: A team migrates its document summariser to a newer model and the API starts returning errors. The old code still sends temperature 0 on every call. Removing the parameter fixes the error, but the team now needs a different way to keep summaries consistent.
Example: In a client demo the assistant gives a weaker answer than in rehearsal. Nothing is broken; it drew a different sample, which running the key prompts several times beforehand would have revealed.
Turning variation into a tool
Variation is not only a risk. Wang and colleagues showed in their 2022 "self-consistency" paper that sampling several reasoning paths and taking the most consistent final answer beat a single greedy answer.
On the GSM8K maths benchmark the paper reports a 17.9% gain over standard chain-of-thought prompting. The lesson for practitioners: when an answer matters, ask more than once and compare.
How AI-DLC helps
The AI-Driven Development Life Cycle, published by AWS in July 2025, is built for a model that doesn't give the same output twice. In AI-DLC the AI creates a detailed plan and asks clarifying questions, and it implements only after humans validate the plan.
That validation step is where non-determinism gets caught. During Inception, Mob Elaboration has the whole team check AI's questions and proposals before they become requirements and units of work, so a lucky or unlucky sample does not quietly become the spec.
During Construction, Mob Construction has the team settle technical and architectural decisions in real time while the AI proposes code and tests. Working in short bolts, measured in hours or days, means a variable output is reviewed soon after it appears. In Operations, AI manages deployments with the team's oversight, which is where repeated checks on live behaviour belong.
Practising AI-DLC builds the habit this topic needs: treat each AI output as one sample to validate.
Worked example: making a flaky AI check reliable
Illustrative scenario: your team's chatbot test fails roughly one run in five, and nobody can reproduce it.
Step 1. Run the same prompt ten times and save every output. Note which parts change (wording, order, facts) and which stay fixed.
Step 2. Rewrite the test to check meaning and required facts, for example that the answer names the correct plan and price, instead of matching an exact string.
Step 3. Ask the model for structured output, such as a fixed set of fields, so the parts you test are in predictable places.
Step 4. Set a pass threshold, for example nine correct out of ten runs, and record the result for every release so you can see if consistency drops.
Try it this week
Thinking Machines published its batch-invariant kernels as an open-source, MIT-licensed repo. Reading the README is enough.
https://github.com/thinking-machines-lab/batch_invariant_ops
Step 1. Pick one factual question from your own work and ask it five times in any free chat assistant, starting a new chat each time.
Step 2. Paste the five answers side by side and mark what changed: wording only, structure, or actual facts.
Step 3. Ask the same question five more times, adding "Answer in exactly three bullet points with one number each." Compare how much the spread shrinks.
Step 4. Read the README of the repo above and write two sentences explaining batch invariance in your own words.
Your next step
🌱 Fresher: Do the five-run experiment above and post your side-by-side comparison in the group. Be ready to explain in one sentence why temperature 0 is not a guarantee.
🚀 Mid-career: Find one test or check in your project that compares AI output to an exact string. Rewrite it to check facts and structure across several runs.
🧭 Senior: Check whether any of your production code sends temperature or top-p to models that now reject or ignore them. Make "run it several times and validate" an explicit step in your team's AI review process.
Sources
Thinking Machines Lab, "Defeating Nondeterminism in LLM Inference", 10 September 2025. https://thinkingmachines.ai/blog/defeating-nondeterminism-in-llm-inference/
Atil et al., "Non-Determinism of 'Deterministic' LLM Settings", arXiv, revised 2 April 2025. https://arxiv.org/abs/2408.04667
Google Cloud, "Content generation parameters", Vertex AI documentation, accessed 2 December 2026. https://docs.cloud.google.com/vertex-ai/generative-ai/docs/multimodal/content-generation-parameters
Anthropic, "Claude Platform release notes: API", entries of 30 June and 7 October 2026. https://platform.claude.com/docs/en/release-notes/api
Wang et al., "Self-Consistency Improves Chain of Thought Reasoning in Language Models", arXiv, ICLR 2023. https://arxiv.org/abs/2203.11171
AWS DevOps and Developer Productivity Blog, Raja SP, "AI-Driven Development Life Cycle", 31 July 2025. https://aws.amazon.com/blogs/devops/ai-driven-development-life-cycle/