# Temperature

> Temperature is a setting on a language model that controls how random its output is: low values make answers more predictable and repeatable, higher values make them more varied and creative.

Also called: sampling temperature, model temperature, randomness setting, top-p. Category: Models and training. Source: https://aibuildindex.com/glossary/temperature

## In the index

- Large language models: median $4,720, middle half $1,000 to $16,000, 605 priced briefs (https://aibuildindex.com/skills/large-language-models)

Ask the same model the same question twice and you may get two different answers. Temperature is the main dial that controls how much the output varies. For most business tasks, such as extracting fields from an invoice or classifying an email, consistency matters more than flair, so builders keep temperature low. For brainstorming, marketing copy or varied replies, they turn it up. It is a small setting with a visible effect on how an AI feature feels.

## How it works

At each step of generation, a model works out a probability for every possible next [token](https://aibuildindex.com/glossary/token). It then has to pick one. Temperature changes how that choice is made:

- **Low temperature** sharpens the probabilities, so the most likely token wins almost every time. Output becomes close to repeatable.
- **Higher temperature** flattens them, so less likely tokens get picked more often. Output becomes more varied and sometimes more surprising.

Most APIs expose related settings too, such as top-p, which restricts the choice to the most likely tokens that together cover a set share of the probability. Builders usually adjust one or the other rather than both.

Some newer models, particularly [reasoning models](https://aibuildindex.com/glossary/reasoning-model), fix or limit these settings, so the dial is not always available. Even at the lowest setting, outputs are not always identical across runs, because of how requests are processed on the provider's hardware.

A product description generator is a useful example. At a low setting it writes nearly the same description each time it sees the same product data. At a higher setting it produces fresh variations, which helps when a shop wants several options to choose from.

## What it means for cost

Temperature itself costs nothing to change, but it affects how much testing and checking a build needs. Higher values make outputs harder to test, because the same input can give different results, and they can raise the rate of odd or invented content, which is a form of [hallucination](https://aibuildindex.com/glossary/hallucination). For workflows where software reads the model's answer, a low setting combined with [structured output](https://aibuildindex.com/glossary/structured-output) makes the system more predictable and cheaper to maintain.

Ask a builder what temperature each step of the build uses and why. A sensible answer names different settings for different steps, not one value for everything.

## Common questions

### Does a temperature of zero make a model always correct?

No. It makes the model pick its most likely answer, which reduces variation but does not make that answer true. A model can be consistently wrong at low temperature.

### What temperature should a customer support bot use?

Usually low to moderate. Answers should be consistent with policy and the help articles, with only enough variation to avoid sounding robotic. The right value is found by testing on real conversations rather than chosen in advance.

### Why do I get different answers even at the lowest setting?

Providers process requests on shared hardware in ways that can introduce tiny numerical differences, and some models do not support fully deterministic output. Builds that need exact repeatability should store results rather than regenerate them.

## Related terms

- [Large language model (LLM)](https://aibuildindex.com/glossary/large-language-model): A large language model is an AI model trained on very large amounts of text to predict the next word, which lets it write, summarise, translate, classify and answer questions in natural language.
- [Inference](https://aibuildindex.com/glossary/inference): Inference is the stage where a trained AI model is used to produce outputs, such as answers, classifications or images, from new inputs, as opposed to training, where the model learns from data.
- [Hallucination](https://aibuildindex.com/glossary/hallucination): A hallucination is output from an AI model that sounds plausible but is false, unsupported or invented, such as a made-up fact, citation, figure or policy presented with the same confidence as a correct answer.
- [Structured output](https://aibuildindex.com/glossary/structured-output): Structured output is a way of making an AI model return its answer in a fixed, machine-readable format, typically JSON matching a defined schema, so that other software can use the result without guessing at free text.
- [Prompt](https://aibuildindex.com/glossary/prompt): A prompt is the input given to an AI model to tell it what to do, typically instructions, context, examples and the user's request, from which the model generates its response.
