Abstract
Knowledge Distillation (KD) aims to transfer knowledge from a complex teacher model to a lightweight student model. While Instance Matching (IM) has dominated the field, Relation Matching (RM) has historically struggled with overfitting and noisy gradient diffusion. This paper introduces Virtual Relation Matching (VRM), a framework that revitalizes RM by incorporating virtual views and intelligent graph pruning. VRM achieves state-of-the-art results, notably reaching 74.0% Top-1 accuracy for ResNet50-to-MobileNetV2 distillation on ImageNet.
Introduction
Knowledge Distillation (KD) is a critical technique for deploying high-performance models on resource-constrained devices. Traditionally, KD methods fall into two categories: Instance Matching (IM), which aligns individual sample outputs, and Relation Matching (RM), which aligns the structural relationships between samples in a batch. Despite the theoretical appeal of RM, it has recently underperformed compared to IM due to two primary challenges: overfitting and spurious gradient diffusion.
Overfitting occurs because RM provides a "weaker" constraint than IM, allowing students to memorize training relationships without learning generalizable features. Spurious gradient diffusion arises because RM mathematically couples all samples in a batch; a single noisy response from the teacher or student can propagate errors through the entire batch's gradients, misguiding the learning process for otherwise high-quality samples.
Methodology: Virtual Relation Matching (VRM)
VRM addresses these limitations by treating relationships as a first-class citizen of knowledge through three core components: Virtual Views, Affinity Graphs, and Smart Pruning.
Virtual Views and Affinity Graphs
For every image in a batch, VRM generates a "virtual view" using stochastic augmentations. The student is tasked with matching relations between both real and virtual versions of images, acting as a powerful regularizer that encourages transformation invariance. Instead of standard Gram matrices, VRM constructs dense affinity graphs that preserve both inter-sample and inter-class correlations.
Smart Pruning Strategies
To ensure efficiency and stability, VRM employs two pruning techniques:
- Redundant Edge Pruning (REP): Removes symmetric and intra-view edges, reducing computational overhead by 75%.
- Unreliable Edge Pruning (UEP): This strategy uses Joint Entropy to identify edges where the student is uncertain. By dynamically detaching these "unreliable" edges, VRM prevents noisy gradients from infecting the rest of the batch.
Analysis of Gradient Diffusion and Overfitting
The authors conducted a pilot study to visualize the "cruxes" of RM. As shown in the performance plots, while RM-based methods can achieve high training accuracy, they often plateau early on validation sets compared to IM. More importantly, gradient analysis reveals that in standard RM, a single perturbation can diffuse across the entire batch, whereas in IM, the impact remains localized.
VRM's UEP strategy effectively "quarantines" these noisy samples, leading to a flatter loss landscape and significantly improved generalization on unseen data.
Experimental Results
VRM was evaluated across multiple benchmarks, demonstrating consistent superiority over both IM and RM competitors:
- ImageNet: For the ResNet50 → MobileNetV2 distillation task, VRM achieved 74.0% Top-1 accuracy, setting a new state-of-the-art record.
- CIFAR-100: In cross-architecture scenarios, such as distilling from a ResNet56 (CNN) to a DeiT-T (Transformer), VRM improved student accuracy by 14.44%.
- MS-COCO: The method generalized well to object detection, though it remains slightly behind specialized feature-based methods that leverage fine-grained spatial information.
Conclusion
VRM successfully revives relation-based knowledge distillation by solving the long-standing issues of overfitting and gradient instability. By leveraging virtual views and entropy-based pruning, it provides a robust framework for training lightweight models that generalize better across diverse architectures and tasks. Future work may explore more sophisticated "virtual" knowledge sources, such as synthetic data or cross-modal relations, to further enrich the student's learning signal.
Summary updated