Abstract
Knowledge Distillation (KD) typically relies on a fixed temperature hyperparameter to soften teacher outputs and reveal "dark knowledge." However, fixed temperatures fail to account for the diverse logit distributions produced by different input samples. We present Normalized Knowledge Distillation (NormKD), a simple yet effective method that replaces fixed temperatures with sample-specific normalization based on logit variance. NormKD allows logit-based distillation to match or exceed the performance of complex feature-based techniques with zero additional computational overhead.
Introduction
In the standard Knowledge Distillation framework, a compact student model is trained to mimic the output probabilities of a larger, pre-trained teacher model. To facilitate the transfer of "dark knowledge"—the rich information contained in the relative probabilities of non-target classes—researchers use a temperature hyperparameter ($T$) to soften the softmax distribution. While effective, the conventional use of a global, fixed $T$ for all samples is inherently limited because it ignores the varying confidence levels and logit scales across different images.
The Problem: The Inefficiency of Fixed Temperature
The primary drawback of a fixed temperature is its inability to adapt to the teacher's varying confidence. As illustrated in Figure 1, different images produce wildly different logit distributions. A single $T$ value might be optimal for one sample but lead to "under-softening" for highly confident predictions (where information is compressed) or "over-softening" for uncertain ones (where noise is amplified). This "one-size-fits-all" approach prevents the student from capturing the full nuance of the teacher's expertise.
Methodology: Normalized Knowledge Distillation (NormKD)
NormKD addresses this by customizing the softening process for each individual sample. The core of the method involves three key steps:
- Logit Normalization: Observing that logit distributions roughly follow a normal distribution, the authors divide the logits of each sample by their own standard deviation ($\sigma$).
- Normalized Temperature ($T_{norm}$): A new scaling factor, $T_{norm}$, is applied after normalization. Because the underlying logits have been scaled to a consistent range, $T_{norm}$ becomes a much more stable and robust hyperparameter across the entire dataset.
- Adaptive Loss Scaling: To maintain gradient stability, the KL-Divergence loss is scaled by the square of the sample-specific temperature $(T_{norm} \cdot \sigma)^2$.
As shown in Figure 2, this process integrates seamlessly into existing KD pipelines, requiring only a few additional lines of code to calculate the standard deviation of the logits.
Experimental Results
NormKD was evaluated on standard benchmarks including CIFAR-100 and ImageNet, demonstrating significant improvements over vanilla KD:
- CIFAR-100: In a ResNet32x4 to ResNet8x4 distillation task, NormKD improved accuracy from 70.66% to 71.40%. When combined with Decoupled Knowledge Distillation (DKD), it reached 77.33%, surpassing state-of-the-art feature-based methods like ReviewKD (75.63%).
- ImageNet: For ResNet50 to MobileNet-V1 distillation, NormKD achieved 72.12% top-1 accuracy, a substantial increase over the 68.58% achieved by vanilla KD.
- Efficiency: Unlike feature-based methods that require aligning internal layers and increase memory usage, NormKD's training time is virtually identical to vanilla KD (approx. 7.2ms vs 7.1ms per batch).
Conclusion
NormKD demonstrates that logit-based knowledge distillation still possesses significant untapped potential. By simply accounting for the variance in logit distributions through sample-specific normalization, we can achieve state-of-the-art distillation performance without the complexity or cost of feature-based alignment. This method provides a new, efficient baseline for future research in model compression and knowledge transfer.
Summary updated