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

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

Introduction

In deep learning, two popular techniques often seem at odds:

  1. Label Smoothing (LS): A regularization technique that replaces "hard" one-hot labels (e.g., [0, 1, 0]) with "soft" labels (e.g., [0.05, 0.9, 0.05]) to prevent a model from becoming overconfident.
  2. Knowledge Distillation (KD): A process where a small "student" model learns from the output probabilities (logits) of a large "teacher" model.

A highly influential 2019 paper by Müller et al. argued that these two techniques are incompatible. They claimed that LS "erases" the relative information between logits—the so-called "dark knowledge"—making the teacher a poor instructor for the student.

This paper challenges that "common wisdom." Through extensive empirical study across various tasks—from image classification to machine translation—the authors demonstrate that teachers trained with label smoothing can actually produce better students by preventing overfitting and improving the separation between semantically similar classes.

Methods and Metrics

The authors tackle the problem through a mix of mathematical analysis, novel metrics, and massive experimentation across diverse datasets (including ImageNet-1K, CUB200-2011, iMaterialist, and IWSLT English-to-German).

  • The Stability Metric: They propose a quantitative metric ($S_{Stability}$) to measure the degree of "erased information." It essentially calculates the intra-class variance of the teacher's predictions. If LS truly erases information, this variance should drop.
  • Visualizing Clusters: They reproduce and expand upon visualizations of the penultimate layer's activations. They specifically look at how LS affects the distance between semantically similar classes (like "toy poodle" vs. "miniature poodle") versus dissimilar ones (like "poodle" vs. "tench").
  • Pure Soft-Label Distillation: To isolate the effects, they often perform distillation using only the teacher's soft labels, removing the standard cross-entropy loss with hard ground-truth labels.

Key Insights and Ideas

The "Poodle" Breakthrough

The most striking insight is that while LS might "erase" information regarding how similar a poodle is to a fish (which is arguably useless information anyway), it actually increases the distance between semantically similar clusters (e.g., toy poodle vs. miniature poodle).

Comparison of feature clusters during training and validation, with and without Label Smoothing (LS).

As seen in the cluster visualizations, this increased separation makes the teacher's "knowledge" clearer and easier for the student to learn.

Generalization vs. Information Loss

The authors argue that the "erasing" effect is actually a form of beneficial regularization. A teacher trained with LS overfits less to the training data. Even if the training loss is higher, the "knowledge" it passes to the student is more robust and generalizes better to validation data.

The Stability-Accuracy Correlation

The proposed Stability Metric is highly aligned with model accuracy. This suggests that "erasing" certain types of variance is actually a hallmark of a good teacher, not a flaw.

Optimization Objective

They prove that if you ignore hard labels, KD and LS actually share the same optimization objective; the only difference is how the soft labels are generated (dynamically by a teacher versus statically by a formula).

Key Results

  • Better Students: On ImageNet-1K, a ResNet-18 student distilled from a ResNet-50 teacher trained with LS achieved 71.82% accuracy, compared to 71.43% when the teacher used hard labels.
  • Fine-Grained Success: The gains were even more pronounced on the CUB200 dataset, where distinguishing similar classes is vital. Students saw an improvement of over 1.2% when using LS-trained teachers.
  • Binary Networks & NMT: The trend held for Binary Neural Networks (improving ReActNet accuracy) and Machine Translation, where LS-trained Transformers distilled better BLEU scores.
  • Long-Tailed Failure: The authors found a clear boundary: LS fails on long-tailed datasets (where some classes have very few samples, such as ImageNet-LT or Places-LT). In these cases, the weight shrinkage effect of LS hurts the performance of "rare" classes.

Limitations and Future Work

The primary limitation identified is the Long-Tail Problem. Label smoothing assumes a uniform distribution for non-target classes, which is objectively false in imbalanced datasets. In these scenarios, LS can actually impair the teacher's performance, which subsequently leads to a poorer student.

Future work could involve developing "adaptive" label smoothing techniques that can sense the semantic similarity between classes or account for class imbalance, potentially combining the best of both worlds without the drawbacks found in long-tailed distributions.

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