On Explaining Knowledge Distillation: Measuring and Visualising the Knowledge Transfer Process

Gereziher Adhane, Mohammad Mahdi Dehshibi, Dennis Vetter, David Masip, Gemma Roig

Knowledge Distillation (KD) has become a cornerstone of deep learning, enabling the deployment of high-performance models on resource-constrained devices by transferring "knowledge" from a large Teacher model to a smaller Student model. Despite its success, the underlying mechanism of this transfer has remained opaque. Researchers from Universitat Oberta de Catalunya and Goethe University Frankfurt address this "black box" nature in their recent work, introducing a framework to measure and visualize the knowledge transfer process.

The Challenge of Interpretability in KD

Standard explainability tools, such as Grad-CAM, highlight regions of interest for a single model but fail to distinguish between features inherited from a teacher and those developed independently. The authors identify a need to differentiate between distilled features (acquired via KD) and residual features (features present in the Teacher but ignored by the Student).

Methodology: UniCAM and Quantitative Metrics

The researchers propose UniCAM (Unique Class Activation Mapping), a tool that leverages partial distance correlation (pdCor) to isolate unique features. By comparing a Student model with a "Base" model (the same architecture trained without KD), UniCAM identifies exactly which visual cues the Student has gained or discarded due to the distillation process.

Visualizing distilled vs. residual features using UniCAM on leaf images.

To quantify these observations, two new metrics are introduced:

  1. Feature Similarity Score (FSS): Measures the alignment between Student and Teacher attention maps.
  2. Relevance Score (RS): Evaluates the semantic meaningfulness of features by correlating them with BERT embeddings of ground truth labels.

Experimental Insights

The framework was validated across CIFAR-10, ASIRRA (cats vs. dogs), and a Plant Disease dataset.

KD as a Noise Filter

A key finding is that KD acts as a sophisticated noise filter. UniCAM visualizations reveal that "residual features" are often diffuse background elements, while "distilled features" are sharp and focused on task-critical object parts. This suggests that KD teaches the Student not just what to look at, but more importantly, what to ignore.

Quantitative Performance

The metrics confirm that KD models consistently achieve higher Relevance Scores than their independently trained counterparts. As shown in the layer-wise analysis, the similarity and relevance of features typically increase as information flows through the network layers.

Quantitative analysis of Feature Similarity Score (FSS) and Relevance Score (RS) across network layers.

Localization and the Capacity Gap

Qualitative analysis shows that KD-trained Students localize objects much earlier in the network (often by Layer 1 or 2) compared to Base models. Furthermore, the study provides visual evidence of the "capacity gap"—where a Student's performance degrades when the Teacher is excessively complex—and demonstrates how "Teacher Assistants" can mitigate this by bridging the feature complexity gap.

Conclusion

By providing both a visual and quantitative lens, this research moves beyond simply observing that KD works to explaining how it works. The UniCAM framework and the FSS/RS metrics offer a vital toolkit for debugging distillation processes and optimizing lightweight architectures for real-world deployment.

Summary updated

BibTeX
@inproceedings{adhane2025explaining,
  author = {Gereziher Adhane and Mohammad Mahdi Dehshibi and Dennis Vetter and David Masip and Gemma Roig},
  title = {{On Explaining Knowledge Distillation: Measuring and Visualising the Knowledge Transfer Process}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2025},
  doi = {10.1109/wacv61041.2025.00342},
}
Figure