Solvable Model for Inheriting the Regularization through Knowledge Distillation

Luca Saglietti, Lenka Zdeborová

Abstract

In recent years the empirical success of transfer learning with neural networks has stimulated an increasing interest in obtaining a theoretical understanding of its core properties. Knowledge Distillation (KD) is a prominent technique where a smaller "student" model is trained to mimic a larger "teacher" model. This paper introduces a solvable model to analyze how regularization properties are inherited through KD, using tools from statistical physics.

Introduction

Knowledge Distillation (KD) is one of those deep learning techniques that works remarkably well in practice but remains a bit of a theoretical mystery. We know that training a small "student" model to mimic the soft outputs of a large "teacher" model often yields better results than training that same student on raw data. But why?

In their paper, "Solvable Model for Inheriting the Regularization through Knowledge Distillation," Luca Saglietti and Lenka Zdeborová use the tools of statistical physics to peel back the curtain, providing an analytical framework to understand how regularization properties are passed from teacher to student. Specifically, the authors investigate how KD transfers regularization between mismatched models and whether a KD student can outperform standard training methods.

Theoretical Framework and Methods

The researchers developed a solvable model to derive exact analytical expressions for the student's generalization error in the high-dimensional limit.

  • Statistical Physics Framework: They employed the replica method, a technique from the physics of disordered systems, to analyze the learning dynamics.
  • The Model: The task involves a binary classification based on a Gaussian Mixture Model (GMM). This synthetic dataset allows for precise mathematical control over signal-to-noise ratios and cluster overlaps.
  • Teacher-Student Mismatch: To simulate real-world compression, they utilized a dense teacher and a sparse student (where only a fraction $\eta$ of the weights are trainable).
  • Loss Function: The student minimizes a distillation loss that balances fitting the ground-truth labels and mimicking the teacher's sigmoid outputs.

The Mechanism of Regularization Inheritance

A central insight of the paper is Regularization Inheritance. The student doesn't need to know how the teacher was regularized (e.g., the specific weight decay setting). By simply trying to match the teacher's "soft" outputs, the student automatically behaves as if it were regularized itself.

In standard logistic regression, models often push weights toward infinity to match hard 0/1 labels, leading to overfitting. The teacher’s soft outputs (e.g., 0.7 instead of 1) provide a "natural" ceiling that prevents this weight explosion, acting as a buffer that stabilizes the student's training.

Performance Analysis and Results

The study demonstrates that KD achieves generalization scores comparable to a student model that has had its own $L_2$ regularization perfectly fine-tuned. This suggests KD is a robust way to achieve high performance without tedious hyperparameter searches.

Generalization error $\epsilon_g$ as a function of the sample complexity $\alpha$, comparing the Bayes-optimal (BO) limit with the performance of optimal $L_2$ regularization.

As shown in the analysis of generalization error $\epsilon_g$ versus sample complexity $\alpha$, when distilling from a Bayes-optimal teacher, the student can nearly close the gap to the theoretical performance limit. The authors also identified a unique "hybrid double descent" profile in KD settings, combining peaks seen in both classification and regression depending on the balance between teacher guidance and ground-truth labels.

Discussion and Limitations

The primary limitation of this work is the simplicity of the model, which is restricted to shallow (linear) networks and synthetic Gaussian data. While the qualitative findings align with empirical observations in deep learning, the mathematical complexity of multi-layer "deep" distillation remains a challenge for future research. The authors suggest that extending the replica method to deeper architectures and non-Gaussian data distributions will be crucial for a complete theoretical understanding of the "dark knowledge" transfer.

Summary updated

BibTeX
@inproceedings{saglietti2021solvable,
  author = {Luca Saglietti and Lenka Zdeborová},
  title = {{Solvable Model for Inheriting the Regularization through Knowledge Distillation}},
  booktitle = {MSML},
  year = {2021},
  url = {https://openreview.net/forum?id=-qkuqMnFXLx},
}
Figure