Generative AI & LLMs

Temperature (LLM)

In shortA generation setting that controls how random an LLM's word choices are: lower is more predictable, higher is more varied.

Updated 24 Oct 2026· 2 min read

Temperature is a setting that controls how much randomness a large language model uses when choosing each next token. Low values make the model pick the most likely words, giving consistent, predictable output. Higher values let less likely words through, giving more varied and creative output.

How it works

At each step the model assigns a probability to every possible next token. Temperature rescales those probabilities before one is sampled. Near 0, the distribution sharpens so the top choice almost always wins; at higher values, it flattens so alternatives get picked more often. Related settings, top-p and top-k, limit sampling to the most probable tokens.

Providers handle it differently, and this changes quickly. As of October 2026, Anthropic’s newer Claude models no longer accept temperature, top-p or top-k, and recommend steering behaviour through the prompt. Google strongly recommends keeping Gemini 3 models at the default of 1.0, warning that lower values can cause looping or degraded performance. Check your model’s documentation before relying on it.

How it’s used in SEO and marketing

  • Low temperature for classification, extraction, metadata rewrites and anything you want repeatable or comparable over time.
  • Higher temperature for brainstorming headlines, angles or ad variations, where variety helps.
  • Evaluation: noting temperature settings when you benchmark tools, because it affects results.

Example

MLforSEO’s title optimisation notebook calls the OpenAI API with TEMPERATURES = [0.0], because rewriting titles to include a page’s top query should be consistent and repeatable. In the comparison of NLP APIs with generative AI, by contrast, chatbots were used through their consumer interfaces, so temperature was whatever each product applied by default, which is one reason consumer chat results are hard to reproduce.

Limitations and things to watch

  • Temperature 0 does not guarantee identical outputs. Anthropic notes it never did, even on models that accepted it.
  • Low temperature reduces randomness but leaves hallucination risk in place. A model can be consistently wrong.
  • Many reasoning models ignore or reject the setting, so code that sets it can error after a model upgrade.
  • For consistency, clear instructions, examples (few-shot prompting) and structured output formats often matter more than temperature.

Learn it on MLforSEO

Where Temperature (LLM) shows up on MLforSEO

Sources and further reading

Other terms from Generative AI & LLMs

See all 19 Generative AI & LLMs terms →