Temperature divides the logits before softmax: q = softmax(z / T). It does not change the ranking, only how sharply the probability mass concentrates. Watch the entropy of the prediction move, for z = [2, 1, 0.1]:
T = 0.5 q = [0.8638, 0.1169, 0.0193] H(q) = 0.655 bits
T = 1.0 q = [0.6590, 0.2424, 0.0986] H(q) = 1.222 bits
T = 2.0 q = [0.5017, 0.3043, 0.1940] H(q) = 1.481 bits
T → 0 q → one-hot on the top logit H(q) → 0 bits
T → ∞ q → uniform over K classes H(q) → log₂K bits
temperature is an entropy dial: up flattens, down sharpens.
Label smoothing works on the target instead of the prediction. With ε = 0.1 and four classes, the hard one-hot [0, 0, 1, 0] becomes:
soft = (1 − ε)·one-hot + ε/K
= 0.9·[0,0,1,0] + 0.025 = [0.025, 0.025, 0.925, 0.025]
H(soft) = −(3 · 0.025 · log₂0.025 + 0.925 · log₂0.925)
= 3 · 0.1330 + 0.1040 = 0.5032 bits (0.3488 nats)
compare: H(hard one-hot) = 0 bits, and only infinite
logits could ever match it exactly.
The smoothed target has positive entropy, so the model is never asked to be 100% certain — a finite, reachable goal. The loss becomes L = (1−ε)·CE(hard target, q) + ε·H(uniform, q), where the second term is a direct penalty on confident predictions. That is regularization and calibration with an information-theoretic name.