Introduction
Knowledge Distillation (KD) is a widely used technique to compress large, high-performing "teacher" models into smaller, efficient "student" models. Central to this process is the temperature hyperparameter ($\tau$), which scales the logits before the softmax operation. A high temperature produces a smoother probability distribution, revealing the "dark knowledge" or inter-class relationships captured by the teacher. Conversely, a low temperature sharpens the distribution, focusing on the most likely class.
Traditionally, $\tau$ is treated as a fixed constant (often $\tau=4$) determined through exhaustive grid search. However, this static approach ignores the evolving needs of the student model during training. This paper introduces Curriculum Temperature for Knowledge Distillation (CTKD), which transforms temperature into a dynamic, learnable parameter that adapts to the student's progress through an adversarial curriculum.
Methodology
CTKD redefines the distillation process by introducing two core components: Adversarial Temperature Learning and an Easy-to-Hard Curriculum.
Adversarial Temperature Learning
Instead of minimizing the distillation loss with respect to temperature, CTKD employs an adversarial strategy. By incorporating a Gradient Reversal Layer (GRL), the temperature module is trained to maximize the distillation loss ($L_{kd}$). This creates a mini-max game where the temperature module acts as an adversary, attempting to find the most challenging distribution for the student to mimic. This prevents the student from plateauing and forces it to capture more nuanced information from the teacher.
Easy-to-Hard Curriculum
To ensure the student is not overwhelmed by high difficulty early in training, the authors implement a curriculum controlled by a scaling factor $\lambda$. Following a cosine schedule, $\lambda$ starts at 0 and gradually increases to 1. In the early epochs (Epoch 1 to $N$), the student focuses on basic task learning. As $\lambda$ grows, the influence of the adversarial temperature increases, progressively ramping up the distillation difficulty as the student matures.
Temperature Modules
The authors propose two implementations for the learnable temperature:
- Global-T: A single learnable parameter shared across the entire dataset, adding negligible complexity.
- Instance-T: A lightweight 2-layer MLP that predicts a sample-specific temperature based on the concatenated output distributions of both the teacher and the student. This allows the model to perform automated, per-sample label smoothing.
Experimental Results
The effectiveness of CTKD was validated across multiple standard benchmarks:
- CIFAR-100: Evaluated on 11 different teacher-student pairs, CTKD consistently outperformed vanilla KD by 0.3% to 1.1%. It also showed "plug-and-play" compatibility, providing additional performance boosts when combined with other state-of-the-art KD methods like Decoupled Knowledge Distillation (DKD).
- ImageNet-2012: For a ResNet-34 teacher and ResNet-18 student, CTKD improved Top-1 accuracy from 70.83% (vanilla KD) to 71.32%.
- MS-COCO (Object Detection): Beyond classification, CTKD improved the mAP of a ResNet-18 detector by 0.59 points over standard KD, demonstrating its versatility.
Conclusion
CTKD moves away from the "one-size-fits-all" approach to temperature in knowledge distillation. By treating the student as a "growing learner" and using an adversarial curriculum, it provides a more effective and automated way to transfer knowledge. The method is computationally efficient, adding minimal overhead while delivering consistent performance gains across various architectures and tasks. Future work may explore the application of this curriculum strategy to domains like Natural Language Processing.
Summary updated