Multilingual Sentence Embeddings

Machine Learning
Introduced by
Reimers, N. & Gurevych, I.; Feng, F. et al. (Google)
Year
2019–2022
Type
Cross-lingual representation learning
Family
Deep learning / NLP / CV

What does it do?

Multilingual sentence embeddings map sentences from many languages into one shared vector space, so that a sentence and its translation receive nearby vectors.

Models such as LaBSE and multilingual Sentence-BERT allow texts in different languages to be compared, retrieved, and classified with a single model, without translating them first. The LaBSE evaluation cited here reports results over 112 languages and releases a model covering 109+ languages.

The intuition behind the method

Think of placing sentences from English, Spanish, Chinese, and Arabic on one shared map, so that a sentence and its translation sit at roughly the same point. Two documents about the same topic can then be recognised as close even when they are written in different languages. One way to build such a model is knowledge distillation: a strong monolingual encoder acts as a teacher, and a multilingual student is trained to output the teacher's vector for each sentence and for its translations (Reimers and Gurevych, 2020). The student is thereby pushed to encode meaning rather than language identity.

History

Monolingual sentence embeddings came before multilingual ones. Reimers and Gurevych (2020) made monolingual sentence embeddings multilingual using knowledge distillation, training a multilingual student to reproduce the vectors of a monolingual teacher. Feng et al. (2022) introduced LaBSE, a language-agnostic BERT sentence embedding that combines masked language modelling, translation language modelling, dual-encoder translation ranking, and an additive margin softmax. Starting from a pre-trained multilingual language model reduced the required parallel data by 80%. LaBSE reports 83.7% bitext retrieval accuracy over 112 languages on Tatoeba, and a model covering 109+ languages was released.

When to use it

Choose multilingual sentence embeddings when texts in several languages must be compared in one representation, for example in cross-lingual semantic search, parallel corpus mining, or duplicate detection across languages. They are also useful when labelled data exists mainly in one language, often English, and must be applied to others; a classifier trained on the shared space can be transferred, but its accuracy in each target language needs checking. Do not use them when all texts share one language, since a monolingual sentence embedding model is usually the stronger choice there. Avoid them when you need inspectable linguistic features, or when a target language is absent from the backbone or checkpoint, because the shared space will not represent it well.

Limitations and considerations

  • Each sentence is reduced to one pooled vector, so token-level detail such as word order and which entity plays which role is largely compressed away.
  • Alignment is only as good as the parallel or distillation data; languages with little bitext tend to be aligned less tightly.
  • Coverage is tied to the backbone: languages underrepresented in pre-training are typically embedded less accurately.
  • The shared space is dense and opaque, so it is difficult to explain why two sentences receive a given similarity score.
  • The backbone is a large transformer, so inference requires substantially more memory and compute than static word-vector methods.
  • Idioms and culturally specific expressions may not map correctly across languages.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • One model and one cosine comparison serve every language pair, so no separate model is needed for each pair of languages.
  • Zero-shot transfer: a classifier trained on embeddings of one language can be applied to others, to the extent that those languages are aligned in the shared space.
  • Embeddings are computed once per sentence and stored; comparison reduces to a dot product of normalised vectors, which suits approximate nearest-neighbour search.
  • Starting from a pre-trained multilingual backbone reduces how much parallel data the alignment training requires (Feng et al., 2022).
  • Open checkpoints are available through common libraries such as Sentence-Transformers and HuggingFace.

Applications

  • Cross-lingual semantic search and retrieval over multilingual document collections.
  • Mining translation pairs from multilingual web crawls; Feng et al. (2022) used bitext mined from CommonCrawl to train neural machine translation models.
  • Zero-shot cross-lingual text classification, where a classifier is trained on labelled examples in one language and applied to others, with accuracy checked in each target language.
  • Multilingual duplicate and near-duplicate detection in social media and news monitoring.
  • Clustering of multilingual survey responses, scientific abstracts, or customer feedback to group texts by meaning.

How it works

How it works

1

A multilingual transformer, such as mBERT or XLM-R, is loaded as the starting network. It was pre-trained on multilingual text, typically with masked language modelling, so its sub-word vocabulary is shared across languages and its token representations already partly align. Feng et al. (2022) show that starting from a pre-trained multilingual language model reduces the amount of parallel training data required to reach good performance by 80%.

2

The final-layer token states are aggregated into one fixed-length vector. The formula shows mean pooling, which averages the token vectors h_1 to h_T over all non-padding tokens. This is one common choice rather than a universal standard: other models derive the sentence vector differently, for example from the output at the [CLS] token. The pooling used by a given checkpoint is stated in its model card, and embeddings produced with different pooling strategies should not be compared.

Formula
\mathbf{s} = \text{MeanPool}(\{\mathbf{h}_1, \ldots, \mathbf{h}_T\})
3

The backbone is then trained on translation pairs or parallel corpora so that a sentence and its translation are pulled together in vector space. Feng et al. (2022) use a dual-encoder translation ranking objective: within a batch of translation pairs, each sentence's embedding should score its own translation higher than the translations of the other sentences in the batch. They add an additive margin softmax, which subtracts a fixed margin from the score of the correct translation before the softmax, so that the correct pair must win by a larger gap. These objectives are combined with masked and translation language modelling. Knowledge distillation from a monolingual teacher, as in Reimers and Gurevych (2020), is an alternative route to the same alignment: the multilingual student is trained to reproduce the teacher's embedding for each sentence and for its translations.

4

At inference, the cosine of the angle between two sentence vectors, as given in the formula, measures their similarity. Values near 1.0 indicate vectors pointing in nearly the same direction, which is what translation pairs should produce. Cosine can be negative, and the score that separates related from unrelated pairs is model-specific, so it should be calibrated on held-out data for the language pairs of interest.

Formula
\text{sim}(\mathbf{s}_i, \mathbf{s}_j) = \frac{\mathbf{s}_i \cdot \mathbf{s}_j}{\|\mathbf{s}_i\|\|\mathbf{s}_j\|}

Common pitfalls

  • Choosing a pre-trained model that does not cover your target language; always verify language coverage in the model card.
  • Comparing embeddings from different models or different pooling strategies, which are not compatible even if both are multilingual.
  • Reusing a cosine threshold set on one language pair or domain; thresholds generally do not transfer and should be calibrated per language pair on held-out data.
  • Ignoring the quality of the underlying parallel training data; noisy bitext produces poorly aligned embeddings.
  • Using sentence embeddings for token-level tasks such as NER or POS tagging, where token representations are more appropriate.
  • Reporting only averaged or English-only scores, which can hide weak performance in individual languages; report results per language.

Frequently asked questions

Which multilingual sentence embedding model should I start with?

LaBSE (Feng et al., 2022) is released for 109+ languages and reports 83.7% bitext retrieval accuracy over 112 languages on Tatoeba. Check the language coverage stated in the model card against your own language list, and run a small evaluation on your own data before committing to a model.

How do multilingual embeddings compare to simply translating everything to English first?

There is no universal answer, so the comparison should be made empirically. Translating to English first lets you use strong English-only models, but it adds translation cost and latency and can lose nuance. Multilingual embeddings avoid the translation step, but they may score lower on language pairs where machine translation is very accurate. Test both approaches on a sample of your own language pairs.

Can I fine-tune a multilingual embedding model on my own domain?

Yes. Fine-tuning with domain-specific parallel or paraphrase data — using contrastive or triplet loss — can substantially improve performance on specialized corpora such as legal, medical, or scientific text.

What evaluation metrics should I use?

For retrieval tasks, use Mean Reciprocal Rank (MRR) or Mean Average Precision (MAP). For classification, use accuracy and macro F1. For similarity tasks, use Pearson/Spearman correlation with human judgments. Always evaluate per-language and on an aggregated cross-lingual benchmark to catch disparities.

Are multilingual sentence embeddings suitable for very low-resource languages?

Coverage varies by model. LaBSE and mBERT cover many languages, including some low-resource ones, but embedding quality tends to be lower for languages with sparse training data. Check language-specific benchmark results before committing to a model for a low-resource language.

Related methods

Sources

  1. Reimers, N. & Gurevych, I. (2020). Making Monolingual Sentence Embeddings Multilingual using Knowledge Distillation. Proceedings of EMNLP 2020, 4512–4525.

    Open publication reference
  2. Feng, F., Yang, Y., Cer, D., Arivazhagan, N. & Wang, W. (2022). Language-agnostic BERT Sentence Embedding. Proceedings of ACL 2022, 878–891.

    Open DOI reference