Abstract
Standard multilingual models utilize shared vocabularies and simple language embeddings to handle multiple languages simultaneously. However, these additive vectors often fail to capture complex cross-lingual semantics, primarily functioning as frequency filters rather than semantic guides. This paper proposes Cross-lingual Language Projection (XLP), which replaces static language vectors with language-specific projection matrices. By projecting shared word embeddings into unique semantic spaces, XLP enables the model to better capture language-specific word correlations. Our evaluation across XNLI and translation benchmarks shows that XLP consistently outperforms state-of-the-art baselines, offering faster convergence and improved performance, especially in low-resource languages.
Introduction
In multilingual Natural Language Processing (NLP), models like mBERT and XLM are designed to process dozens of languages within a single architecture. To distinguish between languages, researchers typically employ language embeddings via two common methods: Attaching (using a language-specific prefix token) or Adding (summing a fixed language vector with word embeddings).
This research argues that these additive methods are mathematically insufficient. Analysis reveals that these vectors primarily capture word frequency or "popularity" within a language (e.g., identifying common functional words like "the") rather than facilitating a deeper understanding of semantic relationships. Consequently, while the model identifies the language, it does not fundamentally alter its semantic interpretation of the tokens.
Methodology: Cross-lingual Language Projection (XLP)
To address the limitations of additive embeddings, we introduce Cross-lingual Language Projection (XLP). Instead of a simple vector addition ($w_i + l_t$), XLP applies a language-specific linear transformation matrix ($P_t$) to word embeddings before they enter the Transformer layers.
Mathematically, for a word $w_i$ in language $t$, the input is transformed as $w_i P_t$. This allows the model to "re-interpret" shared word embeddings within a unique semantic space for each language. Despite the increase in parameters, XLP is computationally efficient; for a 250M parameter model, adding XLP for 15 languages increases parameters by only 6% with negligible impact on inference speed.
Experimental Setup
The effectiveness of XLP was evaluated using several standard benchmarks:
- Pre-training: A Wikipedia corpus spanning 15 languages (~42GB of text).
- XNLI (Cross-lingual Natural Language Inference): Assessing sentence relationship understanding (entailment, contradiction, or neutral) across 15 languages.
- IWSLT 2014: Multilingual machine translation tasks involving six languages translated into English.
Analysis and Insights
The "Popularity" Trap
Visualizations of word-to-language embedding correlations in standard models show that common functional words (e.g., "the", "of") exhibit the highest correlation. This suggests that standard embeddings act more as frequency filters than semantic guides. XLP avoids this by using a matrix ($P_t$) to decouple the language signal from shared Transformer weights.
Semantic Decoupling
By utilizing a projection matrix, XLP enables the self-attention mechanism to calculate language-specific word correlations. This allows the model to adapt its internal logic to the specific nuances of each language, rather than just shifting the entire embedding space by a fixed vector.
Results
XLP demonstrated superior performance across all benchmarks:
- XNLI Accuracy: XLP achieved an average accuracy of 72.7%, surpassing XLM by 1.2% and mBERT by 6.4%.
- Low-Resource Performance: Significant gains were observed in languages like Swahili (+2.5%) and Urdu (+1.5%).
- Translation Quality: XLP improved average BLEU scores by 0.5, with a notable 1.0 BLEU increase in Turkish-to-English translation.
- Convergence Speed: XLP models converged faster, reaching lower validation loss in fewer steps than additive or attaching baselines.
Conclusion and Future Work
XLP provides a more robust framework for language encoding in multilingual models by moving beyond simple additive vectors. While effective, scaling XLP to over 100 languages may require techniques like low-rank projections to manage parameter growth. Additionally, exploring dynamic projections that adapt based on sentence context remains a promising avenue for future research.
Summary updated