AI Glossary
What is temperature in AI?
Also known as: Sampling Temperature
Temperature is a setting that controls how random an AI model's output is: low temperature makes responses more predictable and focused, high temperature makes them more varied and creative.
When a large language model writes, it doesn’t pick “the” next word. It calculates a probability for every possible next token, then samples one. Temperature changes the shape of those probabilities before sampling.
- Low temperature (near 0): the most likely token wins almost every time. Output is consistent, focused and repetitive.
- High temperature: less likely tokens get a real chance. Output becomes more surprising, varied — and eventually incoherent.
Technically, the model’s raw scores (logits) are divided by the temperature before being turned into probabilities. Divide by a small number and the gaps between options widen; divide by a large one and they shrink.
An analogy
Imagine ordering at your favorite restaurant. At low temperature, you order the same dish you always order. At medium temperature, you sometimes try the special. At high temperature, you point at random lines on the menu, including the ones in a language you don’t read. Occasionally brilliant. Usually soup for dessert.
Why it matters for your work
Temperature is one of the few knobs that changes output quality for free. Use it deliberately:
| Task | Suggested temperature |
|---|---|
| Data extraction, classification, code | Low |
| Customer support, summaries, factual Q&A | Low to moderate |
| Blog drafts, emails, marketing copy | Moderate |
| Brainstorming names, hooks, story ideas | Higher |
If your automation returns slightly different results on every run and that’s a problem, lower the temperature. If your copy sounds like every other AI-generated paragraph, a bit more temperature (plus a better prompt) can help.
Where you can change it
- APIs and playgrounds (OpenAI, Anthropic, Google) expose temperature directly. Allowed ranges differ by provider.
- Automation tools like Make, Zapier and n8n usually show it as a field on the AI step.
- Consumer chat apps typically hide it and choose for you.
Note that some newer reasoning models restrict or ignore temperature settings, because their internal reasoning is tuned separately. Check the docs before blaming the dial.
A related knob
Top-p (nucleus sampling) limits choices to the smallest set of tokens whose probabilities add up to p. Providers generally recommend adjusting temperature or top-p, not both.
Tools that use it
ChatGPT
AI WritingWrite, research, make images, talk by voice and run agents from one chat box, made by OpenAI.
Claude
AI WritingGet the strongest long-form writing and the most careful reasoning among the consumer AI assistants, from Anthropic.
Gemini
AI WritingAsk Google's assistant about your Gmail, Docs and Drive, and get help inside the Google apps you already use.
Questions people ask
What is a good temperature setting?
Low (around 0 to 0.3) for factual answers, data extraction and code; moderate (around 0.7) for general writing; higher for brainstorming. Exact ranges and defaults vary by provider, so check the documentation.
Does temperature 0 make AI output deterministic?
Close to it, but not always perfectly. Even at temperature 0, small technical factors in how models are served can produce slightly different outputs between runs.
Does higher temperature cause hallucinations?
It can increase them, because the model more often picks less likely words. But low temperature does not prevent hallucinations — a model can be confidently wrong at temperature 0.