Spherical Knowledge Distillation

Jia Guo, Minghao Chen, Yao Hu, Chen Zhu, Xiaofei He, Deng Cai

Abstract

Knowledge distillation aims at obtaining a compact and effective model by learning the mapping function from a much larger one. Due to the limited capacity of the student, the student would underfit the teacher. Therefore, student performance would unexpectedly drop when distilling from an oversized teacher, termed the capacity gap problem. We investigate this problem by study the gap of confidence between teacher and student. We find that the magnitude of confidence is not necessary for knowledge distillation and could harm the student performance if the student are forced to learn confidence. We propose Spherical Knowledge Distillation to eliminate this gap explicitly, which eases the underfitting problem. We find this novel knowledge representation can improve compact models with much larger teachers and is robust to temperature. We conducted experiments on both CIFAR100 and ImageNet, and achieve significant improvement. Specifically, we train ResNet18 to 73.0 accuracy, which is a substantial improvement over previous SOTA and is on par with resnet34 almost twice the student size.

The Challenge of Oversized Teachers

Knowledge Distillation (KD) is a cornerstone technique for model compression, where a large "teacher" model guides the training of a smaller "student" model. The prevailing intuition suggests that a more accurate teacher should yield a more capable student. However, empirical evidence has revealed a counter-intuitive phenomenon known as the capacity gap problem: when the teacher's capacity significantly exceeds the student's, the student's performance often degrades rather than improves.

The authors identify model overconfidence as the primary driver of this gap. Large networks tend to produce high-magnitude output vectors (logits) to minimize training loss, resulting in extremely "peaky" probability distributions. Small student models, lacking the parameter count to replicate these extreme magnitudes, struggle to match the teacher's confidence. This forced attempt to mimic confidence leads to underfitting of the actual structural knowledge—the relative correlations between classes—which is the most valuable information the teacher has to offer.

Methodology: Spherical Knowledge Distillation (SKD)

To address this, the researchers propose Spherical Knowledge Distillation (SKD). The core philosophy is to decouple the direction of the logit vector (representing class correlations) from its magnitude (representing confidence).

Comparison of standard Knowledge Distillation (KD) and the proposed Spherical Knowledge Distillation (SKD) process.

As shown in the figure above, SKD introduces a normalization step. Both teacher and student logits are projected onto a unit sphere by dividing them by their respective norms. This explicitly eliminates the confidence gap. To maintain effective convergence, these normalized vectors are rescaled by a constant $l_{avg}$, representing the average norm of the teacher's logits. This ensures the student receives a signal with a magnitude it can realistically learn, while focusing its training on the directional information that encodes class relationships.

Key Results and Robustness

The effectiveness of SKD was validated on ImageNet and CIFAR-100. On ImageNet, a ResNet18 student trained with SKD achieved 73.0% accuracy, significantly outperforming previous state-of-the-art methods like CRD. Remarkably, this performance is on par with a ResNet34 model, which has nearly double the parameters.

The most significant finding is SKD's ability to solve the capacity gap. While standard KD performance peaks and then drops as the teacher model grows (e.g., from ResNet32 to ResNet110), SKD allows the student to continue benefiting from larger teachers.

Accuracy of student models using SKD vs. KD as teacher size increases, demonstrating the mitigation of the capacity gap.

Furthermore, SKD proves to be highly robust to the "temperature" ($\tau$) hyperparameter. In standard KD, tuning $\tau$ is critical to softening the teacher's overconfident predictions. Because SKD handles confidence through normalization, it maintains stable, high performance across a wide range of temperatures (from 1 to 16), whereas standard KD's performance is highly sensitive.

Conclusion

Spherical Knowledge Distillation provides a simple yet powerful solution to the capacity gap problem. By recognizing that logit magnitude is often "noise" related to model size rather than transferable knowledge, SKD allows compact models to effectively distill insights from massive, state-of-the-art teachers. This approach not only improves accuracy but also simplifies the distillation pipeline by reducing sensitivity to hyperparameters.

Summary updated

Abstract

Knowledge distillation aims at obtaining a compact and effective model by learning the mapping function from a much larger one. Due to the limited capacity of the student, the student would underfit the teacher. Therefore, student performance would unexpectedly drop when distilling from an oversized teacher, termed the capacity gap problem. We investigate this problem by study the gap of confidence between teacher and student. We find that the magnitude of confidence is not necessary for knowledge distillation and could harm the student performance if the student are forced to learn confidence. We propose Spherical Knowledge Distillation to eliminate this gap explicitly, which eases the underfitting problem. We find this novel knowledge representation can improve compact models with much larger teachers and is robust to temperature. We conducted experiments on both CIFAR100 and ImageNet, and achieve significant improvement. Specifically, we train ResNet18 to 73.0 accuracy, which is a substantial improvement over previous SOTA and is on par with resnet34 almost twice the student size. The implementation has been shared at https://github.com/forjiuzhou/Spherical-Knowledge-Distillation.
BibTeX
@misc{guo2020spherical,
  author = {Jia Guo and Minghao Chen and Yao Hu and Chen Zhu and Xiaofei He and Deng Cai},
  title = {{Spherical Knowledge Distillation}},
  year = {2020},
  eprint = {2010.07485},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.07485},
}
Figure