Revisiting Self-Distillation

Minh Pham, Minsu Cho, Ameya Joshi, Chinmay Hegde

Abstract

Self-distillation—the process of a model teaching a copy of itself—consistently boosts performance even when the "teacher" is already a state-of-the-art model. This paper reveals that the primary driver of this success isn't just learning "new views" of data, but rather a geometric shift: self-distillation pushes models toward flatter minima in the loss landscape, which significantly improves generalization.

Introduction

Knowledge Distillation (KD) was originally designed for model compression: a large, cumbersome "teacher" model trains a smaller "student" to mimic its outputs. However, researchers noticed a "folkloric" phenomenon called self-distillation, where the teacher and student have identical architectures. Surprisingly, the student often ends up outperforming the teacher. This study investigates why this happens, challenging the prevailing "multi-view hypothesis" and proposing a geometric explanation centered on loss landscape flatness.

Methodology: Multi-Round Distillation

To investigate the limits of self-distillation, the authors employed a sequential training pipeline. A teacher model $f^{(0)}$ is trained on data $(x, y)$. Its soft predictions $y^{(0)}$ then serve as labels for a student $f^{(1)}$, which in turn generates labels $y^{(1)}$ for $f^{(2)}$, and so on.

The sequential self-distillation pipeline, showing how soft labels are passed from teacher to successive student generations.

The researchers conducted a systematic study using strong baselines optimized with modern heuristics like AutoAugment, Cutout, and Cosine Annealing to see if self-distillation could still provide a boost to already highly-optimized models. They used PyHessian to calculate the trace and top eigenvalues of the Hessian matrix, measuring the curvature of the loss landscape.

Key Insights: Self-Distillation as a Geometric Regularizer

The most significant finding is that self-distillation acts as a powerful regularizer. It consistently leads the student to a flatter region of the loss landscape compared to the teacher. A flatter minimum is associated with better generalization because small shifts in the data distribution result in smaller changes in loss.

Hessian trace and top eigenvalues across different distillation rounds. Students (S1-S3) consistently show lower curvature than the initial teacher (T), often finding flatter minima than the SAM optimizer.

As shown in the analysis above, the Hessian trace and top eigenvalues—metrics for "sharpness"—drop significantly from the teacher (T) to the first student (S1). Remarkably, self-distillation sometimes found even flatter minima than Sharpness-Aware Minimization (SAM), an optimizer explicitly designed to find flat regions. This suggests that the "soft labels" provided by the teacher act as a guide that prevents the student from falling into sharp, overfitted pits, steering it instead toward broad, stable valleys.

Key Results

  • Performance Boosts: On CIFAR-100 with a ResNet18, a strong teacher at 78.22% accuracy produced a student at 80.71%. On CIFAR-10, a teacher at 97.16% still saw a boost to 97.40%.
  • Flatness Metrics: Across almost all experiments, student models showed a lower Hessian trace and lower top eigenvalues than their teachers. For example, on CIFAR-10, the teacher's trace was often 2-3x higher than the student's.
  • The "Multi-View" Limit: The authors found that accuracy often fluctuates or saturates after the first round of distillation, suggesting that the hypothesis that students simply learn "new views" of features is insufficient to explain the sustained gains.

Conclusion

Self-distillation is more than just a trick for squeezing out extra accuracy; it is a fundamental regularizer that reshapes the optimization trajectory toward more stable, flatter regions of the loss landscape. Since flatness is the primary goal, future work should focus on developing new optimization procedures that can achieve these flatter minima in a single training pass, bypassing the need for a teacher model entirely.

Summary updated

Abstract

Knowledge distillation is the procedure of transferring "knowledge" from a large model (the teacher) to a more compact one (the student), often being used in the context of model compression. When both models have the same architecture, this procedure is called self-distillation. Several works have anecdotally shown that a self-distilled student can outperform the teacher on held-out data. In this work, we systematically study self-distillation in a number of settings. We first show that even with a highly accurate teacher, self-distillation allows a student to surpass the teacher in all cases. Secondly, we revisit existing theoretical explanations of (self) distillation and identify contradicting examples, revealing possible drawbacks of these explanations. Finally, we provide an alternative explanation for the dynamics of self-distillation through the lens of loss landscape geometry. We conduct extensive experiments to show that self-distillation leads to flatter minima, thereby resulting in better generalization.
BibTeX
@misc{pham2022revisiting,
  author = {Minh Pham and Minsu Cho and Ameya Joshi and Chinmay Hegde},
  title = {{Revisiting Self-Distillation}},
  year = {2022},
  eprint = {2206.08491},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2206.08491},
}
Figure