Skip to content

What Is Temperature and What Sampling Parameters Exist?

Temperature controls how deterministic or creative the model’s responses are.

TemperatureBehaviorTypical Use Case
0.0Deterministic: same question → same answerClassification, code generation, fact lookup
0.3 to 0.7Slight variation, factualChat, summaries, translation
0.8 to 1.2Creative, multiple valid answersBrainstorming, creative writing
>1.2Very chaotic, often unusableExperimental
  • Top-P: only considers candidates up to a cumulative probability P (nucleus sampling)
  • Top-K: limits the selection to the K most likely candidates
  • Presence Penalty / Repetition Penalty: reduces repetition in the output

For production systems, generally choose a low temperature (0 to 0.3). The default values are well-tested and should only be changed for a specific reason.