What is temperature in AI?
Temperature is a setting that controls how much variety an AI model puts in its answers. A low value gives steady, predictable output. A high value gives more varied output.
Key takeaways
- Low temperature suits facts, data extraction and code.
- Higher temperature suits brainstorming and creative drafts.
- Most chat apps set it for you. You control it when you use a model through an API.
How it works
For each next token, the model has a list of candidates with a probability for each. At low temperature it almost always takes the top candidate. At higher temperature it takes less likely candidates more often, so the text varies more from run to run.
Example
A developer builds an invoice reader and sets a low temperature, so the same invoice always gives the same fields. For a tagline generator, the developer sets a higher temperature to get many different ideas.
Why it matters
Temperature explains why the same prompt gives different answers. If you need the same result each time, ask for a fixed format and use a low setting where you can.
Common mistake
A low temperature does not make an answer true. It makes the answer consistent, and a consistent answer can still be wrong.
Related terms
See all terms in the AI Encyclopedia, the numbers on the AI statistics pages, or build a prompt with the prompt builder.