TEMPERATURE

A setting that controls how random or predictable a model output is when it picks each next token.

Zero retention: everything you type stays in this browser. Verify it yourself in DevTools.
Plain-language definition

What Does Temperature Mean?

Temperature is a setting that controls how much randomness an AI model uses when picking each next token. At each step, the model scores many possible next tokens. A low temperature, near 0, makes it almost always pick the top choice, so answers are more predictable and repetitive. A higher temperature spreads the choice across more options, giving more varied and sometimes more creative output, but also more mistakes and odd turns. Most APIs accept values from 0 to 1 or 0 to 2. Many chat apps and coding agents set it for you, and some newer reasoning models fix it or ignore it.

Why Does Temperature Matter?

If you call a model through an API for tasks like extraction, classification or code generation, lower temperatures generally give steadier results that are easier to test. For brainstorming names or drafting copy, higher values give more variety. In a coding agent you usually cannot change it, and it matters much less than good instructions and context. Changing it is rarely the fix for a model that keeps getting something wrong.

What Does Temperature Look Like in Practice?

Asking for "a name for a budgeting app" five times at temperature 0 tends to return the same or very similar names. At temperature 1, you get five different ideas, a couple of them unusable. For pulling a date out of an invoice, you want the first behavior; for naming ideas, the second. Some reasoning models ignore the setting entirely and use their own fixed value.

What Do People Get Wrong About Temperature?

Temperature 0 does not guarantee identical outputs every time, and it does not make answers correct. Small differences can still appear, and a model can repeat the same wrong answer consistently.

Which Terms Are Related?

  • Token: A small chunk of text, often part of a word, that models process; limits and prices are counted in tokens.
  • Hallucination: When a model confidently produces something false or made up, such as an API that does not exist.
  • Inference: Running an already trained model to produce output. Every reply you get from an AI is one inference call.
  • System prompt: The standing instructions an application gives a model before the conversation, setting its role, rules and format.

All 28 terms are in the AI glossary. For models side by side, see frontier vs open-weight.

Frequently Asked Questions

What temperature should I use for code?

Lower values, such as 0 to 0.3, usually work well for code and data extraction where you want consistency. Follow the model provider recommendation, since some models are tuned for a specific default.

Can I set temperature in coding agents?

Usually not. Coding agents choose their own model settings. Your influence comes from instructions files, the task description and the model or effort level you pick.

What is top-p?

Top-p is a related setting that limits choices to the smallest set of tokens whose combined probability reaches p. Providers generally suggest adjusting temperature or top-p, not both.

Was this helpful?