On the Language Neutrality of Pre-trained Multilingual Representations

Jindrich Libovický, Rudolf Rosa, Alexander Fraser

Abstract

Multilingual models like mBERT and XLM-RoBERTa are celebrated for their "zero-shot" cross-lingual abilities, yet they are not as language-neutral as often assumed. This research demonstrates that these models retain a strong "language identity" signal, keeping different languages in separate regions of the vector space. We show that this signal can be largely stripped away using a simple, unsupervised "centering" technique—subtracting the average language vector—which significantly boosts performance on tasks like sentence retrieval and word alignment.

What Problem Does This Paper Address?

In Natural Language Processing (NLP), we frequently employ models trained on over a hundred languages simultaneously, hoping they learn "universal" representations. Ideally, the concept of a "dog" in English should reside in the same vector space as "perro" in Spanish.

However, evaluating this "language neutrality" is difficult. Most researchers rely on "zero-shot transfer" (e.g., training on English and testing on Hindi), but this can be misleading as the model might simply overfit to English-specific features. This paper measures language neutrality directly by comparing raw embeddings across languages without additional training. The authors found that instead of aligning naturally, models tend to keep languages in separate "neighborhoods" of the vector space, often clustered by language family.

Visualization of language clusters in the embedding space, showing distinct groupings by language family.

Methods

The study investigated several pre-trained models, including mBERT, XLM-RoBERTa (XLM-R), and DistilmBERT. To enhance language neutrality, the authors proposed and tested three main approaches:

  1. Representation Centering (Unsupervised): This method assumes a sentence vector is composed of Meaning + Language Identity. By calculating the average vector (the "centroid") for thousands of sentences in a specific language and subtracting it from individual vectors, the authors aimed to "zero out" the language-specific offset.
  2. Explicit Projection (Supervised): Using a small amount of parallel data, they trained a linear transformation to map vectors from various languages directly into the "English space."
  3. Adversarial Training (lng-free): They fine-tuned mBERT with a "gradient reversal layer" to penalize the model if a classifier could identify the input language.

Evaluation was conducted using probing tasks that require no additional training, specifically Cross-lingual Sentence Retrieval and Word Alignment.

Key Insights and Results

The research yielded several critical findings regarding the internal structure of multilingual representations:

  • The "Language Offset" is Real: Language identity acts as a constant "shift" in the vector space. Simply subtracting the mean vector (centering) makes representations much more neutral and improves cross-lingual performance.
  • Layer 8 is the Sweet Spot: For both mBERT and XLM-R, the middle-to-upper layers (specifically the 8th layer) provide the best semantic representations for cross-lingual tasks. The final layers often become too specialized for the pre-training objective (e.g., masked language modeling).
  • Language ID is "Too Easy": Models retain so much language-specific information that a simple linear classifier can identify the language of a sentence with approximately 96% accuracy.
Retrieval accuracy across layers for mBERT and XLM-R, demonstrating the significant boost from centering and the peak performance around layer 8.

Quantitatively, centering improved mBERT’s retrieval accuracy from 77.6% to 83.8%. XLM-R performed even better, reaching 88.3% in its raw state and 92.3% after centering. Furthermore, the authors developed a simple word alignment algorithm using these embeddings that matches the performance of state-of-the-art statistical aligners without requiring any parallel training data.

Limitations and Future Work

A primary limitation of the "centering" method is its reliance on knowing the input language beforehand to subtract the correct centroid (an "oracle" setup). While effective for processing known corpora, it does not inherently make the model language-agnostic by design.

Interestingly, the authors found that adversarial training was surprisingly ineffective compared to simple geometric centering. Future research may focus on integrating this centering property directly into the pre-training process to develop models that are natively language-neutral.

Summary updated

BibTeX
@inproceedings{libovicky2020language,
  author = {Jindrich Libovický and Rudolf Rosa and Alexander Fraser},
  title = {{On the Language Neutrality of Pre-trained Multilingual Representations}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.findings-emnlp.150},
}
Figure