Temperature
Noun · AI & Machine Learning
Definitions
A sampling parameter that controls how random a language model's output is. At each step the model produces a score, or logit, for every token in its vocabulary; these are divided by the temperature and passed through a softmax to form a probability distribution from which the next token is sampled. A temperature below 1 sharpens the distribution toward the most likely tokens, making output more focused and repeatable, while a temperature above 1 flattens it, giving less likely tokens more chance and making output more varied but also more error-prone. Temperature 0 is treated as always choosing the top token, although results may still vary slightly because of floating-point effects and batching on the provider's hardware. Temperature is often combined with top-k or top-p (nucleus) sampling, which restrict which tokens can be chosen at all. Low values suit extraction, classification, and code; higher values suit brainstorming. The name comes from the Boltzmann distribution in statistical mechanics.
In plain English: A setting that controls how creative or predictable an AI's responses are — turn it down for factual answers, turn it up for creative writing.
Etymology
- 1980s
- Simulated annealing borrows 'temperature' from statistical mechanics — higher temperature means more random exploration
- 2019
- GPT-2 popularizes the temperature parameter for controlling randomness in text generation: 0 = deterministic, 1+ = creative
- 2023
- Temperature becomes a user-facing setting in AI chatbots, making this statistical concept accessible to everyday users