# What is LLM temperature?

> Temperature sets how random an LLM's next-token choice is. Lower is more predictable. Many current reasoning models no longer let you set it.

Source: https://www.honeyhive.ai/learn/llm-temperature (updated 2026-11-01)

LLM temperature is a sampling setting that controls how random the model's choice of each next token is. Lower values favor the most probable tokens, and higher values make less probable tokens more likely to be picked ([IBM](https://www.ibm.com/think/topics/llm-temperature)). It changes how the model picks from its predictions, not what it knows.

On a growing number of current models you can no longer set it at all. The provider sections below show which ones, as of November 2026.

## What temperature does

At each step a model scores every possible next token. Temperature is applied during sampling, together with top-p and top-k ([Google](https://ai.google.dev/gemini-api/docs/prompting-strategies)). Google describes lower temperatures as good for prompts that need a more deterministic, less open-ended response, and higher ones as giving more diverse or creative results. At a temperature of 0 the highest-probability token is always selected.

## Temperature and top-p

Top-p, also called nucleus sampling, limits sampling to the smallest set of tokens whose cumulative probability passes a threshold ([IBM](https://www.ibm.com/think/topics/llm-temperature)). It comes from a [2019 paper by Holtzman and colleagues](https://arxiv.org/abs/1904.09751), which samples from the "dynamic nucleus" of the distribution to cut off the unreliable tail of unlikely words. Top-k instead keeps only the k most likely tokens (IBM, same page).

Both reshape the same choice, so they overlap. OpenAI's reference [gives](https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create) temperature a range of 0 to 2 and top_p a range of 0 to 1, both defaulting to 1, and says: "We generally recommend altering this or top_p but not both."

## Does temperature control creativity?

Less than the folk advice says. A [2024 study by Peeperkorn and colleagues](https://arxiv.org/abs/2405.00492) found temperature weakly correlated with novelty, with outputs only slightly more novel at higher temperatures, and no relationship to cohesion or typicality. IBM [makes the same caution](https://www.ibm.com/think/topics/llm-temperature) and notes that a higher temperature can raise incoherence.

## Does it change accuracy?

On the tasks tested, not much. [Renze and Guven (2024)](https://arxiv.org/abs/2402.05201) report that changing temperature from 0.0 to 1.0 had no statistically significant impact on LLM performance across the models, prompting techniques and problem domains they tested. Treat that as a reason to test your own task before tuning, for instance with [LLM evaluation](/learn/llm-evaluation).

## Temperature 0 is not a guarantee

Setting temperature to 0 selects the top token ([Google](https://ai.google.dev/gemini-api/docs/prompting-strategies)), yet [Horace He at Thinking Machines Lab](https://thinkingmachines.ai/blog/defeating-nondeterminism-in-llm-inference/) (10 September 2025) writes that LLM APIs are "still not deterministic in practice" at temperature 0. He argues the usual "concurrency + floating point" explanation does not tell the full story. The cause he names is a lack of batch invariance: kernel outputs can change with batch size, and batch size varies with server load.

## Can you still set it? Provider status

This is changing quickly, so check your model's docs.

| Provider | Status |
|---|---|
| OpenAI | Temperature accepts 0 to 2, default 1 ([API reference](https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create)). For the GPT-6 family, remove `temperature` and `top_p` when reasoning effort is not `none` ([migration guide](https://developers.openai.com/api/docs/guides/latest-model)). |
| Anthropic | API version `2026-10-21` returns a 400 error for `temperature`, `top_p` or `top_k`, even at default values. Claude 4.7 and later accept only defaults. On models that still accept other values, such as Sonnet 4.6, a request that lowered temperature for consistency loses that effect unless it stays on API version `2023-06-01` ([migration guide](https://platform.claude.com/docs/en/api/migration-2026-10-21)). Claude Sonnet 5.5 also returns an error ([migration guide](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide)). |
| Google | Gemini 4 and Gemini 3.6+ models ignore custom `temperature`, `top_p` and `top_k`, with 400 errors planned for a future release. For earlier Gemini 3 models, keep them at defaults to avoid degraded reasoning ([Gemini docs](https://ai.google.dev/gemini-api/docs/prompting-strategies)). |

The practical effect: for reasoning models, temperature is no longer your consistency lever. Anthropic's migration guide says no other setting replaces it ([source](https://platform.claude.com/docs/en/api/migration-2026-10-21)). For structured output, tighter prompts and constraints take over; see [what is prompt engineering](/learn/what-is-prompt-engineering) and [few-shot prompting](/learn/few-shot-prompting).

## Log the settings you used

If you do set temperature, record it with each call so a change in output can be traced to a change in settings. HoneyHive's [configuration docs](https://docs.honeyhive.ai/v2/tracing/configuration-details) describe attaching the [prompt version](/learn/prompt-versioning) and model parameters, including temperature and top_p, to traces. See also [LLM observability](/learn/llm-observability).

## FAQ

### What is a good temperature for an LLM?

There is no single value. [OpenAI's API reference](https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create) allows 0 to 2 with a default of 1, and IBM [suggests](https://www.ibm.com/think/topics/llm-temperature) low values for precision tasks and high values for creative ones. For several current models the answer is to leave it alone, because the provider fixes it.

### Does temperature 0 make an LLM deterministic?

Not fully. [Gemini's docs](https://ai.google.dev/gemini-api/docs/prompting-strategies) say a temperature of 0 always selects the highest-probability token, but Thinking Machines Lab [reports](https://thinkingmachines.ai/blog/defeating-nondeterminism-in-llm-inference/) that LLM APIs are still not deterministic in practice at temperature 0, because kernel results can change with batch size.

### Should I change temperature or top_p?

One at most. [OpenAI](https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create) generally recommends altering temperature or top_p but not both.

### Does a higher temperature make an LLM more creative?

Only slightly. A [2024 study](https://arxiv.org/abs/2405.00492) found temperature weakly related to novelty and unrelated to cohesion or typicality.
