TL;DR
Standard knowledge distillation helps compress large AI models but often fails to transfer the teacher's underlying reasoning, leading to student models that are "right for the wrong reasons." This paper introduces Explanation-Enhanced Knowledge Distillation ($e^2$KD), a simple, model-agnostic approach that forces students to match the visual explanations of their teachers. This significantly improves data efficiency, out-of-distribution robustness, and faithfulness to the teacher's decision-making process.
What Problem Does This Paper Address?
Knowledge Distillation (KD) is a popular technique for squeezing a massive, computationally expensive "teacher" model into a lightweight "student" model suitable for edge devices. Traditionally, this is done by training the student to match the teacher's final output probabilities (logits).
However, matching the final answer doesn't mean the student is learning the same underlying function. For instance, a student model might achieve high accuracy on a dataset by relying on spurious shortcuts—like identifying a waterbird solely by the water in the background—whereas the teacher actually looked at the bird itself. This lack of "faithfulness" means students often fail catastrophically under distribution shifts, perform poorly when training data is scarce, and lose any carefully engineered interpretability properties the teacher possessed.
Methods
The authors propose Explanation-Enhanced Knowledge Distillation ($e^2$KD). Instead of just minimizing the standard difference between teacher and student logits ($\mathcal{L}_{KD}$), they introduce an explanation loss term ($\mathcal{L}_{exp}$):
$$\mathcal{L} = \mathcal{L}_{KD} + \lambda \mathcal{L}_{exp}$$
The explanation loss directly minimizes the cosine distance between the teacher's and student's explanation maps for the predicted class.
Crucially, $e^2$KD is completely model-agnostic and parameter-free. It can seamlessly leverage standard post-hoc explanation methods like GradCAM for conventional networks, or the inherent explanation weights of specialized architectures like B-cos networks.
To address the high computational cost of generating dynamic explanations for the teacher at every training step, the authors also introduce "Frozen Explanations." Here, the teacher's explanations are pre-computed once at the start of training. During distillation, the exact same spatial data augmentations (such as random cropping or flipping) are applied simultaneously to both the input image and the pre-computed explanation map.
Datasets
The approach was validated across several diverse computer vision benchmarks:
- ImageNet: Used to evaluate standard classification performance and teacher-student agreement, particularly in data-scarce settings (50-shot and 200-shot regimes).
- Waterbirds-100: A dataset specifically designed to test spurious correlations, where foreground objects (birds) are highly correlated with specific backgrounds (land vs. water) during training, but reversed at test time.
- PASCAL VOC: A multi-label dataset used to quantify how well the student maintains localized, human-aligned explanations using bounding box annotations.
- SUN397: Used as an unrelated dataset to test cross-domain distillation performance (e.g., distilling on SUN397 and testing on ImageNet).
Key Insights and Ideas
- Right for the Right Reasons: By forcing the student to look at the same pixels as the teacher, $e^2$KD successfully prevents the student from latching onto background noise or spurious shortcuts.
- Supervisory Richness of Explanations: Visual explanations provide a dense spatial signal. When training data is severely limited (e.g., only 50 images per class), teaching how the teacher reasons yields massive accuracy and alignment gains compared to standard KD.
- Distilling Inductive Biases Across Architectures: Remarkably, $e^2$KD can transfer architectural priors that aren't explicitly explicitly coded into the student. When distilling from a CNN (inherently robust to small pixel shifts) to a Vision Transformer (ViT, which normally suffers from patch-boundary artifacts under shifts), the ViT student inherits the CNN's shift-invariance properties.
Key Results
- Limited Data Efficiency: On 50-shot ImageNet using standard models, $e^2$KD improves top-1 accuracy by 5.1 percentage points (p.p.) and teacher-student agreement by 6.2 p.p. over vanilla KD. For B-cos models, the gains leap to +8.6 p.p. in accuracy and +10.0 p.p. in agreement.
- Out-of-Distribution Robustness: On the Waterbirds dataset under distribution shift (e.g., testing on a waterbird placed on land), $e^2$KD dramatically outperforms vanilla KD, demonstrating that the student successfully ignores the background context to focus on the actual object.
- Frozen Efficiency: Utilizing "frozen explanations" still yields substantial improvements over vanilla KD while drastically reducing the computational overhead of querying the teacher dynamically.
Limitations and Future Work
While "frozen explanations" successfully mitigate training compute costs, they remain an approximation because they cannot dynamically adapt if the student's internal representations shift drastically during later stages of training. Additionally, the success of $e^2$KD is fundamentally bounded by the quality of the teacher's explanations; if the teacher provides poor or noisy explanations, the student will faithfully copy those flaws.
The authors suggest that future work could explore extending explanation-enhanced distillation beyond computer vision to modalities like natural language processing (NLP) or tabular data.
Summary updated