Temperature is the sampling setting that controls how random a language model's next token looks, sharpening the distribution low for steady answers and flattening it high for varied ones.
How it works
Each step produces scores over the vocabulary and temperature divides them before sampling, so a near-zero value collapses choice onto the single best token while a value near one keeps the natural spread. Low settings suit extraction, classification, and anything graded against a right answer, because repetition beats surprise. Higher settings suit brainstorming and drafting, where a wider draw brings fresh phrasing at the cost of occasional drift. Teams pair it with nucleus sampling to cap the long tail, then fix one value per use case so behavior stays comparable across evaluations.
Builders reach for temperature whenever output style must match the job: near zero for factual and repeatable work, higher for exploration where variety pays its way.