Supervision Complexity and its Role in Knowledge Distillation

Hrayr Harutyunyan, Ankit Singh Rawat, Aditya Krishna Menon, Seungyeon Kim, Sanjiv Kumar

TL;DR

Knowledge distillation (KD) is highly effective for model compression, but explaining why it works has remained a theoretical challenge. This paper introduces "supervision complexity"—a metric that quantifies how well teacher targets align with a student's Neural Tangent Kernel (NTK)—to explain the success of common KD practices like temperature scaling. Leveraging this theory, the authors propose an "online distillation" curriculum that trains students using a sequence of progressively more complex teacher checkpoints, yielding substantial accuracy gains when a large capacity gap exists between models.

What Problem Does This Paper Address?

Knowledge distillation typically compresses a large, accurate "teacher" model into a compact "student" model by training the student to match the teacher's soft label predictions. Despite its widespread adoption, several mysteries persist:

  • Why do soft labels help even in binary classification settings where class similarity information is minimal?
  • Why does a large "capacity gap" between a powerful teacher and a weak student often cause distillation to fail?
  • Why do less accurate, early-stopped, or averaged teacher models sometimes produce better students than fully converged ones?

The authors address these questions by establishing a new theoretical framework that analyzes student generalization through the lens of target difficulty and model alignment.

Methods

The paper introduces two key concepts to formalize and improve knowledge distillation:

  1. Supervision Complexity: Mathematically defined as $Y^\top K^{-1} Y$ (where $Y$ represents the teacher's targets and $K$ is the student's kernel matrix, or NTK), this metric measures how well the teacher's predictions align with the student's natural inductive biases. Low supervision complexity means the targets are inherently "easier" for the student to learn. The authors derive new generalization bounds showing that student performance is a delicate balance of teacher accuracy, student classification margin, and supervision complexity.
  2. Online Distillation: To prevent a weak student from being overwhelmed by a fully trained teacher, the authors propose using a sequence of teacher checkpoints from various stages of training (Algorithm 1). This acts as a natural curriculum: the student first learns simple, low-complexity functions from an early teacher checkpoint before moving on to more complex representations.

Additionally, the authors introduce a computationally efficient, operator-based cosine similarity metric to measure how closely the student's final NTK matrix aligns with the teacher's NTK without explicitly constructing massive matrices.

Datasets

The theoretical findings and online distillation method were validated on standard image classification benchmarks:

  • CIFAR-10
  • CIFAR-100
  • Binary CIFAR-100 (a custom variant where the 100 classes are grouped into two macro-classes to study KD without multi-class similarity information)
  • Tiny ImageNet

Key Insights and Ideas

  • The Magic of Temperature Scaling: Increasing the distillation temperature ($\tau$) softens predictions, which scales down the target norm and aligns the targets better with the top eigenvectors of the student's NTK. This directly minimizes supervision complexity, making the task easier for the student.
  • The Capacity Gap Explained: At the start of training, a fully converged teacher's predictions can look as complex as random noise to a weak student network. This high initial supervision complexity leads to memorization rather than generalization.
  • Function Space Guidance: Online distillation smoothly guides the student along the teacher's trajectory in function space.
Figure 1: Online vs. online distillation. Figures (a) and (b) illustrate possible teacher and student function trajectories in offline and offline KD. The yellow dotted lines indicate KD. Figure (c) plots adjusted super- vision complexity of various targets with respect to NTKs at different stages of training (see §4 for more details).
  • Implicit Relational Transfer: Across all experiments, final student test accuracy strongly correlates with student-teacher NTK similarity. Online distillation implicitly transfers this relational knowledge (how the model structures example-pair similarities) without requiring an explicit regularization loss.

Key Results

Online knowledge distillation consistently outperformed standard offline distillation across various architectures (ResNets, VGGs, MobileNets, and LeNet).

The performance gains were most dramatic when distilling a high-capacity teacher into a student with weak inductive biases. For instance, on CIFAR-100:

  • Distilling a ResNet-56 teacher into a wide LeNet-5x8 student using standard offline KD ($\tau=4$) achieved 59.9% accuracy.
  • Switching to Online KD ($\tau=4$) boosted the student's accuracy to 66.1%—a massive relative improvement closing much of the gap to the teacher's 72.0% accuracy.

Similar trends were observed on Tiny ImageNet and the binary CIFAR-100 task, proving that KD's benefits extend beyond simply transferring multi-class similarity information.

Limitations and Future Work

The authors note a few limitations and open directions:

  • Checkpoint Management: The proposed online distillation method relies on pre-saved teacher checkpoints, which requires careful storage and scheduling.
  • Adaptive Tuning: Future work could explore adaptive temperature scaling to dynamically smooth teacher predictions and maintain an optimal supervision complexity target throughout training.
  • Checkpoint Frequency: While the paper demonstrates that checkpoint frequency can be reduced (e.g., updating the teacher every 16 epochs instead of every epoch) with minimal performance loss, finding the optimal frequency and position of checkpoints remains an open engineering problem.
  • Theoretical Open Question: Fully explaining why online distillation naturally forces the student's NTK to align with the teacher's NTK remains an intriguing area for future mathematical analysis.

Summary updated

BibTeX
@inproceedings{harutyunyan2023supervision,
  author = {Hrayr Harutyunyan and Ankit Singh Rawat and Aditya Krishna Menon and Seungyeon Kim and Sanjiv Kumar},
  title = {{Supervision Complexity and its Role in Knowledge Distillation}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=8jU7wy7N7mA},
}
Figure