zi/Tz_i / T

Temperature

Read "z i over T". Each logit is divided by the temperature T before softmax. T below 1 makes the distribution sharper; T above 1 makes it flatter.

Dividing by T<1T < 1 makes the gaps between logits bigger, so softmax puts more probability on the top tokens: safer, more repetitive text. T>1T > 1 makes the gaps smaller, pushing toward equal probabilities: more varied text, and eventually nonsense.

The division happens before the exponential. So the ratio between any two probabilities, pi/pj=e(zi−zj)/Tp_i / p_j = e^{(z_i - z_j)/T}, gets raised to the power 1/T1/T. The effect is a power on probability ratios, not a simple shift of the probabilities.

Example

[2,1,0]0.5=[4,2,0]  →softmax  [0.867, 0.117, 0.016]\frac{[2, 1, 0]}{0.5} = [4, 2, 0] \;\xrightarrow{\text{softmax}}\; [0.867,\, 0.117,\, 0.016]

At T = 1 the same logits give [0.665, 0.245, 0.090]. Halving T sharpens the distribution.

Where the course uses it

Related terms