Abstract
Knowledge Distillation (KD) aims at distilling the knowledge from a large teacher model to a lightweight student model. Mainstream KD methods are divided into logit distillation and feature distillation. The former is easy to implement but often inferior in performance, while the latter, though more effective, is not always applicable due to privacy and safety concerns regarding internal model access. In this paper, we propose Multi-level Logit Distillation (MLD), a framework that makes better utilization of logit outputs through multi-level prediction alignment. By aligning predictions at the instance, batch, and class levels, the student model learns instance prediction, input correlation, and category correlation simultaneously. Additionally, a prediction augmentation mechanism based on model calibration further boosts performance. Extensive experiments validate that MLD consistently outperforms previous logit distillation methods and achieves performance competitive with mainstream feature distillation methods.
Introduction: The Logit vs. Feature Dilemma
Knowledge Distillation (KD) is a critical technique for model compression, enabling the transfer of knowledge from a complex teacher model to a smaller student model. Historically, this has been approached in two ways:
- Logit Distillation: The student mimics the teacher’s final output probabilities. This "black-box" approach is easy to implement and preserves the teacher's internal privacy. However, it typically yields lower accuracy because it ignores the rich intermediate representations.
- Feature Distillation: The student mimics the internal layers of the teacher. While this offers superior performance, it requires "white-box" access to the teacher's architecture, which may be restricted due to commercial IP or security concerns.
The challenge lies in achieving feature-level performance using only logit-level access. MLD addresses this by arguing that previous logit methods were limited by focusing solely on individual samples (instance-level), missing the relational information embedded in how a teacher relates different inputs and categories.
Methodology: Multi-Level Logit Distillation (MLD)
The MLD framework enhances the distillation process through two primary mechanisms: Prediction Augmentation and Multi-level Alignment.
Prediction Augmentation
Standard KD uses a single temperature hyperparameter ($T$) to soften probability distributions. MLD introduces a prediction augmentation mechanism that utilizes a set of diverse temperatures. This process generates multiple probability distributions from a single logit output, providing the student with a richer, multi-scale signal that aids in better model calibration.
Multi-level Alignment
To capture the relational knowledge typically found in features, MLD minimizes three distinct alignment losses:
- Instance-level Alignment: The student matches the teacher's smoothed output for individual images, maintaining the core logic of vanilla KD.
- Batch-level Alignment (Input Correlation): By calculating correlations (e.g., via a Gram Matrix) between different images within a batch, the student learns the teacher's perception of inter-sample relationships.
- Class-level Alignment (Category Correlation): This captures how different categories relate to one another across the batch, allowing the student to learn semantic similarities (e.g., the relationship between "Husky" and "Wolf").
Experimental Evaluation
The authors evaluated MLD across several benchmarks, including CIFAR-100, ImageNet, and MS-COCO (for object detection). The experiments covered both homogenous architectures (e.g., ResNet to ResNet) and heterogeneous architectures (e.g., ResNet to ShuffleNet).
Key Results
- Performance Gains: MLD consistently outperformed previous logit-based methods. On CIFAR-100, it achieved an average accuracy of 75.09% for homogenous setups, reaching parity with top-tier feature distillation methods.
- Scalability: On ImageNet, a ResNet18 student trained via MLD by a ResNet34 teacher reached 71.90% Top-1 accuracy, a significant improvement over the 70.66% achieved by vanilla KD.
- Efficiency: MLD is significantly faster to train than feature-based methods. By avoiding the alignment of high-dimensional internal tensors, it achieves a 2-3x speedup in training time per batch compared to methods like ReviewKD.
Conclusion
MLD demonstrates that logits are essentially "compressed" features. By unpacking relational knowledge through batch and class correlations, MLD bridges the performance gap between logit and feature distillation without requiring internal model access. While the method relies on batch-level correlations—potentially making it sensitive to batch size—its efficiency and performance make it a robust choice for practical "black-box" distillation scenarios.
Code is available at https://github.com/Jin-Ying/Multi-Level-Logit-Distillation.
Summary updated