Skip to the page
Tecyfy

What is temperature in AI?

A setting that controls how much chance goes into each word a model picks. Low gives focused, predictable answers; high gives more varied ones.

beginner · Also called Temperature (Sampling), Sampling Temperature

A model writes one TokenTokenThe small piece of text a language model reads and writes, often part of a word. Prices, limits and the context window are all counted in tokens. at a time. At each step it does not know the next word. It has a score for every possible next piece, from very likely to very unlikely. Then something has to pick one.

The simplest rule is to always take the top-scoring piece. That gives the same answer every time, but on longer text it starts to repeat itself. So most apps pick at random, weighted by the scores. The favourite is chosen most often, the runner-up less, and anything with a chance above zero can come up now and then.

Temperature reshapes those chances before the pick.

  • Low temperature makes the favourite even more likely. Answers are focused and predictable.
  • High temperature evens the chances out. Answers are more varied, and more often odd.

Even at 0, the exact same words are not guaranteed every time.

Which setting for which job

There is no single right value. DeepSeek, for example, recommends 0 for coding and maths and 1.5 for creative writing and poetry. You want the same answer to a sum every time, and a few surprises in a poem.

You often cannot set it any more

In the chat apps, temperature is set for you. In the APIs it used to be a standard dial, and that is changing. Kimi K3 fixes it at 1. Anthropic's newer models, from Claude Opus 4.7 on, return an error if you send anything but the default. Google deprecated it for Gemini in July 2026. And DeepSeek's models ignore it whenever they are in thinking mode.

What to do with this

If an answer comes out different each time you ask, that is the dice, not a fault. Ask for the format or tone you want in words, which works everywhere. And if your code still sends a temperature, check the model's documentation: on some models it is ignored, and on others it is now an error.

Try itTurn the temperature up and down

The cat sat on the …

  • mat50%
  • sofa22%
  • floor17%
  • roof7%
  • keyboard4%
  • moon1%

Low temperature: the likeliest word nearly every time. High: the unlikely words get a real chance.

The scores are made up to show the effect, not taken from a real model.

Sources

Where each fact comes from

  1. 1Glossary
  2. 2Generation strategies
  3. 3The Temperature Parameter
  4. 4Kimi K3 quickstart
  5. 5Thinking Mode
  6. 6Claude Platform release notes
  7. 7Gemini API release notes

Put this demo on your own site

Copy the code into any web page: a lesson, a blog post, a course or your team's wiki. The demo runs in a frame and works just as it does here, so your readers can try it where they read. It is free and needs no account, and nothing a reader does in it is sent anywhere.

The short script at the end lets the frame grow and shrink with the demo. Where a page cannot take scripts, choose a fixed height and the frame scrolls.

<iframe src="https://tecyfy.com/embed/demo/temperature" title="Turn the temperature up and down" width="100%" height="800" style="border:0;display:block" loading="lazy" allow="clipboard-write"></iframe>
<p><a href="https://tecyfy.com/concepts/temperature">Turn the temperature up and down</a> by Tecyfy</p>
<script>addEventListener("message",function(e){if(e.origin!=="https://tecyfy.com"||!e.data||e.data.type!=="tecyfy:height")return;var h=Number(e.data.height);if(!(h>0))return;document.querySelectorAll("iframe").forEach(function(f){if(f.contentWindow===e.source)f.style.height=Math.min(h,20000)+"px"})})</script>