From Knowledge Distillation to Self-Knowledge Distillation: A Unified Approach with Normalized Loss and Customized Soft Labels

Zhendong Yang, Ailing Zeng, Zhe Li, Tianke Zhang, Chun Yuan +1 more
2/14/2026

No official code found. Best implementation: yzd-v/cls_KD (252 stars, Apache-2.0, PyTorch, last commit 2023-10-10).

Abstract

Knowledge Distillation (KD) uses the teacher’s logits as soft labels to guide the student, while self-KD does not need a real teacher to require the soft labels. This work unifies the formulations of the two tasks by decomposing and reorganizing the generic KD loss into a Normalized KD (NKD) loss and customized soft labels for both target class (image’s category) and non-target classes named Universal Self-KD (USKD). We decompose the KD loss and find the non-target loss from it forces the student’s non-target logits to match the teacher’s, but the sum of the two non-target logits is different, preventing them from being identical. NKD normalizes the non-target logits to equalize their sum. It can be generally used for KD and self-KD to better use the soft labels for distillation. USKD generates customized soft labels for both target and non-target classes without a teacher. It smooths the target logit of the student as the soft target label and uses the rank of the intermediate feature to generate the soft non-target labels with Zipf’s law. For KD with teachers, NKD achieves state-of-the-art performance on CIFAR-100 and ImageNet, boosting the ImageNet Top-1 accuracy of Res-18 from 69.90% to 71.96% with a Res-34 teacher. For self-KD without teachers, USKD is the first method that can be effectively applied to both CNN and ViT models with negligible additional time and memory cost, resulting in new state-of-the-art results, such as 1.17% and 0.55% accuracy gains on ImageNet for MobileNet and DeiT-Tiny, respectively. Code is available at https://github.com/yzd-v/cls_KD.

View on arXivView PDF

Code Implementations(1)

yzd-v/cls_KDCommunity100%
PyTorchApache-2.0

'NKD and USKD' (ICCV 2023) and 'ViTKD' (CVPRW 2024)

25219Shell, PythonAug 19, 20223 years agoApache-2.0
image-classificationknowledge-distillationpytorchself-knowledge-distillationvision-transformer

Similar Papers

Cite this paper

@article{yang2026from,
  title  = {From Knowledge Distillation to Self-Knowledge Distillation: A Unified Approach with Normalized Loss and Customized Soft Labels},
  author = {Zhendong Yang and Ailing Zeng and Zhe Li and Tianke Zhang and Chun Yuan and Yu Li},
  year   = {2026},
  eprint = {2303.13005},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2303.13005},
  journal = {ICCV 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2303.13005.svg)](https://codeofpaper.com/paper/2303.13005)

Discussion