Temperature

A model setting that controls how random or creative AI text or outputs are during generation.

Also known as: temp, sampling temperature

In plain English

Think of temperature like a recipe's spice level: low is mild and predictable, high is bold and surprising. In AI, increasing temperature makes responses more varied, while lowering it makes them more consistent and safer.

In practice

Temperature is adjusted when using AI tools to trade creativity for reliability — use a low temperature for summaries and a higher one for brainstorming. It affects reproducibility, the chance of factual errors or odd outputs, and how much post-editing or human review is needed.

Under the hood

Temperature scales model logits (typically by dividing logits by the temperature) before the softmax step; values below one sharpen the probability distribution, favouring high-probability tokens, while values above one flatten it and increase sampling diversity. As temperature approaches zero sampling becomes effectively argmax (deterministic), and higher temperatures increase entropy; temperature is often used together with top-k or nucleus (top-p) sampling.

Example

Set the temperature to 0.2 for concise summaries and 0.9 when we want more creative suggestions.

Related terms

Large Language Model · Inference · Prompt Engineering · Hallucination · Parameters

•