Meta Knowledge Distillation

Jihao Liu, Boxiao Liu, Hongsheng Li, Yu LiuarXiv 2022

Knowledge Distillation (KD) is a cornerstone technique for model compression, where a compact "student" model learns to replicate the behavior of a high-capacity "teacher." Despite its popularity, KD often suffers from performance degradation when the teacher is significantly larger than the student or when aggressive data augmentations are employed. This paper introduces Meta Knowledge Distillation (MKD), a framework that treats the softmax temperature ($\tau$) as a learnable parameter, adaptively tuned via meta-learning to optimize student performance.

The Temperature Sensitivity Problem

Standard KD relies on a fixed temperature hyperparameter to "soften" the teacher's output distribution. However, the optimal temperature is highly sensitive to the specific teacher-student pair and the training conditions.

  1. The Teacher-Student Gap: A more powerful teacher does not always lead to a better student. If the capacity gap is too wide, the student fails to capture the teacher's complex internal representations.
  2. Augmentation Incompatibility: Modern augmentations like Mixup or CutMix, while beneficial for the teacher, can produce "sharp" or noisy outputs that are difficult for a student to follow with a fixed temperature.
Sensitivity of Top-1 accuracy to temperature across different ResNet architectures and data augmentations on CIFAR-100.

As shown in the figures above, the optimal temperature varies significantly. For instance, different ResNet depths (left) and different augmentation strategies (middle) reach peak accuracy at different $\tau$ values. The heatmap (right) further illustrates the complex interaction between teacher and student temperatures.

Meta Knowledge Distillation (MKD)

MKD addresses these issues by automating the search for the optimal temperature. Instead of manual tuning, the framework employs a bi-level optimization strategy.

Meta-Learning Framework

In each training iteration, MKD performs a "look-ahead" step:

  1. Pre-update: The student is temporarily updated using the current temperature parameters.
  2. Evaluation: The pre-updated student's performance is evaluated on a small validation set.
  3. Meta-update: The gradient of the validation loss is used to update a tiny Temperature Prediction Network (a 2-layer MLP). This network outputs the optimal temperatures for both teacher ($\tau_t$) and student ($\tau_s$) based on learnable embeddings.

Dynamic Adaptation

Unlike a fixed schedule, MKD allows the temperatures to evolve dynamically throughout the training process. This adaptation ensures that the "softness" of the targets remains appropriate as the student's capacity to learn from the teacher changes.

Evolution of learnable temperature parameters during training.

Key Results and Impact

The researchers validated MKD across various architectures, including ResNets and Vision Transformers (ViTs), on CIFAR-100 and ImageNet-1K.

  • State-of-the-Art Vision Transformers: On ImageNet-1K, MKD enabled a ViT-Large model to achieve 86.5% top-1 accuracy. Notably, this outperformed the popular Masked Autoencoder (MAE) approach while requiring significantly less training time (600 vs. 1,650 epochs).
  • Bridging the Capacity Gap: MKD successfully mitigated the performance drop-off typically observed when distilling a small ResNet20 student from increasingly large ResNet teachers.
  • Efficiency and Transferability: For large-scale models, the authors demonstrated that optimal temperatures learned on smaller proxy models (e.g., ViT-Tiny) could be effectively transferred to larger models, reducing the computational overhead of meta-learning.

Conclusion

Meta Knowledge Distillation redefines temperature from a static hyperparameter to a dynamic, learnable component of the distillation process. By automatically bridging the gap between diverse teacher-student pairs and accommodating strong data augmentations, MKD provides a robust and efficient path for training high-performance compact models.

Summary updated

BibTeX
@misc{liu2022meta,
  author = {Jihao Liu and Boxiao Liu and Hongsheng Li and Yu Liu},
  title = {{Meta Knowledge Distillation}},
  year = {2022},
  eprint = {2202.07940},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2202.07940},
}
Figure