In plain words
When a chatbot writes, it does not have one fixed next word in mind. It has a list of options with odds: "monsoon" 50%, "winter" 30%, "summer" 15%, and so on. Something then has to pick one.
Temperature changes those odds before the pick. Turn it down and the favourite gets even more likely, so the AI almost always says the obvious thing. Turn it up and the odds even out, so less likely words get a real chance.
Low temperature suits tasks with one right answer, like pulling numbers from an invoice or writing code. Higher temperature suits brainstorming, story ideas and anything where variety helps. Too high, and the text starts to wander or stop making sense.
Chat apps usually set it for us. Developers can change it when they use a model through an API.
Everyday example
Ordering at a favourite restaurant
On a tired weeknight we order the dish we always get: low temperature. On a relaxed Sunday we might try something new, though we still skip the dishes we are sure to dislike: medium. On a dare, we point at the menu blindfolded: high temperature. Same menu, same tastes; only our appetite for risk changes.
Where the example breaks: We choose to take a risk for a reason, like boredom. The model has no mood. Temperature is just a number that stretches or flattens its odds, applied the same way to every word.
How it actually works
Temperature is applied at the very last step of next-token prediction, when scores become probabilities.
Scores become odds
For each possible next token the model outputs a raw score, called a logit. A function called softmax turns the scores into probabilities that add up to 100%.
Temperature divides the scores
Before softmax, every score is divided by the temperature T. Below 1, the gaps between scores grow and the top choice dominates. Above 1, the gaps shrink and the odds flatten. The idea is older than language models; Hinton and colleagues' 2015 work on distillation made it familiar in deep learning.
Temperature zero
At or near 0 the model effectively always picks the top token, called greedy decoding. Answers become far more repeatable, but not perfectly: in 2025, researchers at Thinking Machines traced leftover variation to how servers batch the arithmetic.
Its cousins: top-p and top-k
Top-p (nucleus sampling, 2019) keeps only the most likely tokens that together make up, say, 90% of the odds and ignores the long tail. Top-k keeps a fixed number of top tokens. OpenAI's API docs advise adjusting temperature or top-p, but not both.
- Range
- OpenAI's API accepts 0 to 2; other providers use similar ranges
- Why it matters
- Always picking the top word makes text "bland and strangely repetitive" (Holtzman et al., 2019)
- Not the same as effort
- As of October 2026, reasoning models also offer a "reasoning effort" setting. That controls how long they think, not how they pick words
- Picture numbers
- Computed with the real formula from made-up starting odds of 50, 30, 15 and 5%
Questions people ask
What temperature should we use?
Around 0 to 0.3 for facts, extraction, maths and code, where we want the same right answer every time. Around 0.7 to 1 for everyday writing. Above 1 for wild brainstorming, accepting that some output will be odd. Then test with real examples.
Does a higher temperature make AI more creative?
It makes it more varied, which can feel creative. The model is not thinking harder; it is just more willing to pick less likely words. Push it too far and variety turns into nonsense.
Does temperature 0 stop hallucinations?
No. Temperature 0 makes the model pick its single most likely answer, but if that answer is wrong, it will be wrong every time. Hallucinations come from what the model learned, not mainly from randomness.
Can you change the temperature in ChatGPT?
Not in the regular chat app. The ChatGPT, Claude and Gemini apps choose their own settings. Temperature can be set when using the models through their developer APIs, and in some tools built on them.
Why is it called temperature?
In physics, the same formula describes how particles spread across energy levels: hotter means more spread out. Statisticians call it the Boltzmann distribution. AI borrowed the name, so a higher temperature spreads the odds more evenly across words.