Skip to content
Search

What is temperature in an LLM?

Temperature controls how random a model's output is. OpenAI accepts 0 to 2, and newer Claude and Gemini models ignore or reject custom values.

In short. Temperature is a setting that controls how random a language model's output is. Lower values make the model pick the most likely tokens more often, so the text is more predictable, and higher values give more varied text. Anthropic says results are not fully deterministic even at 0, and newer Claude and Gemini models ignore or reject custom values.

On this page 7 sections

The evidence

Confirmed

OpenAI's API accepts a temperature between 0 and 2, with a default of 1. OpenAI says values like 0.8 make output more random and values like 0.2 make it more focused and deterministic.1

1OpenAI API referenceOpenAI API reference. Checked Nov 20, 2026.
Confirmed

Anthropic says that even with temperature set to 0, results are not fully deterministic, and identical inputs can produce different outputs across API calls.2

2Claude API documentationClaude API documentation. Checked Nov 20, 2026.
Confirmed

Anthropic's API reference says models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 is accepted, and other values are rejected with an error.3

3Claude API referenceClaude API reference. Checked Nov 20, 2026.
Confirmed

The Gemini API accepts temperature values from 0.0 to 2.0, and silently ignores the field on Gemini 3.6 Flash and newer models.4

4Gemini API referenceGemini API reference. Checked Nov 20, 2026.

Temperature sets how random a language model's output is, which is one reason the same prompt can get different answers. AI search products do not say what sampling settings they use, so one run of a prompt is a single sample of what a brand might get.

A model writes one token at a time. At each step, it gives every possible next token a probability, and a sampler picks one. The temperature changes how strongly the sampler favors the most likely tokens.

#How temperature works

Google Cloud's page on content generation parameters says a temperature of 0 means the highest-probability tokens are always selected. Responses are then mostly deterministic, though a small amount of variation is still possible. Lower temperatures suit prompts that need a less open-ended answer, and higher temperatures can give more diverse or creative results.5

The range differs by provider. OpenAI's API reference accepts values between 0 and 2, with a default of 1. It says higher values like 0.8 make output more random, and lower values like 0.2 make it more focused and deterministic. OpenAI recommends changing temperature or top_p, but not both.1 Anthropic's API reference gives a range of 0.0 to 1.0, with a default of 1.0.3

#Temperature and repeatable output

A low temperature does not guarantee the same answer twice. Anthropic's glossary says that even with temperature set to 0, results are not fully deterministic, and identical inputs can produce different outputs across API calls.2 OpenAI's Chat Completions reference offers a seed parameter that makes a best effort to sample deterministically, and says determinism is not guaranteed.6

#Newer models

Providers have started to remove the setting. Anthropic's API reference says models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 is accepted, and other values are rejected with an error.3 Google's Gemini API reference says the temperature field is silently ignored on Gemini 3.6 Flash and newer models.4 OpenAI says parameter support differs by model, particularly for newer reasoning models.6 What are reasoning models? covers how those models work.

The references above describe developer APIs. They do not say what sampling settings ChatGPT search, Gemini or Google's AI features use, so a site owner cannot tell how much of the variation in AI answers comes from sampling.

AI answers do vary between runs. Promptly Found's study of how much AI answers change from one day to the next measured how often the brands named for the same question changed. The study treats each answer as one sample from a wide spread and recommends running a prompt many times before reading a result. How to test AI search visibility with prompts covers how to set up such a test. How do large language models work? explains token prediction in more detail.

Questions

What temperature should I use?

It depends on the model and the task. Anthropic's reference suggests values closer to 0 for analytical or multiple-choice tasks and closer to 1 for creative tasks. Google Cloud recommends 1.0 as a starting value for Gemini. Newer Claude models and Gemini 3.6 Flash and later do not accept custom values, so the setting does not apply to them.

Does temperature 0 make a model deterministic?

No. Anthropic says results are not fully deterministic even at 0, and Google Cloud says responses at 0 are mostly deterministic but can still vary slightly. OpenAI's seed parameter makes a best effort to repeat results, and OpenAI says determinism is not guaranteed.

What is the difference between temperature and top_p?

Both change how the next token is sampled. Temperature changes how random the choice is. Top_p, or nucleus sampling, limits the choice to the most likely tokens that together make up a share of the probability: 0.1 means only the top 10%. OpenAI recommends changing only one of them.

Notes

  1. 1
    Create a model responseOpenAI API reference · Checked Nov 20, 2026 · Primary source
  2. 2
    GlossaryClaude API documentation · Checked Nov 20, 2026 · Primary source
  3. 3
    Create a Text CompletionClaude API reference · Checked Nov 20, 2026 · Primary source
  4. 4
    Generating contentGemini API reference · Checked Nov 20, 2026 · Primary source
  5. 5
    Content generation parametersGoogle Cloud documentation · Checked Nov 20, 2026 · Primary source
  6. 6
    Create chat completionOpenAI API reference · Checked Nov 20, 2026 · Primary source

About this page

Researched and reviewed by Promptly Found. Reviewed Nov 20, 2026. Next review due Feb 2027.

Cite this page
Citation style

Promptly Found. (2026, November 20). What is temperature in an LLM? https://promptlyfound.com/glossary/temperature

Revisions 1
First published.