AI Blog

AI Blog

by Michele Laurelli

Temperature (Sampling)

Technique
Definition

Parameter controlling randomness in text generation by scaling logits before softmax.

Temperature T divides logits. T < 1 makes distribution sharper (deterministic), T > 1 flatter (random). T = 0 is greedy, T = 1 unmodified.

Examples

1

Temperature 0.7 for creative text

2

Temperature 0.1 for factual

3

Greedy decoding T=0

Michele Laurelli - AI Research & Engineering