Abstract
The multilingual pre-trained language models (e.g, mBERT, XLM and XLM-R) have shown impressive performance on cross-lingual natural language understanding tasks. However, these models are computationally intensive and difficult to be deployed on resource-restricted devices. In this paper, we propose a simple yet effective distillation method (LightMBERT) for transferring the cross-lingual generalization ability of the multilingual BERT to a small student model. The experiment results empirically demonstrate the efficiency and effectiveness of LightMBERT, which is significantly better than the baselines and performs comparable to the teacher mBERT.
Introduction
Multilingual Pre-trained Language Models (mPLMs) like mBERT and XLM-R are the cornerstones of modern cross-lingual NLP, enabling models to be trained in one language (e.g., English) and perform effectively in others (e.g., Arabic or Urdu) without additional training. However, these models are massive and computationally expensive, making them difficult to deploy on resource-constrained edge devices like smartphones.
While Knowledge Distillation (KD) has successfully compressed English-only models, multilingual distillation is more complex. It requires preserving the delicate alignment between different languages in the vector space while maintaining training efficiency. LightMBERT addresses these challenges with a streamlined approach that focuses on the most critical components of the teacher model.
Methodology
LightMBERT employs a three-stage approach to transfer knowledge from a large teacher (mBERT) to a compact student model:
- Smart Initialization: Instead of random initialization, the student model is initialized using the bottom layers of the teacher. Research suggests these layers capture the fundamental linguistic structures and cross-lingual alignments essential for the student to inherit.
- Freezing Embeddings: The embedding layer is frozen during the distillation process. Since these embeddings are already aligned across languages in the teacher model, freezing them prevents the student from losing multilingual consistency.
- Top-layer Distillation: Unlike methods that attempt to match every layer, LightMBERT distills only the top transformer layer. The student’s final layer is trained to mimic the teacher’s final attention patterns and hidden states using Mean Squared Error (MSE) loss on a large, unsupervised multilingual Wikipedia corpus.
Experimental Results
The researchers evaluated a 6-layer LightMBERT student against the 12-layer mBERT teacher and several popular baselines using the XNLI (Cross-lingual Natural Language Inference) benchmark. This dataset tests "zero-shot" abilities by fine-tuning on English and testing on 15 other languages.
As shown in the table below, LightMBERT achieved an average score of 70.3%, nearly matching the teacher's 70.5%. It significantly outperformed existing baselines such as DistilmBERT (65.2%) and TinyMBERT (68.2%).
Key Insights
- The "Bottom-Heavy" Advantage: The authors found that the bottom layers of mBERT contain the most critical information for cross-lingual transfer. A baseline that simply pruned the top layers (
mBERT_drop) actually performed better than some complex distillation methods. - Efficiency Gains: By freezing embeddings and simplifying the distillation objective to the top layer, the training process becomes significantly more efficient while maintaining high accuracy. Ablation studies showed that freezing embeddings provided a +0.6% performance boost.
Conclusion and Future Work
LightMBERT demonstrates that a simple distillation recipe—bottom-layer initialization and top-layer distillation—can effectively compress massive multilingual models without sacrificing cross-lingual generalization. While results on XNLI are promising, future work is needed to evaluate the method on token-level tasks like Named Entity Recognition (NER) and more complex tasks like Question Answering (QA). Additionally, testing whether this approach scales to even larger architectures like XLM-R remains a key area for exploration.
Summary updated