Introduction
Knowledge Distillation (KD) has emerged as a cornerstone technique for model compression, enabling the transfer of knowledge from a high-capacity "teacher" network to a compact "student" network. Traditionally, KD methods are categorized into logit-based and feature-based approaches. Logit-based KD is computationally efficient as it only requires the final output probabilities, yet it often lags in accuracy. Conversely, feature-based KD achieves state-of-the-art performance by mimicking intermediate representations, but at the cost of significant training overhead and complex architectural constraints.
This paper identifies a fundamental limitation in existing logit-based methods: they focus almost exclusively on instance-level information—how a teacher classifies a single image in isolation. This narrow focus ignores the rich inter-instance and class-level semantic relationships that a teacher network naturally learns. To bridge this gap, the authors propose Class-aware Logit Knowledge Distillation (CLKD), a parameter-free method that extracts high-level semantic structure from logits.
Methodology: The CLKD Framework
The core innovation of CLKD lies in its treatment of the logit matrix. In a standard training batch, the logit matrix has dimensions $B \times C$ (Batch size $\times$ Number of classes). While vanilla KD operates row-wise to distill individual instances, CLKD introduces a dual-perspective approach.
Class Distillation via Transposition
By transposing the logit matrix, CLKD shifts the focus from rows (instances) to columns (classes). Each column represents a "class representation" across the current batch. Forcing the student to mimic these transposed columns allows it to capture the teacher's global understanding of how different classes relate to one another across various data samples. This process effectively distills the teacher's categorical boundaries and semantic correlations.
Addressing the Amplitude Gap
Teacher networks typically exhibit much higher confidence than students, leading to a significant disparity in logit magnitudes. To mitigate this, CLKD employs Normalized Mean-Squared Error (NMSE). By scaling the teacher and student outputs before calculating the loss, the method ensures that the student focuses on the relative structural information (the "dark knowledge") rather than struggling to match the teacher's absolute confidence levels.
Class Correlation Loss (CC)
Beyond direct logit mimicking, CLKD introduces a Class Correlation loss. By calculating a $C \times C$ correlation matrix for both models, the student is trained to preserve the teacher's internal hierarchy of class similarities (e.g., ensuring the student understands that a "Sparrow" is semantically closer to an "Ostrich" than to a "Fish").
Experiments and Results
The researchers evaluated CLKD across diverse benchmarks, including CIFAR-100, ImageNet, and Cityscapes, utilizing various architecture pairs such as ResNet, VGG, and MobileNet.
Performance Comparison
CLKD consistently outperforms both traditional logit-based methods and more complex feature-based methods. As shown in the results table, CLKD achieves superior accuracy across nearly all tested student-teacher configurations. For instance, when distilling a ResNet-32x4 into a ShuffleV1, CLKD reached 77.88% accuracy, significantly surpassing the baseline KD (74.00%) and even advanced feature-based methods like CRD (75.46%).
Efficiency and Robustness
One of the most compelling aspects of CLKD is its efficiency. Because it operates solely on logits and requires no additional "projector" layers or complex transformations, it adds zero extra parameters to the model. Training time is nearly identical to vanilla KD, making it roughly three times faster than feature-heavy methods like CRD. Furthermore, CLKD demonstrates remarkable robustness in heterogeneous distillation scenarios, where the teacher and student have radically different architectures, a common failure point for feature-based methods.
Conclusion
Class-aware Logit Knowledge Distillation (CLKD) revitalizes logit-based distillation by demonstrating that high-level semantic information is readily available in the final output layer if viewed through a class-wise lens. By combining matrix transposition with normalized losses and correlation metrics, CLKD provides a simple, efficient, and highly effective alternative to computationally expensive feature-based distillation techniques.
Summary updated