Language Representation in Multilingual BERT and its applications to improve Cross-lingual Generalization

Chi-Liang Liu, Tsung-Yuan Hsu, Yung-Sung Chuang, Chung-Yi Li, Hung-yi LeearXiv 2020

Multilingual BERT (m-BERT) has demonstrated a remarkable ability for "zero-shot" cross-lingual transfer, yet the internal mechanisms by which it organizes different languages remain a subject of active research. This paper explores the hypothesis that language-specific information is encoded as a simple linear vector offset within m-BERT's embedding space. By isolating and shifting these offsets, we can perform unsupervised token translation and significantly improve the model's cross-lingual generalization.

The Language Mean Hypothesis

The core of this approach is the Language Mean ($R^l_L$): the average of all token embeddings for a language $L$ at a specific layer $l$. The researchers discovered that the "essence" of a language—the features that distinguish English from Chinese or French—is largely captured by this mean vector.

To manipulate these representations, two primary techniques are introduced:

  1. Zero-mean: Embeddings are made language-agnostic by subtracting the language mean from every token embedding, moving them into a shared, neutral space.
  2. Mean Difference Shift (MDS): Tokens are transformed from a source language ($L1$) to a target language ($L2$) using the formula: $$\tilde{h} = h + \alpha(R^l_{L2} - R^l_{L1})$$ Here, $\alpha$ is a hyperparameter controlling the strength of the shift. This method is entirely unsupervised, requiring only raw text to calculate the means rather than parallel corpora.

Key Insights: Language as a Vector Offset

The most striking finding is that language information is not entangled in a complex, non-linear fashion but exists as a identifiable axis in high-dimensional space. Increasing the shift factor $\alpha$ consistently pushes tokens toward the target language.

Experiments show that this "language-ness" is most distinct in the later layers of m-BERT (layers 10-12). These layers appear more specialized in disentangling language identity from semantic meaning, allowing for more effective shifts.

BLEU-1 scores for English-to-Greek (en-el) translation, illustrating how performance peaks at specific shift strengths (alpha) and is highly sensitive to the model layer.

Experimental Results

Unsupervised Token Translation

While MDS is not a full-fledged translation system, it achieves significant success at the token level. For English-to-Chinese translation, it reached a BLEU-1 score of 21.51 at $\alpha=2$. At higher shift strengths ($\alpha=3$), the "conversion rate"—the percentage of tokens successfully switched to the target language's vocabulary—reached nearly 100% for many language pairs in the final layers.

Sentence Retrieval and Zero-Shot Transfer

The utility of MDS and Zero-mean extends to downstream tasks. On the BUCC2018 sentence retrieval benchmark, MDS-shifted embeddings consistently outperformed original m-BERT embeddings. For instance, on the English-German development set, MDS improved accuracy from 75.62 to 76.91.

Comparison of sentence retrieval performance across various languages. MDS and Zero-mean methods consistently match or exceed the original m-BERT performance, particularly in languages like German (de) and French (fr).

In zero-shot transfer tasks like Part-of-Speech (POS) tagging, both techniques improved average performance across 13 languages. For dependency parsing, the Zero-mean approach was particularly effective, raising the average Labeled Attachment Score (LAS) from 50.8 to 51.2.

Conclusion and Future Work

The discovery that language identity is represented as a simple vector offset provides a powerful tool for cross-lingual alignment. While MDS excels at lexical manipulation, it does not yet address structural linguistic factors like word order, which remain a challenge for complex reasoning tasks. Future work will investigate how these linear representations can be further leveraged to improve grammatical fluency and structural transfer in low-resource settings.

Summary updated

BibTeX
@misc{liu2020language,
  author = {Chi-Liang Liu and Tsung-Yuan Hsu and Yung-Sung Chuang and Chung-Yi Li and Hung-yi Lee},
  title = {{Language Representation in Multilingual BERT and its applications to improve Cross-lingual Generalization}},
  year = {2020},
  eprint = {2010.10041},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.10041},
}
Figure