It's not Greek to mBERT: Inducing Word-Level Translations from Multilingual BERT

Hila Gonen, Shauli Ravfogel, Yanai Elazar, Yoav Goldberg

Abstract

Multilingual BERT (mBERT) exhibits remarkable zero-shot cross-lingual capabilities despite being trained solely on monolingual corpora. This study investigates whether mBERT implicitly learns word-level translations and how this information is structured within its representation space. By employing template-based prompting and representation dissection techniques like Iterative Null-space Projection (INLP), we demonstrate that mBERT effectively disentangles lexical semantics from language identity. Our findings reveal that accurate translations can be extracted without parallel data or fine-tuning, suggesting that mBERT's internal space is naturally organized to support cross-lingual transfer through a shared semantic manifold.

Introduction

The success of Multilingual BERT (mBERT) in zero-shot cross-lingual transfer—where a model trained on English performs well on distant languages like Hindi—has sparked significant interest in its internal mechanics. A central question is whether mBERT explicitly stores word-level translations and how it retrieves them. This paper addresses these questions by probing the model's ability to translate words using simple prompts and by analyzing the geometric structure of its embeddings. The authors hypothesize that mBERT represents "meaning" and "language" as somewhat independent, orthogonal features, allowing for the induction of translations through both non-linear prompting and linear vector arithmetic.

Methodology

The researchers introduce three primary training-free methods to extract and analyze translation knowledge:

  1. Template-Based Translation: mBERT is treated as a zero-shot knowledge base. By feeding it a simple English prompt such as "The word 'SOURCE' in LANGUAGE is: [MASK]", the model's top prediction for the [MASK] token is evaluated as a translation. This method leverages the model's pre-trained Masked Language Modeling (MLM) head.
  2. Iterative Null-space Projection (INLP): To test the entanglement of language and semantics, the authors use INLP to decompose representations. This algorithm iteratively identifies and removes linear features used to predict language identity. By projecting embeddings into the "null-space" of a language classifier, they create language-neutral representations.
  3. Analogies-Based Translation: Inspired by word2vec, translations are induced via linear shifts: target_word ≈ source_word - source_lang_centroid + target_lang_centroid. This tests if translation is a simple linear transformation in the embedding space.

Representation Structure and Language Clustering

A significant finding is that language identity is encoded as a distinct linear subspace within mBERT. The model's internal organization varies across layers: lower layers tend to cluster languages based on surface features like script or typological similarity, whereas higher layers achieve a much cleaner separation of language identities.

t-SNE visualization of mBERT language clusters showing clear separation in the representation space.

This structural separation allows for the isolation of "meaning" from "language." When the language-specific component is mathematically removed using INLP, the model's MLM head often shifts its predictions from the source language to valid translations or synonyms in other languages. This confirms that the underlying semantic representation is shared across the multilingual manifold.

Experimental Results

The extraction methods were evaluated using the NorthEuraLex database (1016 words across 107 languages) and contextualized representations from the TED talk corpus.

Translation Accuracy

The template-based method proved surprisingly effective, achieving 44.9% accuracy@1 and 70.3% accuracy@10. This approach outperformed a standard nearest-neighbor embedding search in over 91% of cases, indicating that the MLM head captures complex, non-linear translation mappings that simple vector distance misses. The analogy-based method, while less accurate (10.5% acc@1), still demonstrated that a significant portion of translation data is linearly recoverable.

Language Identification

The model also demonstrates an exceptional ability to identify languages based on word pairs. When the template is reversed to mask the language name ("The word 'dog' in [MASK] is: perro"), mBERT identifies the correct language with high precision.

Confusion matrix for language identification, demonstrating mBERT's high precision in distinguishing between diverse languages.

As shown in the confusion matrix, the model rarely confuses distinct languages, with accuracy reaching 98.6% for Greek and 94.3% for Russian.

Discussion and Conclusion

The ability of mBERT to perform word-level translation without explicit parallel training highlights the emergent properties of large-scale monolingual pre-training. The model naturally learns to align semantic concepts across different linguistic contexts into a shared space. While the template-based method is the most successful, its non-linear nature remains difficult to interpret fully. Conversely, the analogies-based method provides a more mathematically transparent view of the representation space but captures less of the model's total knowledge. Future work should investigate the specific pre-training dynamics that allow these translation capabilities to emerge and explore how this "hidden" knowledge can be better utilized for low-resource NLP.

Summary updated

BibTeX
@inproceedings{gonen2020it,
  author = {Hila Gonen and Shauli Ravfogel and Yanai Elazar and Yoav Goldberg},
  title = {{It's not Greek to mBERT: Inducing Word-Level Translations from Multilingual BERT}},
  booktitle = {BlackboxNLP @ EMNLP},
  year = {2020},
  doi = {10.18653/v1/2020.blackboxnlp-1.5},
}
Figure