[Paper Review] One-for-All: Bridge the Gap Between Heterogeneous Architectures in Knowledge Distillation
The paper introduces OFA-KD, a cross-architecture knowledge distillation framework that aligns heterogeneous teacher–student representations in the logits space using extra exit branches and an adaptive target information enhancement loss, improving performance of CNN, ViT, and MLP students.
Knowledge distillation~(KD) has proven to be a highly effective approach for enhancing model performance through a teacher-student training scheme. However, most existing distillation methods are designed under the assumption that the teacher and student models belong to the same model family, particularly the hint-based approaches. By using centered kernel alignment (CKA) to compare the learned features between heterogeneous teacher and student models, we observe significant feature divergence. This divergence illustrates the ineffectiveness of previous hint-based methods in cross-architecture distillation. To tackle the challenge in distilling heterogeneous models, we propose a simple yet effective one-for-all KD framework called OFA-KD, which significantly improves the distillation performance between heterogeneous architectures. Specifically, we project intermediate features into an aligned latent space such as the logits space, where architecture-specific information is discarded. Additionally, we introduce an adaptive target enhancement scheme to prevent the student from being disturbed by irrelevant information. Extensive experiments with various architectures, including CNN, Transformer, and MLP, demonstrate the superiority of our OFA-KD framework in enabling distillation between heterogeneous architectures. Specifically, when equipped with our OFA-KD, the student models achieve notable performance improvements, with a maximum gain of 8.0% on the CIFAR-100 dataset and 0.7% on the ImageNet-1K dataset. PyTorch code and checkpoints can be found at https://github.com/Hao840/OFAKD.
Motivation & Objective
- Motivate knowledge distillation across heterogeneous architectures (CNN, Transformer, MLP) where feature spaces diverge significantly.
- Show that direct feature matching is ineffective for cross-architecture KD and propose a logits-space alignment strategy.
- Develop an adaptive loss (OFA) that emphasizes the target class information based on teacher confidence.
- Demonstrate broad empirical gains across multiple teacher–student pairs on CIFAR-100 and ImageNet-1K.
Proposed method
- Introduce exit branches in the student to project intermediate features into the logits space for cross-architecture distillation.
- Match the logits of the teacher with multiple student exits, removing architecture-specific information from intermediate features.
- Formulate a modified KD loss (OFA) with a modulating parameter gamma to adaptively enhance target information based on teacher confidence.
- Provide guidance on training details, including where to place exits and how to set optimization hyperparameters and gamma.
Experimental results
Research questions
- RQ1Can cross-architecture knowledge distillation be effectively performed when teacher and student have heterogeneous architectures (CNN, ViT, MLP)?
- RQ2Does aligning representations in the logits space via extra exits enable meaningful transfer of knowledge across architectures?
- RQ3Does the adaptive target information enhancement loss improve distillation when teacher confidence varies across samples?
- RQ4What are the empirical gains of OFA-KD across CIFAR-100 and ImageNet-1K for diverse teacher–student pairs?
Key findings
- OFA-KD yields consistent gains over strong baselines across all heterogeneous combinations, with up to 8.0% accuracy improvement on CIFAR-100 and up to 0.7% on ImageNet-1K.
- Aligning intermediate representations into the logits space removes architecture-specific information and enables cross-architecture distillation.
- The adaptive OFA loss (with a modulating parameter gamma) increases target information when the teacher is confident and mitigates interference when the teacher is uncertain.
- Ablation studies show that using multiple exits and placing them across the four stages yields the best performance.
- Distillation with heterogeneous teachers can outperform homogeneous-teacher settings for some architectures (e.g., ResNet50 with ViT-B teacher), highlighting the value of cross-architecture KD.
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.