Skip to main content
QUICK REVIEW

[Paper Review] NormKD: Normalized Logits for Knowledge Distillation

Zhihao Chi, Zhengkai Tu|arXiv (Cornell University)|Aug 1, 2023
Advanced Neural Network ApplicationsComputer Science6 citations
TL;DR

This paper proposes NormKD, a simple yet effective knowledge distillation method that customizes the temperature for each sample based on the standard deviation of its logit distribution, enabling more balanced soft label generation. By normalizing logits per sample before softening, NormKD significantly improves performance over vanilla KD and even surpasses some feature-based methods, with minimal computational overhead.

ABSTRACT

Logit based knowledge distillation gets less attention in recent years since feature based methods perform better in most cases. Nevertheless, we find it still has untapped potential when we re-investigate the temperature, which is a crucial hyper-parameter to soften the logit outputs. For most of the previous works, it was set as a fixed value for the entire distillation procedure. However, as the logits from different samples are distributed quite variously, it is not feasible to soften all of them to an equal degree by just a single temperature, which may make the previous work transfer the knowledge of each sample inadequately. In this paper, we restudy the hyper-parameter temperature and figure out its incapability to distill the knowledge from each sample sufficiently when it is a single value. To address this issue, we propose Normalized Knowledge Distillation (NormKD), with the purpose of customizing the temperature for each sample according to the characteristic of the sample's logit distribution. Compared to the vanilla KD, NormKD barely has extra computation or storage cost but performs significantly better on CIRAR-100 and ImageNet for image classification. Furthermore, NormKD can be easily applied to the other logit based methods and achieve better performance which can be closer to or even better than the feature based method.

Motivation & Objective

  • To address the limitation of fixed temperature in knowledge distillation, which fails to adequately soften logits across samples with varying confidence distributions.
  • To improve knowledge transfer by dynamically adjusting the temperature for each sample based on its logit distribution characteristics.
  • To develop a method that enhances logit-based distillation without adding significant computational or storage cost.
  • To demonstrate that logit-based distillation can achieve performance comparable or superior to feature-based methods when properly optimized.

Proposed method

  • For each sample, NormKD computes the standard deviation of the teacher model's logits and uses it as the temperature for softening the logits.
  • The logits are normalized by subtracting the mean and dividing by the standard deviation before applying the softmax with the sample-specific temperature.
  • This normalization ensures that all samples have similar logit distributions, enabling more consistent and effective knowledge transfer.
  • The method is compatible with any logit-based distillation framework and can be seamlessly integrated with existing approaches like DKD.
  • The temperature is not a global hyperparameter but is dynamically determined per sample, improving soft label quality across diverse prediction confidence levels.
  • The approach introduces negligible computational overhead, as it only adds a per-sample normalization step before the standard KD loss computation.

Experimental results

Research questions

  • RQ1Can a single fixed temperature adequately soften logits across samples with highly variable prediction confidence distributions?
  • RQ2Does customizing the temperature per sample based on logit distribution characteristics improve knowledge distillation performance?
  • RQ3Can a simple, low-cost modification to vanilla knowledge distillation achieve performance on par with or better than state-of-the-art feature-based methods?
  • RQ4How does per-sample temperature adaptation affect the alignment of student and teacher logits in representation space?

Key findings

  • NormKD achieves a top-1 accuracy of 76.57% on CIFAR-100 using ResNet-32×4 as teacher and ResNet-8×4 as student, outperforming vanilla KD (73.33%) and DKD (76.32%).
  • On ImageNet, NormKD improves student accuracy by 0.3% over vanilla KD and 0.2% over DKD when using ResNet-50 as teacher and MobileNet-V1 as student.
  • When combined with DKD, NormKD further boosts performance, demonstrating that the method enhances existing logit-based approaches.
  • The ablation study confirms that $T_{norm}$, based on standard deviation, yields the best performance among temperature variants, including $V_{max}$ and $V_{max}-V_{min}$.
  • Training time for NormKD is nearly identical to vanilla KD (7.2ms vs. 7.1ms per batch), with no additional parameters, confirming its efficiency.
  • t-SNE and correlation matrix visualizations show that NormKD leads to better alignment of student and teacher logits, especially after normalization, indicating improved knowledge transfer.

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.