Large Programs

Home / How LLMs Work

How LLMs Work

What Is "Temperature" in an AI Model?

Temperature controls how adventurous or careful a language model is when choosing words.

27 November 2026 · 2 min read

When a language model writes, it does not pick a whole sentence at once. At each step it gives every possible next token a score, then turns the scores into chances and picks one. Temperature is a setting that changes how those scores become chances.

From scores to chances

The step that turns scores into chances is called softmax. Wikipedia says that a value linked to the temperature can be built into it: a higher temperature gives a more even set of chances ("more random"), while a lower temperature gives a sharper set where one option usually dominates.

Bars showing the chance of two options at temperature 1, 10 and 100.

The picture uses Wikipedia's two-option example. Option A scores 0 and option B scores 10. At temperature 1 the chances are about 0.00005 and 0.99995, so B is chosen almost every time. At temperature 100 they are about 0.475 and 0.525, almost a coin flip. The middle row (temperature 10) is calculated here by the same rule. It is a simplified example with two options, not what a real model with tens of thousands of options does.

Low temperature

The model usually chooses the top option. Answers are steadier and more predictable. This suits tasks where you want the same careful answer each time, such as pulling a date out of a text.

High temperature

The model is more willing to pick less likely options. Answers are more varied and less predictable. This suits brainstorming or stories, but it also makes odd or wrong choices more likely.

Does a low temperature make the answer true?

No. Temperature changes how the model chooses among the options it already scores. If the most likely option is wrong, a low temperature will choose the wrong answer confidently. See how to check AI answers.

Ice cream analogy

Low temperature: you always order your favourite flavour. High temperature: you sometimes try a new one.

Try this

Ask a chatbot for a short story opening twice. If the tool lets you change the creativity or temperature setting, compare a low and a high setting. Does the high setting surprise you more? Does it ever say something that does not make sense?

Low and high temperature example sentences.

Illustration made for this site.

Sources