Respecting Transfer Gap in Knowledge Distillation

Yulei Niu, Long Chen, Chang Zhou, Hanwang Zhang

TL;DR

This paper argues that Knowledge Distillation (KD) is fundamentally a domain transfer problem, where a "transfer gap" exists between human-labeled data and teacher-generated "soft labels." To bridge this gap, the authors introduce Inverse Probability Weighting Distillation (IPWD), a method that reweights training samples to compensate for classes that are under-represented in the teacher's biased knowledge distribution.

What Problem Does This Paper Address?

In traditional Knowledge Distillation, we assume that the teacher model provides a perfect "machine domain" version of the training data. Standard KD methods treat all samples as equally important, relying on an independent and identically distributed (IID) assumption.

However, the authors observe a paradox: even if a teacher is trained on a perfectly balanced dataset, its predictions (the "soft labels") are often highly imbalanced and long-tailed.

Imbalanced teacher predictions demonstrating the transfer gap

This creates a transfer gap. Because the teacher is more "confident" about some samples than others, the student model ends up over-learning "head" knowledge and neglecting "tail" knowledge. This explains why a more accurate teacher doesn't always result in a better student—the transfer gap itself is the bottleneck.

Methods: Inverse Probability Weighting Distillation

To tackle this challenge, the authors propose Inverse Probability Weighting Distillation (IPWD). Drawing from causal inference, they treat the teacher's bias as a "selection bias" that needs to be corrected.

Comparison of Traditional KD and IPWD architectures
  1. Propensity Scoring: For every training sample, the algorithm estimates a "propensity score"—the probability that the sample belongs to the machine domain (the teacher's perspective).
  2. Dual-Head Architecture: To estimate this score without extra labels, the student model uses two distinct "heads":
  3. A Classification (CLS) head trained on ground-truth labels (representing the human domain).
  4. A Distillation head trained on teacher predictions (representing the machine domain).
  5. Inverse Weighting: Samples that the teacher is less certain about (low propensity) are given higher weights during distillation. This forces the student to pay more attention to the "under-represented" knowledge in the teacher's distribution.
  6. Logit Normalization: To prevent training instability caused by high-variance weights, the authors normalize the logits by their standard deviation before calculating the propensity scores.

Key Insights and Ideas

  • KD as Domain Transfer: The most profound insight is reframing KD. Instead of just "copying" a teacher, the student is navigating between two different worlds: the human world (hard labels) and the machine world (soft, context-rich teacher predictions).
  • The Teacher is Naturally Biased: Even a "perfect" teacher trained on balanced data will produce imbalanced soft labels because it captures "context equivariance" (e.g., a dog image might look 20% like a wolf). These contextual relationships are naturally long-tailed.
  • The "Dark Knowledge" is in the Tail: Standard KD often washes out the subtle information in under-represented classes. By using Inverse Probability Weighting, IPWD ensures this "dark knowledge" is actually transferred.
  • Architecture Matters: The transfer gap is significantly larger when the teacher and student have different architectures (e.g., ResNet to MobileNet), making IPWD particularly effective in these "cross-architecture" scenarios.

Datasets and Key Results

The authors evaluated IPWD on two standard computer vision benchmarks: CIFAR-100 (50k images, 100 classes) and ImageNet (1.2M images, 1,000 classes). The experiments covered both two-stage distillation (large teacher to small student) and one-stage self-distillation (the model acts as its own teacher).

  • CIFAR-100 (Two-Stage): IPWD consistently outperformed standard KD and state-of-the-art methods like CRD and WSLD. For example, when distilling a ResNet-110 to a ResNet-32, IPWD achieved 73.91% accuracy compared to KD's 73.08%.
  • ImageNet: On the massive ImageNet dataset, IPWD improved the Top-1 accuracy of a MobileNet-v1 (distilled from ResNet-50) to 72.65%, outperforming the previous best (WSLD) at 71.52%.
  • Self-Distillation: When applied as a plug-in for self-distillation (PS-KD), IPWD improved ResNet-18 performance on CIFAR-100 from 79.18% to 79.82% and significantly reduced the Expected Calibration Error (ECE), meaning the model's confidence scores became more reliable.

Limitations and Future Work

  • Student Quality Dependency: The propensity score estimation relies on the student's own heads. If the student is poorly trained or very small, the weight estimation might be inaccurate, potentially hindering distillation.
  • Human Domain IID Assumption: The current method assumes the original human-labeled dataset is balanced (IID). The authors note that IPWD might need adjustments for datasets that are already long-tailed in the human domain.
  • Expansion to Other Tasks: While this paper focuses on image classification, extending this "transfer gap" logic to object detection and segmentation is a promising future direction.

Summary updated

BibTeX
@inproceedings{niu2022respecting,
  author = {Yulei Niu and Long Chen and Chang Zhou and Hanwang Zhang},
  title = {{Respecting Transfer Gap in Knowledge Distillation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=jQR9YF2-Jhg},
}
Figure