What Is Temperature in AI? (Creativity Setting Explained)
Updated July 23, 2026 · Data as of 2026-07-09
Temperature is a setting that controls how much randomness enters the model's word-by-word choices. Low values make it pick the most likely continuation almost every time; high values let it choose less likely ones more often.
At each step the model holds a ranked set of candidate next tokens with probabilities attached. Temperature reshapes that distribution before one is picked. Near zero, the top candidate wins nearly always, and the same prompt returns nearly the same answer each time. Raised, the gap between candidates narrows, so surprising choices surface more often. Pushed high, the text loosens until it drifts off topic or stops making sense.
Calling it a creativity dial oversells it. It does not give the model better ideas; it makes it less predictable, which sometimes reads as originality and sometimes reads as sloppiness. Real variety comes far more from what you ask for, a different angle, a constraint, an audience, than from loosening the sampling. Turning the number up is not a substitute for a better prompt.
Sensible settings follow the task. Near zero suits anything with a right answer: code, extraction, classification, formatting, and any output another program will parse. A middle range suits ordinary prose, where you want it to read naturally rather than mechanically. Higher settings suit brainstorming, where you intend to throw most of the output away and are hunting for one usable direction. Most consumer chat products choose a middle value for you and never expose the control.
Why it matters when you choose a tool
Temperature matters as a buying criterion only if you need repeatability. Anyone building automation, evaluating outputs against a fixed expectation, or generating structured data should insist on a tool that exposes the setting, because unpredictable variation in a pipeline is a defect rather than a flourish. If you use an assistant conversationally, the vendor's default is fine and adjusting it is not where your improvement lies. Note also that low temperature reduces variation, it does not guarantee identical output, since other factors can still shift a response.
Frequently asked questions
What temperature should I use for code?
As low as the tool allows, effectively zero. Code has correct answers and you want the model's best single guess, not a sampled variation on it.
Does raising temperature make writing better?
It makes it less predictable, which is not the same thing. Better writing comes from a sharper brief, a stated audience, and a constraint or two. Raise the setting when you want quantity and variety to pick from.
Why do I get different answers to the same question?
Any temperature above zero samples from a distribution, so repeats differ. Even at zero, providers do not always guarantee identical results, because infrastructure details can change the outcome slightly.
Back to the glossary · Take the quiz · How we score tools