# Why does AI give a different answer every time you ask?

> A language model writes one token at a time, drawing each from weighted odds. That is why the same question can return different answers, and why temperature zero is not a guarantee.

URL: https://vizhow.eu/en/tech-internet/why-ai-answers-differently-every-time
Topics: Tech & Internet · Series: One Fact a Day
Applies to: Most countries
Updated: 2026-10-27

## Short answer
A language model writes its answer one token at a time, drawing each next word from a ranked list of probabilities instead of always taking the top one. That built-in randomness, tuned by a setting called temperature, is why the same question can return different answers, even when randomness is turned down to zero.

## Key points
- The model writes one token at a time, not a pre-written answer.
- Each token is drawn from weighted odds, not always the most likely one.
- Always picking the top word makes text bland and repetitive (Holtzman et al., 2020).
- Temperature 0 makes answers more repeatable, not guaranteed identical.
- Some providers now ignore the temperature setting.

## The model writes, it does not look up

A language model does not fetch a stored answer. It produces text one **token** at a time, and a token is a word or a piece of one. At each step it ranks the possible next tokens by probability.

After "The cat sat on the", a token like "mat" may lead, but "sofa" and "floor" are still in the running. The odds in this example are illustrative.

[Diagram] A loop in which the model scores next tokens, draws one by weight, and appends it to the text.
How one token gets written: Text so far (your question plus what is written) → Score next tokens (a probability for each candidate) [read]; Score next tokens (a probability for each candidate) → Draw one, weighted (not always the top one) [odds]; Draw one, weighted (not always the top one) → Add it to the text (then repeat) [token]; Add it to the text (then repeat) → Text so far (your question plus what is written) [next step]
*One step of writing, repeated for every token.*

## Why not always pick the top word?

Researchers found it backfires. In their 2020 ICLR paper, Holtzman and colleagues describe text from likelihood-maximising decoding as "bland and strangely repetitive", and propose nucleus sampling, which draws from a dynamic nucleus of likely tokens and cuts the unreliable tail.

## What temperature does

Google's documentation says temperature "controls the degree of randomness in token selection", with lower values suited to predictable answers. As a mental model, low temperature sharpens the odds so favorites win more often; high temperature flattens them so long shots get a chance.

[Diagram] Two columns comparing low and high temperature.
Temperature as a dial: Low temperature: Favorites win more often; More repeatable answers; Can read as bland or repetitive | High temperature: Long shots get a chance; More variety between runs; More risk of odd choices
*A mental model of the dial, not a measurement.*

## Temperature 0 is not a guarantee

In a test published on 10 September 2025, Thinking Machines asked the open model Qwen3-235B-A22B-Instruct-2507 the same prompt, "Tell me about Richard Feynman", 1,000 times at temperature 0, for 1,000 tokens each. It produced 80 unique completions. The most common appeared 78 times. The completions first diverged at token 103: 992 said "Queens, New York" and 8 said "New York City".

The authors argue the popular "concurrency plus floating point" story is incomplete. Their main cause is a lack of batch invariance: the way the maths is grouped changes with server load. With batch-invariant kernels, all 1,000 completions were identical.

> **Limits of this result** It is one lab's report on one open model and one prompt, not independently replicated by VIZHOW. It does not tell us what any consumer chatbot does.

## Providers are changing the knob

Anthropic's migration guide says temperature, top_p and top_k are not supported on Claude 4.7 and later, and that requests sample at defaults including a temperature of 1.0. Google says Gemini 4 and Gemini 3.6+ ignore custom values for temperature, top_p and top_k. OpenAI describes a seed parameter as best effort: outputs are "mostly identical", not guaranteed.

Practical takeaway: if the first answer isn't what you wanted, ask again.

## Questions people ask
### Why does AI give different answers to the same question?
Because it picks each next token from weighted odds rather than always the most likely one. Small differences early in the text then compound into a different answer.

### Does temperature 0 give the same answer every time?
Not always. It makes answers more repeatable, but in one Thinking Machines test an open model gave 80 different completions to one prompt across 1,000 runs at temperature 0.

### Why not always choose the most likely word?
Research from 2020 found that maximising likelihood produces text that is bland and strangely repetitive, so some randomness helps.

### Can I set the temperature in ChatGPT?
We could not verify what sampling settings the ChatGPT app uses, so we make no claim. Some API providers have removed or ignore the setting.

## Sources and notes
- [Confirmed fact] [Holtzman et al., The Curious Case of Neural Text Degeneration (2020)](https://arxiv.org/abs/1904.09751), arXiv / ICLR 2020 — Abstract: decoding strategy matters; likelihood maximisation is bland and repetitive; nucleus sampling.
- [Confirmed fact] [Defeating Nondeterminism in LLM Inference (10 Sep 2025)](https://thinkingmachines.ai/blog/defeating-nondeterminism-in-llm-inference/), Thinking Machines — 80 unique completions of 1,000; 78 most common; divergence at token 103; batch invariance.
- [Confirmed fact] [Prompt design strategies](https://ai.google.dev/gemini-api/docs/prompting-strategies), Google AI for Developers — Definition of temperature; Gemini 4 and 3.6+ ignore sampling parameters.
- [Confirmed fact] [Reproducible outputs with the seed parameter](https://developers.openai.com/cookbook/examples/reproducible_outputs_with_the_seed_parameter), OpenAI — Same seed gives mostly identical outputs; best effort.
- [Confirmed fact] [Text generation guide](https://developers.openai.com/api/docs/guides/text), OpenAI — Generated content is non-deterministic.
- [Confirmed fact] [Migrating to API version 2026-10-21](https://platform.claude.com/docs/en/api/migration-2026-10-21), Anthropic — Sampling parameters removed on Claude 4.7 and later; default temperature 1.0.
- [Teaching simplification] [The weighted-dice metaphor](https://ai.google.dev/gemini-api/docs/prompting-strategies), VIZHOW — Teaching simplification of token sampling; sources describe token selection, not this exact picture.
