temperature
A sampling setting that controls how varied a language model’s output is: low values favor the most likely next token, higher values give less likely ones more chance.
- A value of 0.2 for focused, more repeatable answers
- A value of 0.8 for more varied, less predictable wording
- Gemini 3’s default of 1.0, which Google advises keeping
- A raised value that softens a large model’s outputs in distillation

- Earliest AI use
- 1983
- Hinton and Sejnowski: a network parameter that “acts like temperature”.
- Current meaning
- 2015
- Karpathy’s text samples: lower is more conservative, higher more varied.
In plain words
In AI, temperature is a setting that controls how random a language model’s output is: low values give focused text, high values more varied text.
A large language model writes one token, a word or part of a word, at a time. At each step it gives every possible next token a probability, then draws one at random, weighted by those probabilities. Temperature is a number that reshapes the odds before the draw.
A low temperature makes the likeliest tokens likelier still, so replies are focused and similar from one run to the next. A high temperature evens out the odds, so less likely words appear more often. OpenAI’s API accepts values from 0 to 2 and calls 0.8 more random and 0.2 more focused.1 Anthropic’s documentation advises values near 0 for analytical and multiple-choice tasks and near 1 for creative ones.2
Temperature is often described as a creativity parameter. A 2024 study of stories written by a language model found it only weakly linked to novelty and moderately linked to incoherence.3 A low setting does not reliably improve accuracy either. Another 2024 study, of multiple-choice problems, found no significant difference between 0 and 1. Even a setting of 0 does not guarantee the same answer twice.2
Providers now discourage or block the setting on their reasoning models. Google recommends leaving Gemini 3 at its default of 1.0 and warns that lower values can cause looping.4 OpenAI tells developers to remove the setting when its newest models are set to reason.5 From Claude Opus 4.7, released in April 2026, Anthropic’s new models reject any value other than the default.
How it works
For each candidate token, the model computes a raw score called a logit. A function called softmax turns the scores into probabilities that add up to 1. Temperature divides every score before that step.
Dividing by a number below 1 widens the gaps between scores, so the top token gains a larger share. Dividing by a number above 1 narrows the gaps and flattens the odds. At 1, the model’s own probabilities are used unchanged. As the value nears 0, sampling approaches greedy decoding, which always takes the single likeliest token.
Other settings act on the same list. Top-p, or nucleus, sampling draws only from the smallest set of tokens whose probabilities add up to p. OpenAI advises adjusting temperature or top-p, but not both.1 In distillation, a raised temperature softens a large model’s outputs so that a smaller model can learn from them.
Even at 0, a hosted model can return different text. Thinking Machines Lab drew 1,000 answers at temperature 0 and got 80 different ones. Servers process requests in batches whose size depends on load. The batch size can change the order of the arithmetic, and so the result.6
The sky today is
Origin and first known use
From Latin temperatura, “a tempering, moderation”. The scientific sense, a degree of heat or cold, is recorded by 1670. Neural network research borrowed the word from statistical physics. In 1983 Geoffrey Hinton and Terrence Sejnowski gave the units of a network a parameter T that “acts like temperature”. In their 1985 Boltzmann machine, states follow the Boltzmann distribution, and the temperature is lowered gradually, as in annealing a physical system. The same division by T was later applied to the softmax function, which turns a network’s scores into probabilities. In 2015 Hinton and colleagues used it for distillation, and Andrej Karpathy used it to sample text, the sense now used for language models.
- 1670 The scientific sense, “degree of heat or cold”, is attested by 1670, in Boyle. The Latin source, temperatura, meant “a tempering, moderation”.Online Etymology Dictionary, “temperature” etymonline.com →: source for 1670
- 1983 Hinton and Sejnowski give each unit of a neural network a parameter T that “acts like temperature”. Lowering it makes the most plausible interpretation likelier to be selected.Geoffrey E. Hinton and Terrence J. Sejnowski, “Optimal Perceptual Inference”, IEEE Conference on Computer Vision and Pattern Recognition, Washington, D.C., June 1983 salk.edu →: source for 1983
- 1985 In Ackley, Hinton and Sejnowski’s Boltzmann machine, states follow the Boltzmann distribution. Learning starts at a high temperature and lowers it gradually, like annealing a physical system.David H. Ackley, Geoffrey E. Hinton and Terrence J. Sejnowski, “A Learning Algorithm for Boltzmann Machines”, Cognitive Science 9, 1985 toronto.edu →: source for 1985
- 2015 Hinton, Vinyals and Dean divide a network’s output scores by a temperature T, normally 1, before the softmax. A higher T gives softer probabilities, used to train a smaller model.Geoffrey Hinton, Oriol Vinyals and Jeff Dean, “Distilling the Knowledge in a Neural Network”, arXiv, 9 March 2015 arXiv 1503.02531 →: source for 2015
- 2015 Andrej Karpathy samples text from a neural network at different temperatures. Lower values give more confident, conservative text; higher values give more diversity and more mistakes.Andrej Karpathy, “The Unreasonable Effectiveness of Recurrent Neural Networks”, 21 May 2015 karpathy.github.io →: source for 2015
- 2019 Holtzman and colleagues note that a temperature below 1 skews sampling toward likely tokens and nears greedy decoding at 0. They propose nucleus, or top-p, sampling.Ari Holtzman et al., “The Curious Case of Neural Text Degeneration”, arXiv, 22 April 2019; ICLR 2020 arXiv 1904.09751 →: source for 2019
- 2025 Thinking Machines Lab shows that answers at temperature 0 still vary in practice, and traces the cause to batch sizes on inference servers that change with load.Horace He and Thinking Machines Lab, “Defeating Nondeterminism in LLM Inference”, 10 September 2025 thinkingmachines.ai →: source for 2025
- 2026 Anthropic’s Claude Opus 4.7 returns an error when temperature is set to anything but the default, a breaking change from Opus 4.6. Later Claude models do the same.Anthropic, “Release notes”, Claude Platform documentation, 16 April 2026, with later entries for Claude Opus 4.8 and Claude Sonnet 5 platform.claude.com →: source for 2026
In the wild
-
“…called “distillation”, is to raise the temperature of the final softmax until the cumbersome model produces a suitably soft set of targets.”
-
“Decreasing the temperature from 1 to some lower number (e.g. 0.5) makes the RNN more confident, but also more conservative in its samples.”
-
“…lowering the temperature increases the use of frequent words, driving down inter-generation diversity.”
-
“In particular, for a 679M parameter model, the optimal temperature for pass@1 is T* = 0.2 and the optimal temperature for pass@100 is T* = 0.8.”
Chen et al., OpenAI, arXiv preprint arXiv 2107.03374 →: Chen et al., OpenAI, arXiv preprint, 7 Jul 2021Archived →: copy of Chen et al., OpenAI, arXiv preprint, 7 Jul 2021 -
“…changes in temperature from 0.0 to 1.0 do not have a statistically significant impact on LLM performance for problem-solving tasks.”
Renze and Guven, Findings of EMNLP 2024 arXiv 2402.05201 →: Renze and Guven, Findings of EMNLP 2024, 7 Feb 2024Archived →: copy of Renze and Guven, Findings of EMNLP 2024, 7 Feb 2024 -
“…temperature parameter of an LLM regulates the amount of randomness, leading to more diverse outputs; therefore, it is often claimed to be the creativity parameter.”
-
“…even when we adjust the temperature down to 0 (thus making the sampling theoretically deterministic), LLM APIs are still not deterministic in practice…”
Horace He, Thinking Machines Lab blog thinkingmachines.ai →: Horace He, Thinking Machines Lab blog, 10 Sep 2025Archived →: copy of Horace He, Thinking Machines Lab blog, 10 Sep 2025 -
“Setting the sampling parameters temperature, top_p, or top_k to a non-default value returns a 400 error on Claude Opus 4.7.”
-
“For all Gemini 3 models, we strongly recommend keeping the temperature parameter at its default value of 1.0.”
Google, Gemini API documentation ai.google.dev →: Google, Gemini API documentation, 23 Sep 2026Archived →: copy of Google, Gemini API documentation, 23 Sep 2026
Not to be confused with
-
Top-p and top-k sampling
Both shorten the list of candidate tokens before the draw: top-k keeps a fixed number, top-p the smallest set whose probabilities add up to p. Temperature removes no candidates; it reshapes all their odds.
-
Random seed
A seed fixes the random numbers used for each draw, so a request can be repeated. Temperature sets how spread out the odds are. OpenAI calls seeded sampling a best effort and says determinism is not guaranteed.
-
Creativity
A high temperature makes unlikely words more likely, which can read as inventive. A 2024 study found it only weakly linked to novelty and moderately linked to incoherence, a smaller effect than its nickname suggests.
-
Reasoning effort
Reasoning effort sets how much working a reasoning model writes before it answers. Temperature sets how randomly each token is drawn. For its newest models, OpenAI says to drop temperature unless reasoning effort is none.
Questions
What is temperature in AI?
Temperature is a setting that controls how random a language model’s output is. At each step the model gives every possible next token a probability, then draws one. Temperature reshapes those probabilities first. Low values make the likeliest tokens likelier, so answers are focused and consistent. High values even out the odds, so the wording varies more. OpenAI’s API accepts values from 0 to 2.
What is the best temperature setting for an LLM?
It depends on the task. OpenAI describes 0.2 as focused and 0.8 as more random. Anthropic advises values near 0 for analytical or multiple-choice work and near 1 for creative tasks. In OpenAI’s 2021 Codex study, a 679-million-parameter model did best at 0.2 when one attempt per coding problem was scored. When any of 100 attempts could count, 0.8 did best. On multiple-choice problems, a 2024 study found no significant accuracy difference between 0 and 1.
Is a temperature of 0 deterministic?
Not in practice. At 0 a model should always pick its likeliest token, yet hosted models still vary. Thinking Machines Lab drew 1,000 answers at temperature 0 and got 80 different ones. It traced the cause to batching: servers group requests, the group size changes with load, and that can change the arithmetic. Anthropic’s documentation also says results at 0 are not fully deterministic.
Does a higher temperature make AI more creative?
Only slightly, according to one study. A higher temperature gives unlikely words more chance, which can read as creative. In 2024, Max Peeperkorn and colleagues generated stories at different temperatures. Temperature was weakly correlated with novelty, moderately correlated with incoherence and unrelated to cohesion or typicality. Andrej Karpathy’s 2015 samples showed a similar trade: higher temperatures gave more diversity, but also more mistakes.
Why do some AI models not let users set the temperature?
Some providers now discourage or block changes on their newest models. Google says Gemini 3’s reasoning is tuned for the default of 1.0 and warns that lower values may cause looping. OpenAI tells developers to remove temperature when its newest models are set to reason. From Claude Opus 4.7, released in April 2026, Anthropic’s models return an error for any value other than the default.
Watch
Cite this entry
“Temperature.” SUPERR_dictionary, Superrduperr, 24 Sept. 2026, superrduperr.com/
Superrduperr. (2026, September 24). Temperature. In SUPERR_dictionary. https://superrduperr.com/
Superrduperr. “Temperature.” SUPERR_dictionary. September 24, 2026. https://superrduperr.com/