GenAIWiki
Inference

Temperature

Temperature scales how randomly a model samples the next token: lower is more deterministic, higher explores more.

Expanded definition

At decoding time, logits are divided by temperature before softmax. Temperature near 0 concentrates mass on the top token. Higher values flatten the distribution and increase variety, which can help brainstorming and hurt extraction, JSON, or tool arguments. Many APIs also expose top-p or top-k; combining high temperature with wide nucleus sampling compounds randomness. Tune temperature on a held-out task set, not by feel.

Related terms

Explore adjacent ideas in the knowledge graph.

Temperature FAQ

What is Temperature?

Temperature scales how randomly a model samples the next token: lower is more deterministic, higher explores more.

How is Temperature used in AI systems?

At decoding time, logits are divided by temperature before softmax. Temperature near 0 concentrates mass on the top token. Higher values flatten the distribution and increase variety, which can help brainstorming and hurt extraction, JSON, or tool arguments. Many APIs also expose top-p or top-k; combining high temperature with wide nucleus sampling compounds randomness.

Related

Comparisons, tools, and models that connect to this idea.