Abstract
We propose a simple method to align multilingual contextual embeddings as a post-pretraining step for improved zero-shot cross-lingual transferability of the pretrained models. Using parallel data, our method aligns embeddings on the word level through the recently proposed Translation Language Modeling objective as well as on the sentence level via contrastive learning and random input shuffling. We also perform sentence-level code-switching with English when finetuning on downstream tasks. On XNLI, our best model (initialized from mBERT) improves over mBERT by 4.7% in the zero-shot setting and achieves comparable result to XLM for translate-train while using less than 18% of the same parallel data and 31% less model parameters. On MLQA, our model outperforms XLM-R_Base that has 57% more parameters than ours.
Introduction
Multilingual pretrained models, such as mBERT and XLM-R, have demonstrated remarkable "zero-shot" transfer capabilities, where a model trained on one language (e.g., English) can perform tasks in another (e.g., Spanish). However, these models often lack a unified representation space because they are primarily trained on separate monolingual corpora. Current alignment strategies typically involve expensive training from scratch using Translation Language Modeling (TLM) or noisy post-hoc word-level mapping using statistical tools. This paper introduces Post-Pretraining Alignment (PPA), a simple, self-supervised approach to refine existing embeddings into a better-aligned cross-lingual space without requiring massive compute or external alignment tools.
Methodology: Post-Pretraining Alignment (PPA)
The PPA framework treats alignment as a multi-task learning problem, combining word-level and sentence-level objectives to nudge pretrained embeddings into a shared space.
Word-Level Alignment (Modified TLM)
The model uses a variation of Translation Language Modeling where parallel sentences are concatenated. Tokens are randomly masked, and the model must predict them using context from both languages. To force a deeper semantic reliance, the authors omit language embeddings and do not reset position IDs, unlike standard TLM implementations.
Sentence-Level Alignment (MoCo)
To align global sentence representations, the authors employ Momentum Contrast (MoCo). A sentence and its translation are treated as a "positive pair," while a large queue of unrelated sentences serves as "negative pairs." This contrastive objective pushes the [CLS] token representations of semantically equivalent sentences closer together in vector space.
Additional Techniques
- Random Input Shuffling: The order of language pairs is shuffled during training to prevent the model from learning positional biases (e.g., English always appearing first).
- Code-Switching Finetuning: During task-specific finetuning, the model is exposed to inputs that mix English and target-language words, providing a final alignment signal.
Experimental Results
The authors evaluated PPA on the XNLI (Cross-lingual Natural Language Inference) and MLQA (Multilingual Question Answering) benchmarks using parallel data from Europarl, MultiUN, IITB, and EUbookshop.
Performance and Efficiency
On XNLI, the PPA-enhanced mBERT model improved zero-shot accuracy by 4.7% over the baseline mBERT. Notably, the model achieved results comparable to the much larger XLM model while using less than 18% of the parallel data and 31% fewer parameters. On MLQA, the model outperformed XLM-R_Base, despite the latter having 57% more parameters.
Key Insights
- Complementary Objectives: Word-level (TLM) and sentence-level (MoCo) alignment are synergistic; TLM aids fine-grained translation, while MoCo captures high-level semantic equivalence.
- Data Efficiency: Performance gains plateaued around 600k parallel pairs per language, suggesting that massive datasets are not strictly necessary for effective alignment.
- Regularization Effect: Aligning other languages to English actually improved performance on English-only tasks, suggesting that cross-lingual signals serve as a robust semantic regularizer.
Conclusion and Future Work
PPA provides a parameter-efficient and computationally accessible method for improving multilingual models. While highly effective, the performance in target languages remains bounded by the model's proficiency in the source language (English). Future research may focus on improving initial monolingual pretraining quality and scaling this alignment method across the entire "long tail" of low-resource languages supported by mBERT.
Summary updated