What is temperature in AI?
A setting that controls how much chance goes into each word a model picks. Low gives focused, predictable answers; high gives more varied ones.
beginner · Also called Temperature (Sampling), Sampling Temperature
A model writes one TokenTokenThe small piece of text a language model reads and writes, often part of a word. Prices, limits and the context window are all counted in tokens. at a time. At each step it does not know the next word. It has a score for every possible next piece, from very likely to very unlikely. Then something has to pick one.
The simplest rule is to always take the top-scoring piece. That gives the same answer every time, but on longer text it starts to repeat itself. So most apps pick at random, weighted by the scores. The favourite is chosen most often, the runner-up less, and anything with a chance above zero can come up now and then.
Temperature reshapes those chances before the pick.
- Low temperature makes the favourite even more likely. Answers are focused and predictable.
- High temperature evens the chances out. Answers are more varied, and more often odd.
Even at 0, the exact same words are not guaranteed every time.
Which setting for which job
There is no single right value. DeepSeek, for example, recommends 0 for coding and maths and 1.5 for creative writing and poetry. You want the same answer to a sum every time, and a few surprises in a poem.
You often cannot set it any more
In the chat apps, temperature is set for you. In the APIs it used to be a standard dial, and that is changing. Kimi K3 fixes it at 1. Anthropic's newer models, from Claude Opus 4.7 on, return an error if you send anything but the default. Google deprecated it for Gemini in July 2026. And DeepSeek's models ignore it whenever they are in thinking mode.
What to do with this
If an answer comes out different each time you ask, that is the dice, not a fault. Ask for the format or tone you want in words, which works everywhere. And if your code still sends a temperature, check the model's documentation: on some models it is ignored, and on others it is now an error.
The cat sat on the …
- mat50%
- sofa22%
- floor17%
- roof7%
- keyboard4%
- moon1%
Low temperature: the likeliest word nearly every time. High: the unlikely words get a real chance.
The scores are made up to show the effect, not taken from a real model.
Sources