Glossary · Definition
Temperature (AI sampling)
Temperature is a sampling parameter that controls the randomness of an LLM's output. Lower (0-0.3) = deterministic, factual, focused. Higher (0.7-1.2) = creative, varied, exploratory.
Definition
Temperature is a sampling parameter that controls the randomness of an LLM's output. Lower (0-0.3) = deterministic, factual, focused. Higher (0.7-1.2) = creative, varied, exploratory.
What it means
Mathematically, temperature divides the logits before softmax — lower temp sharpens the probability distribution toward the most-likely token; higher temp flattens it. Most models default to 0.7-1.0 for chat. For factual tasks (extraction, classification, code), lower temp (0.0-0.3) reduces variance and hallucinations. For creative tasks (brainstorming, fiction), higher (1.0-1.5) helps.
Advertisement
Why it matters
Wrong temperature is one of the most common prompt-engineering mistakes. Devs running data extraction at temp 1.0 get inconsistent outputs and chase phantom bugs. Writers at temp 0.3 get repetitive, boring prose. Match temp to task.
Related free tools
Frequently asked questions
What's a good default?
Most chat: 0.7. Factual extraction: 0.0-0.2. Code generation: 0.0-0.3. Creative writing: 0.9-1.2.
Temp 0 = deterministic?
Almost — but not exactly across all providers. Some still have implementation noise. For exact reproducibility, also set seed (where supported).