Follow Your Path: a Progressive Method for Knowledge Distillation

Wenxian Shi, Yuxuan Song, Hao Zhou, Bohan Li, Lei Li

Introduction

Knowledge Distillation (KD) has emerged as a standard technique for model compression, enabling the deployment of large-scale models like BERT or ResNet onto resource-constrained devices. The process typically involves a "teacher" model—a large, high-performance network—transferring its learned representations to a smaller "student" model.

However, a persistent challenge in KD is the capacity gap. When the teacher is significantly more complex than the student, the student often struggles to mimic the teacher's outputs. This is analogous to a primary school student attempting to learn from a PhD-level textbook; the concepts are so advanced that the student cannot find a viable starting point, often leading to convergence in poor local optima. Previous attempts to mitigate this, such as using intermediate "Teacher-Assistant" models, often require manual design and can introduce training instability.

ProKT: Progressive Knowledge Teaching

To overcome the capacity gap, this paper introduces ProKT (Progressive Knowledge Teaching). ProKT shifts the paradigm from a static teacher to a dynamic, "aware" teacher that adapts to the student's learning progress.

Supervision Signal Projection

The fundamental innovation of ProKT is the concept of projecting the teacher's supervision signals into the student's neighborhood. In standard KD, the teacher is pre-trained and frozen. In ProKT, the teacher and student are trained simultaneously. The teacher's objective is modified: it must minimize its own task loss while remaining within a specific "distance" (measured by KL divergence) of the student's current output distribution.

Conceptual illustration of ProKT where the teacher's optimization path is projected into the student's neighborhood.

This mechanism ensures that the teacher provides a smooth, continuous curriculum. By staying "just one step ahead," the teacher effectively guides the student along a path that is reachable given the student's limited capacity. Theoretically, this approach is equivalent to a form of Mirror Descent, where the teacher's path is projected into the student's parameter space.

The Training Algorithm

The ProKT training loop involves an online update for both models. For every batch of input data, the teacher is updated to optimize its task performance under the proximity constraint, and the student is then updated to match the teacher's new state. This co-evolutionary process ensures the teacher remains a relevant tutor throughout the entire training duration.

Algorithm for Progressive Knowledge Teaching (ProKT).

Experimental Results

The authors evaluated ProKT across diverse domains, demonstrating its versatility and effectiveness against both vanilla KD and advanced baselines.

Computer Vision (CIFAR-100)

On the CIFAR-100 dataset, ProKT was tested with various architecture pairs, including VGG, ResNet, and MobileNetV2. ProKT consistently outperformed vanilla KD and other advanced baselines like Route-Constrained Optimization (RCO). When integrated with Contrastive Representation Distillation (CRD), ProKT achieved state-of-the-art performance, highlighting its ability to provide superior guidance even for complex visual features.

Natural Language Processing (GLUE)

The benefits of ProKT were even more pronounced in NLP tasks, where the architectural gap between teacher and student is often vast. Using a BERT-base teacher and a simple bi-LSTM student on the QNLI task, ProKT achieved an accuracy of 76.1%, a significant improvement over the 72.7% achieved by vanilla KD. This result underscores ProKT's ability to bridge the gap between highly heterogeneous architectures (e.g., Transformer to LSTM).

Key Insights

  • Adaptive Tutoring: A counter-intuitive finding is that the ProKT teacher may achieve lower final task accuracy than a standard converged teacher. However, its proximity to the student makes it a far more effective "tutor."
  • Stability and Smoothness: Unlike methods that use discrete teacher checkpoints, ProKT provides a continuous target. This prevents the "shocks" or spikes in training loss that often occur when a student is suddenly forced to match a new, distant target.
  • Inference Efficiency: While ProKT increases training time (roughly doubling it due to online teacher updates), it has zero impact on inference speed. The resulting student model remains compact and fast, ready for deployment.

Conclusion

ProKT offers a novel solution to the capacity gap in knowledge distillation by treating the teacher as a dynamic participant in the learning process. By projecting the teacher's path into the student's neighborhood, ProKT creates a smooth, personalized curriculum that enables small models to achieve performance levels previously unattainable through standard distillation methods.

Summary updated

BibTeX
@inproceedings{shi2021follow,
  author = {Wenxian Shi and Yuxuan Song and Hao Zhou and Bohan Li and Lei Li},
  title = {{Follow Your Path: a Progressive Method for Knowledge Distillation}},
  booktitle = {ECML/PKDD},
  year = {2021},
  url = {https://openreview.net/forum?id=SRbU0PBJweI},
}
Figure