How Language-Neutral is Multilingual BERT?

Jindrich Libovický, Rudolf Rosa, Alexander FraserarXiv 2019

Abstract

Multilingual BERT (mBERT) is a cornerstone of modern cross-lingual NLP, yet its internal representations are often criticized for being language-specific. This paper investigates whether mBERT's vector space can be decomposed into a language-neutral semantic component and a language-specific coordinate shift. Through a series of probing tasks, the authors demonstrate that language identity is largely encoded as a simple centroid shift. By applying centering or linear projections, mBERT's performance on tasks like sentence retrieval and word alignment can be significantly improved, though challenges remain for more nuanced semantic tasks.

Introduction: The Quest for Universal Representation

Multilingual BERT (mBERT) is a powerful tool for cross-lingual NLP, trained on 104 languages simultaneously. This has led to the hope that it creates a "universal" representation where the same concept occupies the same mathematical space regardless of the language used. However, researchers have observed that mBERT often exhibits language-specific biases that hinder zero-shot transfer—the ability to apply a model trained on one language (like English) directly to another (like Hindi) without additional training.

This research investigates a fundamental question: Can we separate mBERT’s representations into a "language-specific" component and a "language-neutral" semantic component? By dissecting mBERT's internal logic, the authors explore how much "meaning" is shared across languages versus how much is tied to specific linguistic features like vocabulary and grammar.

Methodology: Dissecting the Vector Space

The researchers employed a "probing" approach to analyze mBERT's representations using several clever techniques:

  1. Centering: Hypothesizing that language identity is a constant "shift" in high-dimensional space, they calculated the average vector (centroid) for all sentences in a given language and subtracted it from individual embeddings.
  2. Probing Tasks: They evaluated raw and centered representations on five tasks: Language Identification, Language Similarity (clustering), Parallel Sentence Retrieval, Word Alignment, and Machine Translation Quality Estimation (QE).
  3. Fine-tuning Variants: Standard mBERT was compared against UDify (fine-tuned for universal syntax) and a custom lng-free model, which used adversarial training to actively "hide" language identity from the model.

The study utilized diverse datasets, including Wikipedia for language identification, WMT14 for sentence retrieval across six languages, and gold-standard manual word alignment sets for English paired with various European languages.

Key Insights: mBERT as a Computational Linguist

One of the most striking discoveries is that language identity in mBERT behaves like a simple geometric translation. By subtracting the "average" language vector, one can strip away a massive amount of language-specific information without losing the underlying semantic meaning. This suggests that the model's internal space is structured with parallel semantic manifolds for different languages.

Furthermore, mBERT's internal "centroids" naturally cluster into well-known language families, such as Germanic, Slavic, and Romance. Even without explicit linguistic supervision during pre-training, the model "knows" that Spanish is more similar to Italian than it is to Chinese, purely based on the statistical patterns it learned.

Visualization of language centroids clustering into linguistic families.

Key Results: Improving Cross-Lingual Transfer

The experiments yielded several significant findings regarding the neutrality of mBERT's representations:

  • Language Identification: Centering the representations caused the accuracy of a language classifier to plummet from ~92% to ~28% for mean-pooled embeddings, proving that the centroid is indeed where the "language identity" lives.
  • Sentence Retrieval: Centering improved retrieval accuracy across 30 language pairs. However, a learned linear projection—fitting a small amount of parallel data—was even more effective, achieving near-perfect 98.3% accuracy in later layers.
  • Word Alignment: mBERT proved exceptionally good at word alignment, achieving F1 scores (e.g., .738 for English-Czech) that outperformed specialized tools like FastAlign (.692). This suggests that while sentence-level representations are shifted, the relative relationships between words remain highly consistent across languages.
Retrieval accuracy across layers for plain, centered, and projected representations.

Conclusion and Future Directions

While centering and linear projections make mBERT more "neutral," the resulting representations remain somewhat "coarse." They are highly effective for finding matching sentences (retrieval) but lack the precision required for tasks like Quality Estimation, which requires detecting subtle semantic nuances that simple linear shifts cannot yet capture.

The authors also found that the "lng-free" adversarial model, while successful at hiding language identity from classifiers, did not actually improve semantic transfer for complex tasks. This suggests that "hiding" the language is not the same as "aligning" the meaning. Future work must move beyond simple linear shifts to align the fine-grained semantic "texture" of different languages, potentially through more sophisticated fine-tuning objectives that transcend standard Masked Language Modeling.

Summary updated

BibTeX
@misc{libovicky2019how,
  author = {Jindrich Libovický and Rudolf Rosa and Alexander Fraser},
  title = {{How Language-Neutral is Multilingual BERT?}},
  year = {2019},
  eprint = {1911.03310},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.03310},
}
Figure