short · 3 min
Temperature
Flattens or sharpens the probabilities before sampling. Newer closed reasoning models no longer let you set it.
updated 23 Sept 2026
For years the advice went like this: if you want the same answer every time, set temperature to 0. If you want something more creative, turn it up, maybe to 0.7. Let's see what the dial actually does, and then where that advice stops working.
One division
Here's how a model picks a token (sampling): it scores every token in its vocabulary, softmax turns the scores into probabilities, and one token is drawn at random by weight.
Temperature slips in just before softmax. Every score gets divided by one number, T. That's all.
Let's take the smallest case we can: two tokens, A with a score of 1 and B with a score of 3.
| Temperature | Chance of A | Chance of B |
|---|---|---|
| 0.5 | 2% | 98% |
| 1 (no change) | 12% | 88% |
| 2 | 27% | 73% |
Dividing by 0.5 doubles the gap between the scores, so B, already the favourite, wins almost every time. Dividing by 2 halves the gap, and A gets a real shot. Keep turning it up and the two drift towards a coin flip.
Now picture that across a whole vocabulary instead of two tokens. Low temperature: the top few tokens win nearly every time, and the writing gets steady and a bit dull. High temperature: rarer tokens get picked more, and the writing gets more varied and more likely to wander off. The 0.7 for creative work is a common first guess. Try it on your own examples before you trust it.
So what happens at 0?
You can't divide by zero. So the software doesn't try. At temperature 0 it skips the math and takes the highest-scored token every time, which is greedy decoding.
That sounds like it should give the same output on every call. It doesn't, quite. Anthropic's own docs said that even at 0, Claude's results weren't fully deterministic. Why a real server can give different answers to the same request is in sampling. For us it means one thing: if you're writing tests against model output, let them accept some variation, even at 0.
The same number means different things
Most providers let you set it from 0 to 2. Claude's range was 0 to 1, with 1 as the default. So 0.7 copied from one provider's docs isn't the same setting on another.
And top-p is a different kind of dial. Temperature reshapes the whole list, tail included. Top-p cuts the tail off and leaves the shape of what's left alone.
And now you often can't set it
Here's where the old advice runs out. As of 2026-09, the newest closed models have mostly taken the dial away.
On Claude, models released after Opus 4.6 reject any temperature other
than the default 1.0 with an error. The parameter is marked deprecated.
On OpenAI's GPT-6 you're told to remove temperature whenever reasoning
effort isn't none, and GPT-6 Astra has no none setting, so there you
can't set it at all.
So before you add a temperature setting to your code, check the model. Send it to one that doesn't take it and the request may fail. On these models the provider decides how tokens get picked. If you want a steadier or looser style, the place to ask for it is the prompt.
Further reading
- Generation configurations: temperature, top-k, top-p, and test time compute, Chip Huyen, 2024. Where the two-token example comes from. A clear read on all the sampling dials together.
- Create a Message, Anthropic API reference, 2026. Claude's temperature parameter: the range, the old advice, the note about 0 and the deprecation.
- Model guidance (GPT-6), OpenAI docs, 2026. Check the "unsupported parameters" list before you send temperature to a GPT-6 model.