What is label smoothing?
Label smoothing is a regularisation technique that trains classifiers on a soft target instead of the hard one: a weighted average of the hard target and the uniform distribution over classes. This keeps the model from becoming overconfident.
Unlike knowledge distillation, whose soft targets come from a teacher model and carry class similarity information, label smoothing builds the target by a fixed rule, spreading a small share of probability evenly across classes.
- Topic
- Machine learning, models and training
- Also known as
- Label smoothing regularisation (LSR)
- Origin
- 2015 image classification architecture study
How label smoothing works
- For each training example the model computes the probability of each class.
- The hard target puts all probability on the correct class; smoothing mixes in the uniform distribution with a small weight.
- The loss is the cross-entropy between the model's probabilities and this soft target.
- This prevents the largest logit from becoming much larger than all others, so the model makes less confident predictions.
In more detail
Effect on representations
The 2019 study showed that label smoothing makes the penultimate-layer representations of training examples from the same class group in tight clusters. This does not hurt generalisation or calibration but erases information in the logits about resemblances between instances of different classes, which explains the weaker distillation.
Commonly confused terms
| Term | How it differs |
|---|---|
| Dropout | Dropout adds noise to the model itself by randomly disabling units of the network during training. Label smoothing leaves the network untouched and reduces overconfidence by changing the training target. |
Why label smoothing matters for on-premises AI
Label smoothing was proposed in a 2015 image classification study, giving a consistent error reduction of about 0.2 points on ImageNet. The 2017 Transformer study used it for translation and found it hurt perplexity but improved accuracy and BLEU. A 2019 study showed it also improves model calibration but makes distillation from a teacher trained with it much less effective.
A health technology company trains its radiology classifier with label smoothing because some labels are disputed and overconfident predictions are unwanted. As it plans to distil the model, it trains a separate teacher without smoothing.
Common questions
How is the smoothing value chosen?
The study that proposed the technique used a value of 0.1 in its ImageNet experiments. A suitable value is set by measuring accuracy and calibration on validation data.
Is label smoothing always beneficial?
No. It can improve generalisation and calibration but can worsen perplexity and weakens knowledge distillation from a teacher trained this way.
Related terms
Sources
- Rethinking the Inception Architecture for Computer Vision, arXiv, 2015
- Attention Is All You Need, NeurIPS, 2017
- When Does Label Smoothing Help?, NeurIPS, 2019
In the glossary: Glossary, E to L