Knowledge Distillation with Refined Logits

Wujie Sun, Defang Chen, Siwei Lyu, Genlang Chen, Chun Chen, Can Wang

TL;DR

This paper introduces Refined Logit Distillation (RLD), a novel knowledge distillation technique that addresses the issue of incorrect teacher predictions by dynamically refining teacher logits. RLD achieves superior performance on CIFAR-100 and ImageNet by preserving crucial class correlations while mitigating misleading information from the teacher model.

What Problem Does This Paper Address?

Knowledge distillation (KD) is a powerful technique for model compression, where a smaller "student" model learns from a larger, pre-trained "teacher" model. Logit distillation, a popular KD method, aims to align the output probability distributions (logits) of the teacher and student models. However, a significant challenge arises when the teacher model makes incorrect predictions. These errors can create a divergence between the teacher's output and the true labels, potentially leading the student model astray and hindering its learning. Existing methods that attempt to correct teacher predictions by directly manipulating logits (e.g., swapping class probabilities or amplifying true class probabilities) can inadvertently disrupt the subtle, yet important, relationships between different classes, thus losing valuable "dark knowledge." This paper aims to solve this problem by developing a KD method that can effectively filter out incorrect teacher information while preserving essential inter-class relationships.

Methods

The core contribution of this paper is the Refined Logit Distillation (RLD) method. RLD introduces two novel knowledge distillation components:

  • Sample Confidence (SC) Distillation: This component focuses on the teacher's confidence in its prediction for a given sample. It captures the probability of the predicted class and the sum of probabilities for all other classes. RLD aligns the student's confidence in the true class with the teacher's confidence, helping the student model to generate more accurate and confident predictions for the correct class without being overly constrained by the teacher's exact probability distribution. This is achieved by minimizing the KL divergence between the teacher's and student's confidence distributions.
  • Masked Correlation (MC) Distillation: This component dynamically masks certain classes from the teacher's logits before distillation. The masking strategy is designed to exclude classes that the teacher has ranked higher than or equal to the true class. This means that when the teacher is more confident and correct, fewer classes are masked, allowing more class correlations to be transferred. Conversely, when the teacher is incorrect, more classes are masked, reducing the influence of misleading information and giving the student more freedom to learn correct relationships. This is also achieved by minimizing the KL divergence between the masked probability distributions of the teacher and student.

The final RLD loss is a weighted combination of the standard cross-entropy loss (for learning from true labels), the SC distillation loss, and the MC distillation loss.

Datasets

The paper evaluates RLD on two standard image classification datasets:

  • CIFAR-100: This dataset contains 100 classes, with 50,000 training images and 10,000 validation images, each of size 32x32 pixels.
  • ImageNet: This is a larger and more complex dataset with 1,000 classes, comprising 1.28 million training images and 50,000 validation images, with a resolution of 224x224 pixels after pre-processing.

Key Insights and Ideas

  • Teacher errors are a significant problem: The paper highlights that even high-performing teacher models make mistakes, and these errors can negatively impact student learning in standard KD.
  • Direct logit correction can be detrimental: Existing methods that directly modify teacher logits to correct errors can inadvertently break valuable class correlations, hindering performance.
  • Two-pronged approach to knowledge: RLD's strength lies in its dual focus on "sample confidence" (how sure the teacher is) and "masked correlation" (preserving relationships between relevant classes).
  • Dynamic masking is key: The masked correlation component intelligently adapts to the teacher's accuracy, masking more when the teacher is wrong and less when it's right, thus balancing misinformation filtering and knowledge transfer.
  • RLD offers greater flexibility: By combining SC and MC, RLD provides a more nuanced way for the teacher to guide the student, leading to better performance.

Key Results

  • Superior performance: RLD consistently outperforms existing feature and logit distillation methods on both CIFAR-100 and ImageNet datasets.
  • ImageNet gains are more pronounced: The performance improvement of RLD is more substantial on ImageNet compared to CIFAR-100. The authors attribute this to the teacher models exhibiting lower accuracy on ImageNet, making the benefits of RLD's correction mechanisms more apparent.
  • Robustness to teacher quality: RLD shows significant gains even when using an "inferior" teacher model (reversed knowledge distillation scenario), outperforming DKD by a larger margin in such cases.
  • Ablation studies confirm component importance: Experiments show that both Sample Confidence and Masked Correlation components contribute positively to the overall performance of RLD.

Limitations and Future Work

  • Hyper-parameter sensitivity: The paper notes that optimal hyper-parameter settings (α and β) vary significantly across different teacher-student pairs, suggesting that fixed settings might not be universally optimal.
  • Future directions: The authors suggest exploring dynamic temperature and meta-learning for hyper-parameter tuning, incorporating data augmentation and sample selection for distilling high-quality samples, and combining RLD with state-of-the-art feature distillation methods. They also propose extending RLD to the feature domain using techniques like Class Activation Mapping.

Summary updated

BibTeX
@inproceedings{sun2025knowledge,
  author = {Wujie Sun and Defang Chen and Siwei Lyu and Genlang Chen and Chun Chen and Can Wang},
  title = {{Knowledge Distillation with Refined Logits}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure