Abstract
Recently, Mixture of Experts (MoE) Transformers have garnered increasing attention due to their advantages in model capacity and computational efficiency. However, studies have indicated that MoE Transformers underperform vanilla Transformers in many downstream tasks, significantly diminishing the practical value of MoE models. To explain this issue, we propose that the pre-training performance and transfer capability of a model are joint determinants of its downstream task performance. MoE models, in comparison to vanilla models, have poorer transfer capability, leading to their subpar performance in downstream tasks. To address this issue, we introduce the concept of transfer capability distillation, positing that although vanilla models have weaker performance, they are effective teachers of transfer capability. The MoE models guided by vanilla models can achieve both strong pre-training performance and transfer capability, ultimately enhancing their performance in downstream tasks. We design a specific distillation method and conduct experiments on the BERT architecture. Experimental results show a significant improvement in downstream performance of MoE models, and many further evidences also strongly support the concept of transfer capability distillation. Finally, we attempt to interpret transfer capability distillation and provide some insights from the perspective of model feature.
Introduction: The MoE Transfer Gap
Mixture-of-Experts (MoE) Transformers are a leading approach for efficient scaling. By employing a sparse architecture where only a subset of parameters (experts) is active for any given input, researchers can scale model capacity without a proportional increase in computational overhead.
Despite their efficiency, MoE models often suffer from a "transfer gap." While they typically achieve lower pre-training loss than dense "vanilla" Transformers, they frequently underperform when fine-tuned on specific downstream tasks. This research suggests that downstream performance is a product of two factors: pre-training performance and transfer capability. While MoEs excel at the former, they lack the latter, leading to suboptimal real-world utility.
Methodology: Transfer Capability Distillation (TCD)
To bridge this gap, the authors introduce Transfer Capability Distillation (TCD). This approach is counterintuitive: it utilizes a "weak" vanilla Transformer (one with lower capacity and higher pre-training loss) as a teacher for a "strong" MoE student. The hypothesis is that vanilla Transformers, despite their lower capacity, learn more generalizable features that are easier to transfer to new tasks.
Rather than forcing the student to mimic the teacher's exact output values, TCD employs Relation Alignment to transfer structural knowledge. The alignment occurs at three critical architectural points:
- Model Trunk: Aligning cosine similarity between tokens after layer normalization.
- Residual Inner: Aligning token relationships before residual connections.
- Multi-Head Attention (MHA): Matching query-key similarity matrices within attention heads.
By focusing on how tokens relate to one another rather than absolute hidden states, the MoE student can retain its superior pre-training capacity while adopting the structural "wisdom" of the vanilla teacher.
Experimental Setup
The models were pre-trained on standard corpora, including Wikipedia and BooksCorpus. Downstream evaluation was conducted using the GLUE (General Language Understanding Evaluation) benchmark, covering tasks like sentiment analysis (SST-2) and natural language inference (MNLI). Additionally, the authors performed Out-of-Distribution (OOD) analysis using subsets of The Pile to evaluate how well feature representations generalize to unseen data types like ArXiv and Github code.
Key Results and Discussion
Experimental results across two scales (H=128 and H=768) demonstrate that TCD effectively resolves the transfer gap. As shown in the performance metrics, MoE models trained with TCD consistently outperform both the original MoE and the vanilla teacher on downstream tasks.
For the base-sized model (H=768), the MoE w/ TCD achieved a GLUE score of 84.83, surpassing the Vanilla teacher (83.81) and the standard MoE (83.72). Notably, while the MoE w/ TCD slightly trails the standard MoE in raw pre-training loss, its superior transfer capability leads to much higher downstream utility.
The "Weak Teacher" Paradox
A core insight of this work is that a model that is technically "worse" at pre-training can still be an exceptional teacher if it possesses the transferability that the student lacks. Furthermore, OOD analysis revealed that standard MoEs often "overfit" to the pre-training distribution. TCD corrects this by improving the robustness and quality of the learned features, allowing the model to handle diverse logic and data types more effectively.
Conclusion and Future Work
Transfer Capability Distillation provides a robust framework for improving MoE performance without sacrificing their computational advantages. While highly effective at the BERT-base scale, future research is needed to explore the optimal maturity of teacher models and to scale TCD to billion-parameter Large Language Models (LLMs). Understanding the fundamental architectural reasons why vanilla models learn more generalizable features remains a key open question for the field.
Summary updated