Is Label Smoothing Truly Incompatible with Knowledge Distillation: An Empirical Study

Zhiqiang Shen, Zechun Liu, Dejia Xu, Zitian Chen, Kwang-Ting Cheng, Marios Savvides

TL;DR

This paper challenges the prevailing notion that label smoothing (LS) is incompatible with knowledge distillation (KD). Through extensive empirical studies across various domains, the authors demonstrate that LS can actually be compatible with and even beneficial for KD, particularly for semantically similar classes. They propose a new metric to quantify the "erasing" effect of LS and identify specific scenarios (long-tailed distributions, many classes) where LS might indeed lose its effectiveness.

What Problem Does This Paper Address?

Knowledge distillation (KD) is a powerful technique for transferring knowledge from a larger "teacher" model to a smaller "student" model. Label smoothing (LS) is a regularization technique that softens the one-hot target labels during training, often improving model calibration and generalization. Recently, a perspective emerged suggesting that LS is incompatible with KD, primarily because LS is thought to "erase" relative information between teacher logits, which is crucial for effective distillation. This paper aims to empirically investigate this claim, clarify the underlying mechanisms, and determine when and why this perceived incompatibility might arise or not.

Methods

The authors begin by reproducing and extending the visualization experiments that led to the incompatibility claim, focusing on how LS affects the distribution of teacher logits. They introduce a novel connection between LS and the "erasing" of relative information, specifically highlighting its differential impact on semantically similar versus dissimilar classes. To quantitatively measure this effect, they propose a "stability metric" that assesses the degree of erased information by analyzing the variance of intra-class probabilities. The study then conducts comprehensive experiments across image classification, binary neural networks, and neural machine translation to validate their findings. They also explore the role of the teacher's accuracy and the impact of combining hard and soft labels in KD.

Datasets

The paper utilizes several standard datasets for their experiments:

  • ImageNet-1K: A large-scale dataset for image classification.
  • CUB200-2011: A fine-grained dataset for bird species classification.
  • iMaterialist (Challenge): A dataset for product recognition, known for containing noisy labels.
  • iNaturalist 2019: A dataset with a long-tailed class distribution.
  • ImageNet-LT: A long-tailed version of ImageNet.
  • Places-LT: A long-tailed version of the Places dataset.
  • Curated ImageNet-100/500/1K: Subsets of ImageNet with varying numbers of classes to study the impact of class count.
  • IWSLT dataset: Used for German-to-English machine translation.

Key Insights and Ideas

  • LS is not inherently incompatible with KD: The paper's central finding is that LS can be compatible with and even beneficial for KD, contrary to prior claims.
  • Differential impact on class similarity: LS's "erasing" effect is more pronounced and potentially detrimental for semantically dissimilar classes, which are already easy to distinguish. For semantically similar classes, LS can actually help by pushing their representations further apart, making them easier to classify.
  • Softened teacher predictions aid generalization: Teachers trained with LS produce softer probability distributions. While this can lead to higher training loss during KD, it can prevent the student from overfitting to the training data and improve generalization on validation sets.
  • Teacher quality is paramount: The accuracy of the teacher model is a dominant factor in KD performance, even when the teacher is trained with LS.
  • LS loses effectiveness in specific scenarios: The paper identifies long-tailed class distributions and a very large number of classes as circumstances where LS's effectiveness is significantly diminished or even detrimental.

Key Results

  • Image Classification: Experiments on ImageNet-1K, CUB200-2011, and iMaterialist showed that teachers trained with LS often distilled students with comparable or even slightly better validation accuracy, despite higher training losses. For example, on ImageNet-1K, ResNet-50 teacher with LS distilled a student with 76.130% Top-1 accuracy, compared to 75.888% without LS.
  • Binary Neural Networks (BNNs): In BNN distillation, teachers with LS prevented over-confidence on the training data, leading to slightly better generalization and accuracy on the validation set.
  • Neural Machine Translation (NMT): LS improved the teacher's performance (BLEU score) on the translation task, and a stronger teacher (with LS) still distilled a higher BLEU student.
  • Stability Metric: The proposed stability metric showed a strong correlation with model accuracy and could serve as an alternative indicator for teacher quality. Models trained with more epochs and augmentation techniques like CutMix showed dramatically increased stability (meaning more erased information).

Limitations and Future Work

  • Limitations: The paper acknowledges that the "erasing" effect of LS is more complex than initially thought and its impact is context-dependent. The study focuses on specific architectures and datasets, and further exploration across a wider range of models and tasks might be beneficial. The paper also notes that while LS can improve teacher accuracy, it's not always a guarantee of a better student if the student architecture is a bottleneck.
  • Future Work: The authors suggest further investigating the role of LS in scenarios with long-tailed distributions and a large number of classes. They also propose exploring better supervision strategies for KD and revisiting the fundamental role of KD and LS in deep learning. The paper also hints at exploring the interplay of LS with other regularization techniques and data augmentation methods.

Summary updated

BibTeX
@inproceedings{shen2021is,
  author = {Zhiqiang Shen and Zechun Liu and Dejia Xu and Zitian Chen and Kwang-Ting Cheng and Marios Savvides},
  title = {{Is Label Smoothing Truly Incompatible with Knowledge Distillation: An Empirical Study}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
}
Figure