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 makes the gaps between logits bigger, so softmax puts more probability on the top tokens: safer, more repetitive text. 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, , gets raised to the power . The effect is a power on probability ratios, not a simple shift of the probabilities.
Example
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
- SoftmaxRead "softmax of z". It turns any list of numbers into probabilities: every output is positive and they add up to 1. Bigger inputs get bigger shares.
- lim — limitRead "the limit as T goes to 0". It is the value a quantity gets closer and closer to as something is pushed toward an extreme, even if that extreme can't be plugged in directly.
- argmax — position of the largestRead "arg max". It gives the position (index) of the largest value, not the largest value itself.