[Paper Review] Show, Attend and Distill:Knowledge Distillation via Attention-based Feature Matching
This paper proposes Attention-based Feature Distillation (AFD), a knowledge distillation method that uses an attention mechanism to automatically identify and weight effective feature-level connections between teacher and student networks, eliminating manual link selection. AFD achieves state-of-the-art performance on model compression and transfer learning tasks by dynamically assigning distillation intensity based on learned feature similarities, outperforming prior methods like L2T with more efficient training and better generalization across diverse architectures.
Knowledge distillation extracts general knowledge from a pre-trained teacher network and provides guidance to a target student network. Most studies manually tie intermediate features of the teacher and student, and transfer knowledge through pre-defined links. However, manual selection often constructs ineffective links that limit the improvement from the distillation. There has been an attempt to address the problem, but it is still challenging to identify effective links under practical scenarios. In this paper, we introduce an effective and efficient feature distillation method utilizing all the feature levels of the teacher without manually selecting the links. Specifically, our method utilizes an attention-based meta-network that learns relative similarities between features, and applies identified similarities to control distillation intensities of all possible pairs. As a result, our method determines competent links more efficiently than the previous approach and provides better performance on model compression and transfer learning tasks. Further qualitative analyses and ablative studies describe how our method contributes to better distillation. The implementation code is available at github.com/clovaai/attention-feature-distillation.
Motivation & Objective
- To address the limitation of manual feature link selection in knowledge distillation, which often results in suboptimal or ineffective connections between teacher and student networks.
- To develop a method that efficiently and effectively identifies the most informative feature-level connections without relying on expensive inner-loop optimization or isolated gate mechanisms.
- To improve model compression and transfer learning performance by leveraging attention-based similarity learning across all possible feature pairs.
- To provide a scalable, efficient, and generalizable alternative to existing meta-learning-based distillation approaches like L2T, which suffer from high computational cost and lack of inter-link awareness.
Proposed method
- An attention-based meta-network is introduced to compute pairwise similarities between feature maps of the teacher and student networks at multiple levels.
- The attention mechanism computes query-key dot-product similarities, where queries are derived from student features and keys from teacher features, enabling dynamic weighting of distillation intensity.
- Distillation loss is computed by applying the attention weights to feature-level L2 or cosine similarity losses, allowing the model to focus on the most relevant feature pairs.
- The method operates in a co-training setting, jointly optimizing the student network and the attention-based distillation head without requiring inner-loop Hessian computation.
- The attention mechanism is implemented with query, key, and value projections, using ReLU and identity activations, and is trained end-to-end with standard backpropagation.
- The approach is compatible with existing distillation techniques such as CRD and RKD, and can be combined with them for further performance gains.
Experimental results
Research questions
- RQ1Can an attention mechanism effectively identify the most relevant feature-level connections between teacher and student networks without manual intervention?
- RQ2How does attention-based feature matching compare to manual or gate-based linking methods in terms of distillation performance and computational efficiency?
- RQ3Does the attention mechanism improve generalization across diverse network architectures and downstream tasks such as model compression and transfer learning?
- RQ4How does the attention-based approach handle architectural discrepancies, such as differences in feature map size or channel dimensions?
- RQ5What is the impact of hyperparameters like the scaling factor β on the stability and performance of the attention-based distillation process?
Key findings
- AFD achieves state-of-the-art performance on CIFAR-100, tinyImageNet, and ImageNet for model compression, outperforming both manual and L2T-based distillation methods.
- On the MIT67 transfer learning benchmark, AFD achieves 75.07% accuracy with a ResNet18 student, surpassing L2T (74.85%) and ATT (72.54%), demonstrating superior generalization.
- In ablation studies, AFD consistently outperforms random and ordered linking strategies, especially when the teacher and student have different architectural designs.
- The method shows robustness across diverse architectures, with AFD achieving 77.26% accuracy on ResNet34 → WRN-28-2 when co-trained, compared to 76.07% with ordered links.
- Sensitivity analysis confirms that the hyperparameter β has a measurable but manageable effect on performance, with optimal values found in a narrow, stable range.
- Combining AFD with CRD yields a 0.44 percentage point accuracy gain over AFD alone, indicating compatibility and additive benefits with other distillation techniques.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.