What is temperature in AI?
Temperature is a setting that controls how random a language model's output is. Low values make answers more focused and repeatable; high values make them more varied.
Also called: sampling temperature, model temperature
How it works
At each step, a model scores every possible next token. Temperature changes how those scores turn into choices. At a low temperature, the top choice wins almost every time. At a higher temperature, less likely tokens get picked more often, so the text becomes more creative and less predictable.
A temperature near zero makes output close to deterministic, but not always fully so. Hardware, batching and model updates can still cause small differences between runs of the same prompt.
Why it matters for risk decisions
Risk and compliance decisions should be repeatable. If the same case can get a different answer each time it is run, it is hard to audit, explain or defend. For classification, extraction and scoring tasks, teams usually set a low temperature.
Even then, a language model's output should not be the only record of a decision. Storing the inputs, the model version, the settings and the output lets teams reproduce and review what happened later.
Common settings by task
- Labeling a dispute reason or extracting fields from a document: low temperature.
- Writing a case summary for a reviewer: low to moderate.
- Brainstorming possible fraud scenarios for a red-teaming exercise: higher.
- Generating test data for rules: moderate, with checks on the output.
Example
A hypothetical team uses a model to decide whether a support ticket describes an account takeover. At a high temperature, the same ticket is labeled differently on repeat runs. Setting the temperature low and asking for a fixed set of labels makes the results stable enough to measure.
Related terms
- Token (AI)In AI, a token is the small unit of text, often a word or part of a word, that a language model reads and writes. Model limits and usage prices are usually counted in tokens.
- Large language model (LLM)A large language model (LLM) is a neural network trained on large amounts of text to predict and generate language. It powers chat assistants, AI agents and many text tools.
- AI hallucinationAn AI hallucination is output from an AI model that sounds plausible but is false or not supported by its inputs, such as an invented fact, source or figure.
- Prompt engineeringPrompt engineering is the practice of writing and testing the instructions, context and examples given to an AI model so that it produces accurate, useful and consistent output.
- AI evaluation (evals)AI evaluation, often called evals, is the practice of testing an AI model or system on defined tasks and metrics to measure quality, safety and fitness for use.