AI 101 — What is temperature in an LLM?

Share
AI 101 — What is temperature in an LLM?

Temperature is the setting that controls how randomly an AI model picks its next word: near 0 it always takes the most likely word, higher values give unlikely words a real chance, and 1.0 is the default on most APIs. It is the first knob most people turn, and the one most people misunderstand.

Why it matters right now. Temperature has been showing up in the news all week as a variable, not a feature. A Lasso Security study found that switching on SynthID-Text watermarking changed how models behaved — 16.8% of phi-4's tool-call verdicts flipped at a temperature of 1.0 against a net accuracy loss of 2.87 points, and across 21 model-temperature combinations churn averaged 6.5%, which we covered when it landed. The same week, the practical advice for anyone building an eval set was to pin the exact temperature you plan to ship, because a score measured at one setting says nothing about another. Both stories assume you know what the knob does. This is the ten-minute version.

The mental model. A language model never "writes a sentence." At each step it produces one score for every token in its vocabulary — often well over 100,000 numbers, called logits — and a function called softmax turns those scores into probabilities that sum to 1. Temperature divides the scores before that conversion. Divide by a small number and the gaps between scores get exaggerated, so the leader wins by even more. Divide by a big number and the gaps flatten, so tokens the model considered unlikely get a genuine shot. Then one token is drawn from that distribution, glued onto the text, and the entire process runs again for the next token. So temperature does not change what the model knows. It changes how boldly the model bets on what it knows.

The dice analogy. Picture the model handing you a set of loaded dice, loaded exactly to its own confidence. At temperature 0 the die has effectively one face, and the favorite always comes up. At 1.0 you roll the model's honest odds. Crank it to 1.5 or 2.0 and you are shaking the table before every roll: the long shots show up far more often, which is occasionally inspired and frequently nonsense. The model that confidently writes a clean function at 0.2 is the same model that wanders off mid-paragraph at 1.6. Nothing about its knowledge changed — only how willing it was to gamble on a less likely word.

Close-up of two wooden dice on a vibrant green background.

What people get wrong. The biggest one is believing temperature 0 means the same answer twice. In practice it rarely does. One 2024 paper ran five models across eight tasks and ten runs each at settings meant to be deterministic and found accuracy varying by up to 15% between runs, with a gap of up to 70% between the best and worst run — and none of the models produced repeatable results across every task. The cause is not the sampling any more. It is batching and floating-point arithmetic: the same request served alongside a different set of requests can land on a very slightly different number, and near a tie that difference flips the token. Provider APIs add the seed parameter and a fingerprint field to nudge this back toward reproducibility, but "mostly consistent" is the honest promise, not "identical."

The second mistake is treating temperature as a quality dial. Higher is not smarter or more creative in any graded sense; it is more varied, and past a point the variation is just confabulation. Lower is not more accurate either — it is more conventional, which is usually right for code and math and usually dull for prose.

The third is confusing temperature with its neighbors. The top-p setting, from the 2019 nucleus sampling paper, keeps only the smallest set of tokens whose probabilities add up to p and renormalizes; top-k keeps a fixed count. All three reshape the same distribution, which is why provider guidance is to tune one and leave the others alone rather than stack them.

The fourth is assuming the number travels. A default of 1.0 on one API is not the same behavior as 1.0 on another, because each model's training and post-training changed its underlying odds. DeepSeek's own documentation recommends 0.0 for coding and math, 1.0 for data cleaning, 1.3 for general conversation and translation, and 1.5 for creative writing — vendor advice for one family of models, not a law of nature. And some reasoning models do not expose the knob at all, running at a fixed setting because their thinking step already covers the ground temperature used to.

Where to learn more. OpenRouter's parameter reference is the clearest one-page tour of temperature, top-p and top-k with their ranges and defaults, and DeepSeek's parameter page is the shortest real-world example of a lab publishing recommended values by task. For the reproducibility problem, Thinking Machines' write-up on nondeterminism in inference is the best technical account available, and the OpenAI cookbook entry on the seed parameter explains what the fingerprint field is actually for.

Related reading: What is a token in AI? explains the units temperature is choosing between, What are reasoning tokens? covers the models that often fix sampling altogether, and What is AI watermarking? is the provenance layer whose behavior the new churn numbers measured.

If temperature 0 can't guarantee the same answer twice, should AI products promise reproducible output at all — or is telling users to expect variation the more honest option? Tell us in the comments.

Read more

Mistral's Le Chonk puts Europe's sovereignty bet on a download date

Mistral's Le Chonk puts Europe's sovereignty bet on a download date

Mistral's biggest model ever is real, benchmarked and for sale today — but the thing that makes it matter to Europe's sovereignty argument, the weights, is still three weeks out. The preview settles who built it; the release will settle whether it counts. What Mistral actually shipped Mistral opened a public preview of Mistral Large 4 — unofficially ML4, officially le Chonk — a 1 trillion-parameter mixture-of-experts model with 49 billion active parameters and native multimodal input. The p

Mistral unveils Le Chonk: a 1T-parameter open-weights model

Mistral unveils Le Chonk: a 1T-parameter open-weights model

The biggest open-weight release outside China lands in public preview today, and the country that spent the week promising its own frontier model just put a price on the ambition. Mistral has opened a public preview of Mistral Large 4 — codenamed "le Chonk" — a 1 trillion-parameter mixture-of-experts model with 49 billion active parameters, natively multimodal, which the company calls its largest and most capable model to date. The preview API is live today on Mistral Studio at $1.36 per milli

Google signs 3.6 GW power deal, a quarter of it new nuclear

Google signs 3.6 GW power deal, a quarter of it new nuclear

Grid capacity, not chips, is becoming the binding constraint on the AI buildout — and on the same day, the labs told an Australian inquiry they can live with mandatory incident reporting. Google has contracted 3.6 GW of power from Constellation Energy across the PJM grid — the largest electricity deal in the region's history, and the biggest single power commitment any AI company has made. The agreement covers 3,590 megawatts over 13 states, with 890 megawatts of new nuclear capacity coming fr

Korea probes AI agents in bank hacks as president cites 'signs'

Korea probes AI agents in bank hacks as president cites 'signs'

South Korea opened a formal investigation into whether AI agents drove a wave of bank breaches — and it isn't the only AI story moving money today. President Lee Jae Myung said "signs" point at AI models, and the probe is now at the highest level a national banking sector has seen. Speaking at a cabinet meeting, Lee said that "in some hacking incidents, signs have emerged of AI being used, causing considerable public concern and anxiety," and police have since opened a full-scale investigation