Skip to main content
QUICK REVIEW

[Paper Review] Rethinking Knowledge Distillation via Cross-Entropy

Zhendong Yang, Zhe Li|arXiv (Cornell University)|Aug 22, 2022
Advanced Neural Network ApplicationsComputer Science13 citations
TL;DR

This paper rethinks knowledge distillation by decomposing the classical KD loss into a combination of cross-entropy (CE) loss and an extra loss that distorts optimization due to mismatched probability scales. To resolve this, the authors propose a distributed loss for non-target distribution knowledge and a soft loss using the teacher’s target output as a smooth label, leading to a new loss (NKD) that achieves state-of-the-art accuracy on CIFAR-100 and ImageNet. A teacher-free variant (tf-NKD) further boosts performance by smoothing student predictions, achieving +0.86% Top-1 accuracy on ImageNet with ResNet-18.

ABSTRACT

Knowledge Distillation (KD) has developed extensively and boosted various tasks. The classical KD method adds the KD loss to the original cross-entropy (CE) loss. We try to decompose the KD loss to explore its relation with the CE loss. Surprisingly, we find it can be regarded as a combination of the CE loss and an extra loss which has the identical form as the CE loss. However, we notice the extra loss forces the student's relative probability to learn the teacher's absolute probability. Moreover, the sum of the two probabilities is different, making it hard to optimize. To address this issue, we revise the formulation and propose a distributed loss. In addition, we utilize teachers' target output as the soft target, proposing the soft loss. Combining the soft loss and the distributed loss, we propose a new KD loss (NKD). Furthermore, we smooth students' target output to treat it as the soft target for training without teachers and propose a teacher-free new KD loss (tf-NKD). Our method achieves state-of-the-art performance on CIFAR-100 and ImageNet. For example, with ResNet-34 as the teacher, we boost the ImageNet Top-1 accuracy of ResNet18 from 69.90% to 71.96%. In training without teachers, MobileNet, ResNet-18 and SwinTransformer-Tiny achieve 70.04%, 70.76%, and 81.48%, which are 0.83%, 0.86%, and 0.30% higher than the baseline, respectively. The code is available at https://github.com/yzd-v/cls_KD.

Motivation & Objective

  • To analyze the underlying relationship between classical knowledge distillation (KD) loss and the original cross-entropy (CE) loss.
  • To identify the optimization challenge in KD caused by the mismatch between student’s relative probabilities and teacher’s absolute probabilities in the extra loss component.
  • To develop a new loss formulation that decouples and improves the optimization of non-target distribution knowledge transfer.
  • To propose a soft loss that treats the teacher’s target output as a smooth label to enhance distillation performance.
  • To enable teacher-free knowledge distillation by smoothing student predictions to create stable soft targets, achieving strong performance without pre-trained teachers.

Proposed method

  • Decomposes the classical KD loss into the original CE loss and an extra loss that forces the student to match the teacher’s absolute probabilities for non-target classes.
  • Proposes a distributed loss to transfer non-target distribution knowledge more effectively by normalizing the probability scale.
  • Introduces a soft loss that uses the teacher’s target output as a soft label, providing smoother supervision than hard labels.
  • Combines the distributed loss and soft loss with the original CE loss to form the New Knowledge Distillation (NKD) loss for improved performance.
  • Develops a teacher-free variant (tf-NKD) by smoothing the student’s own target output across training epochs to generate stable soft targets.
  • Applies a specific smoothing function $ S_t + V_t - \text{mean}(S_t) $ to stabilize student predictions and improve soft target quality in tf-NKD.

Experimental results

Research questions

  • RQ1How does the classical KD loss relate to the original cross-entropy loss in terms of optimization dynamics?
  • RQ2Why does the standard KD loss lead to suboptimal optimization, and what causes the mismatch between student and teacher probability scales?
  • RQ3Can non-target distribution knowledge be transferred more effectively by reformulating the KD loss?
  • RQ4Can the teacher’s target output be used as a soft label to improve distillation performance?
  • RQ5Is it feasible to train a student model effectively without a teacher by using its own smoothed predictions as soft targets?

Key findings

  • With ResNet-34 as teacher, the proposed NKD loss boosts ResNet-18’s ImageNet Top-1 accuracy from 69.90% to 71.96%.
  • The teacher-free tf-NKD method achieves 70.76% Top-1 accuracy on ImageNet with ResNet-18, an improvement of 0.86% over the baseline.
  • On CIFAR-100, the NKD loss achieves 80.76% Top-1 accuracy with ResNet-18 and ResNet-34 as teacher, outperforming prior methods.
  • The tf-NKD variant with the smoothing function $ S_t + V_t - \text{mean}(S_t) $ achieves the highest gain of 0.86% on ImageNet, surpassing even the use of a teacher’s output as soft target.
  • Visualizations confirm that the smoothed student targets reflect true class membership more consistently across training epochs, improving label stability.
  • The method requires no additional training time compared to baseline, as all weights are derived from student predictions during training.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.