AI CompendiumA public chart of the language
Home / Training & Inference / Temperature
Training & Inference

Temperature

The dial between predictable and creative.

Definition

A scaling factor on the model’s output probabilities before sampling. Low temperature makes the model favour the most likely token; high temperature flattens the distribution and produces more variety and more nonsense.

Rough guide: 0 for extraction, classification and code; 0.2–0.5 for analysis; 0.7–1.0 for brainstorming and writing. High temperature for a task with one right answer is a self-inflicted wound.

Two operational rules. For anything extracted, classified or parsed, run as close to greedy as the API allows — you want the same input to give the same output. For open-ended writing, raise it and accept that you now need sampling in your evaluation to tell signal from noise.

How people use it
Tuning a structured extraction pipeline.
"Temperature zero. We are parsing invoices, not writing poetry."
Worked example

The temperature that broke the pipeline

One field in a JSON response occasionally comes back as a sentence.

The schema was described in prose and the temperature was tuned up months earlier for a different feature. Schema-constrained output plus a near-zero temperature removes the entire failure class rather than reducing its frequency.

Sources
  • guideIntroduction to large language models ↗Google for Developers · 2026

    A plain-language official introduction to models, tokens and context. Teaching material rather than origin research — good for the definition, not for a claim about the frontier.

  • docsEvaluation best practices ↗OpenAI API docs · 2026

    Evals as structured tests: task-specific test sets, continuous evaluation, logging, and human calibration of automated scoring.

Related terms