Temperature is a setting that controls how much randomness goes into choosing each token. Low values make a model pick the most likely option almost every time; high values let it choose less likely ones more often.
Also called: sampling temperature · Reviewed
At every step a model produces a probability for each possible next token. Temperature reshapes that distribution before one is sampled. Below 1 it sharpens it, so likely tokens become even more likely. Above 1 it flattens it, so unlikely tokens get a real chance. At 0 the model simply takes the highest-probability token every time. Most APIs accept 0 to 2 and default to around 1, and the useful band for production work is narrower than that — typically 0 to 0.3 for anything parsed, and 0.7 to 1 for drafting.
The effect compounds. One slightly unusual token changes what follows, which changes what follows that. A small increase in temperature does not add a little variety — it moves the output onto a different track entirely.
It is the cheapest lever you have over reliability. Extraction, classification, routing and anything you will parse as JSON should run near 0, where the same input reliably produces the same output. Brainstorming, naming and first drafts benefit from something higher, where you want options rather than the single safest answer.
It also decides whether a bug is reproducible. Debugging a pipeline at temperature 0.8 means never being sure whether your fix worked or the dice landed differently.
Calling it a creativity dial. Temperature does not make a model more imaginative — it makes it less likely to pick the obvious token. Past about 1.2 that stops reading as originality and starts reading as incoherence, because the tokens it is now willing to choose are the ones it judged unlikely for good reason.
The second is raising it to fix repetitive output. Repetition is usually a prompt problem or a context problem. Temperature will hide it by making the output noisier, which is not the same as making it better.