On the Language Neutrality of Pre-trained Multilingual Representations

Jindrich Libovický, Rudolf Rosa, Alexander Fraser

Abstract

Multilingual contextual embeddings, such as multilingual BERT and XLM-RoBERTa, have proved useful for many multi-lingual tasks. Previous work probed the cross-linguality of the representations indirectly using zero-shot transfer learning on morphological and syntactic tasks. We instead investigate the language-neutrality of multilingual contextual embeddings directly and with respect to lexical semantics. Our results show that contextual embeddings are more language-neutral and, in general, more informative than aligned static word-type embeddings, which are explicitly trained for language neutrality. Contextual embeddings are still only moderately language-neutral by default, so we propose two simple methods for achieving stronger language neutrality: first, by unsupervised centering of the representation for each language and second, by fitting an explicit projection on small parallel data. Besides, we show how to reach state-of-the-art accuracy on language identification and match the performance of statistical methods for word alignment of parallel sentences without using parallel data.

Introduction

The standard evaluation for multilingual models like mBERT often relies on zero-shot transfer: training a classifier on English and testing it on another language. However, this method is flawed; a failure might stem from the classifier overfitting to English-specific features rather than a lack of cross-lingual alignment in the underlying embeddings. This paper addresses this by directly evaluating the language neutrality of representations—measuring how closely translations are mapped in the semantic space and whether language-specific signals can be mathematically isolated and removed.

The Persistence of Language Identity

Despite their cross-lingual utility, vanilla multilingual contextual embeddings encode a significant amount of language-specific information. This "language identity" is so pervasive that raw mBERT embeddings can identify a sentence's language with 96% accuracy. This is likely an artifact of pre-training objectives like Next Sentence Prediction (NSP), where language consistency is a massive clue for sentence relationship.

Visualization of language clusters in the embedding space, demonstrating strong inherent language identity across families.

As shown in the visualization above, languages naturally cluster by family (e.g., Romance, Slavic, Germanic) within the embedding space. While this structure is useful for some tasks, it indicates that the models do not inherently map different languages into a perfectly shared, neutral semantic space.

Methods for Neutralization

To enhance language neutrality, we propose two primary interventions:

  1. Representation Centering (Unsupervised): We hypothesize that a sentence vector is the sum of its semantic meaning and a language-specific identifier. By calculating the "centroid" (mean vector) of a language and subtracting it from the embeddings, we center the language at the origin, effectively stripping away the language ID.
  2. Explicit Projection (Supervised): Using a small set of parallel sentences, we learn a simple linear projection to map one language's space directly onto another.

Retrieval and Alignment Performance

The impact of these techniques is most evident in cross-lingual retrieval and word alignment. Surprisingly, vanilla mBERT captures cross-lingual semantic similarity better than static word embeddings (like FastText) that were explicitly trained for neutrality using bilingual dictionaries.

Retrieval accuracy across layers for mBERT and XLM-R, comparing raw, centered, and projected representations.

As illustrated in the figure above, centering significantly boosts retrieval accuracy, particularly in the middle and upper layers. For XLM-R, centering improves accuracy from 88.3% to 92.3%, while supervised projection pushes performance to near-perfect levels (98-99%).

Furthermore, we applied these centered embeddings to Word Alignment (WA) using a training-free bipartite graph matching algorithm. This approach matched or exceeded state-of-the-art statistical aligners like FastAlign and Efmaral. For example, on English-German alignment, mBERT achieved a .767 F1 score compared to FastAlign's .741, despite the latter requiring massive parallel corpora.

Conclusion

Contextual embeddings are more language-neutral than previously assumed, yet they retain a strong language-specific signal. Simple post-hoc transformations like centering can drastically improve their cross-lingual semantic alignment. While centering currently acts as an "oracle" experiment—requiring knowledge of the input language—it demonstrates that language identity can be effectively separated from semantic content, paving the way for more inherently neutral pre-training objectives.

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