Temperature is a sampling parameter that reshapes how boldly a model picks its next token. Each logit is divided by the temperature T before softmax:

  • Low T sharpens the distribution → focused, deterministic, repetitive.
  • High T flattens it → diverse, creative, riskier.

Temperature adds no new knowledge; it only stretches or squashes the confidence the model already has. It’s usually combined with top-p (nucleus) sampling. Try it in Temperature and the art of the next word.