Abstract
MergeDistill is a novel framework designed to fuse multiple specialized pre-trained language models (LMs) into a single, high-performing multilingual student model. By leveraging task-agnostic knowledge distillation and a unified vocabulary, MergeDistill overcomes the "curse of multilinguality" often found in standard massively multilingual models. Experimental results demonstrate that the resulting student models often surpass their teachers in performance while maintaining efficient model capacity, particularly in low-data scenarios.
Introduction
In Natural Language Processing (NLP), researchers face a persistent trade-off between two paradigms. Massively Multilingual Models (e.g., mBERT, XLM-R) support over 100 languages but suffer from performance dilution due to finite model capacity. Conversely, Monolingual Models (e.g., AraBERT, FinBERT) excel in their specific languages through custom vocabularies and massive language-specific training data but lack cross-lingual transfer capabilities.
MergeDistill bridges this gap by distilling specialized knowledge from various teachers into a single, robust multilingual student. This "best of both worlds" approach allows for high performance across multiple languages without the overhead of maintaining numerous specialized models.
Methodology
The MergeDistill workflow is designed to be architecture-agnostic and memory-efficient. It follows a four-step process:
- Input Selection: A set of pre-trained teacher LMs (monolingual or multilingual) and a transfer corpus (e.g., Wikipedia) are selected.
- Offline Teacher Evaluation: Teachers are run over the transfer corpus offline to store "top-k" predictions (logits) for masked tokens. This avoids the memory overhead of running multiple large models simultaneously during training.
- Vocab Mapping: A unified student vocabulary is created from the union of all teacher vocabularies. Teacher prediction indices are then mapped to these new student indices.
- Student Training: The student model is trained using a combined loss function: standard Masked Language Modeling (MLM) loss and Knowledge Distillation (KD) loss from the teachers' soft predictions.
Experimental Setup
The authors evaluated MergeDistill using Wikipedia data for pre-training and the XTREME benchmark for downstream tasks. Evaluation tasks included Named Entity Recognition (NER), Part-of-Speech (POS) tagging, Question Answering (QA), and Sentence Classification (XNLI, PAWS-X).
Key Results and Insights
Experimental results highlight several advantages of the MergeDistill approach:
- Performance Gains: In a monolingual-to-multilingual setup covering four Indo-European languages, the student model outperformed individual teachers by up to +2.8% in F1 score for Question Answering.
- Vocabulary Impact: Simply using the union of teacher vocabularies provided a 4.2% performance boost even before distillation, indicating that sub-optimal vocabularies are a major bottleneck for standard multilingual models.
- Data Efficiency: Distillation provides "soft labels" that contain more information per example. This allowed students to reach high performance with significantly less data—achieving a 2.9% improvement over gold-label-only training in low-data scenarios.
- Specialized Merging: Merging mBERT with MuRIL (specialized for Indian languages) resulted in a student that outperformed mBERT by an average relative score of 3.8% across tasks.
Conclusion
MergeDistill demonstrates that merging specialized models through distillation is a viable path toward creating efficient, high-performance multilingual LMs. While performance depends on teacher quality and offline storage requirements are non-trivial, the framework offers a scalable way to leverage existing specialized expertise. Future work will explore scaling to larger model sizes and investigating zero-shot transfer to languages not explicitly covered by the teacher models.
Summary updated