Definition
Temperature (AI)
Also called: sampling temperature, temperature parameter
What Temperature (AI) means in practice
At each step a model scores every possible next token. Temperature reshapes those scores before one is picked: values below 1 sharpen the gap between likely and unlikely options, and values above 1 flatten it.
You meet it as a slider or parameter in AI playgrounds and APIs, often next to top-p. Ranges differ by provider: Anthropic’s API accepts 0 to 1, while OpenAI’s classic APIs accept 0 to 2, so the same number does not mean the same thing everywhere.
One nuance: a low temperature makes output more consistent, not more accurate. It changes how the model chooses words, not what it knows.
Example
Using temperature 0.2 to extract invoice fields and 0.9 to brainstorm product names.
Used in a sentence: Turn the temperature down; the summaries keep changing every time we run them.
Often confused with
- Top-p
- Top-p (nucleus sampling) limits choices to the smallest set of likely tokens whose probabilities add up to a threshold. Temperature reshapes all the probabilities instead. Both control randomness, in different ways.
- Creativity or intelligence
- A higher temperature adds variety, not insight. The model does not get smarter; it just takes less likely paths, which can read as more creative.
Full guide
What does temperature mean in AI? →
How it works, examples, and common questions, explained in plain English.
Common questions
What does a temperature of 0.7 mean?
It is a moderate setting: the model mostly picks likely words but allows some variety. On a 0-to-1 scale it leans toward varied; on OpenAI’s 0-to-2 scale it sits below the default of 1, so slightly more focused than standard.
Does temperature affect cost or speed?
Not directly. Temperature changes which tokens are chosen, not the price per token or how fast they are generated. It can change reply length, though, which changes the total number of output tokens you pay for.
Sources and further reading
Read more
- What is an AI hallucination?
An AI hallucination is when a language model states something false or unsupported as if it were true, such as an invented fact, a fake citation or a quote nobody said. It happens because models generate plausible-sounding text rather than looking facts up. Grounding answers in real sources and verifying important claims are the main defenses.
- What is an LLM?
An LLM (large language model) is an AI system trained on huge amounts of text to predict the next piece of a sentence. By doing that prediction billions of times, it learns grammar, facts, and patterns of reasoning well enough to answer questions, write, summarize, translate, and generate code. Chatbots like ChatGPT and Claude are built on LLMs.