Temperature
One number decides how far the sampler is allowed to stray from the model’s favourite token.
Part of the Turning the dials track on lAItest.
One number decides whether a model sounds like a filing cabinet or like it has been drinking.
It is called temperature.
Temperature divides every score before softmax ever sees it.
Divide the scores by a small number and the gaps between them stretch, so the leader takes nearly all the probability. Divide by a larger number and the gaps compress, so unlikely tokens get a real share of the draw. Low is sharp and predictable. High is flat and surprising. The model’s ranking has not moved at all — only how much the sampler is permitted to disagree with it.
Try it
Drag temperature and watch the bars reshape. Then run the same settings five times and see how far the output travels. This step is an interactive widget; open the lesson to use it.
The range depends on whose API you are calling.
On Anthropic’s Messages API, temperature runs from 0.0 to 1.0 and defaults to 1.0. Other providers use other ranges, so a value copied from one API into another can mean something quite different. Some models refuse the dial outright: Claude Sonnet 5 returns an error for a non-default temperature, top_p or top_k rather than quietly ignoring it. Read the reference for the exact model you are calling.
A common misconception
Commonly believed: Turn the temperature up when you want the model to be more creative.
Actually: Temperature adds no ideas. It only makes the sampler willing to take lower-scoring tokens, and the lowest-scoring ones usually score low because they are wrong. Past a point you stop getting invention and start getting noise. A better-written prompt beats a hotter dial almost every time.
In one sentence
Temperature is not a creativity slider. It is a willingness-to-disagree-with-the-model slider.