Skip to content

Temperature

Summary

Temperature — a generation parameter ranging from 0 to 1. Lower values yield strict, predictable responses; higher values yield creative and diverse responses.

How It Works

During generation, the model selects the next word from a set of probabilities. Temperature controls how 'fuzzy' this selection is:

  • 0.1–0.2 — the model almost always selects the most probable word. Responses are strict, dry, deterministic.
  • 0.7–1.0 — the model more often takes less obvious options. Responses are lively, creative, but riskier.

What to Choose for Tasks

Task Temperature
Code, facts, math 0.1–0.3
Technical documentation 0.3–0.5
Ordinary dialogue 0.5–0.7
Poetry, ideas, brainstorming 0.8–1.0

Relation to Hallucinations

High temperature increases the probability of hallucinations: the model strays from facts for 'creativity'. Low temperature decreases this but makes responses more templated.

See Also