With label smoothing on classes, what is the target distribution, and what is the gradient of the cross-entropy loss with respect to the logits? For , and true class 2, what are the target vector and the logit gap the model is pushed towards?
Deep learning, Training and regularisation
Level L3 Intermediate. Length Short. Nature Mat Mathematical.
What's being asked
Whether you can write the smoothed target, and see that it gives the logits a finite optimum.
Key idea
Label smoothing moves a fraction of the target's mass from the true class to a uniform spread. With one-hot , , and , where are the logits and . The loss is minimised at , so the logits stay finite.
Steps
- Write the smoothed target: , where is uniform over the classes.
- For , and true class 2: .
- Gradient: the softmax cross-entropy gradient is still prediction minus target, .
- Optimum: . Since , this gives . With hard labels the optimum needs , which drives over-confidence.
- Effects: better calibration (predicted probabilities closer to true frequencies) and often slightly better accuracy. It can hurt knowledge distillation, because it erases information in the wrong-class probabilities.
Common mistakes
- Mixing the two conventions. Some texts use on the wrong classes and on the true class. Say which one you use.
- Changing only the true-class target and forgetting to spread over the others, so the target no longer sums to 1.
- Claiming the gradient becomes something new. It is still minus the target.
How long your answer should be
4–5 lines; 2 minutes.
Last checked on 4 December 2026.
Read this
Previous in Deep learning: How does the multiply-accumulate cost of a standard convolution compare with that of a depthwise separable convolution ( depthwise followed by pointwise), for an output with input and output channels? What is the ratio for and ?
Next in Deep learning: How do you derive the Xavier (Glorot) and He initialisation variances from the requirement that activation variance stays constant from layer to layer?