Skip to content
datarekha

Multilingual NLP

Most NLP research is English, but there are thousands of languages. The key idea is a shared multilingual embedding space where translations land near each other — which lets a model trained on a high-resource language transfer to a low-resource one with no labelled data. The promise, and the disparities that remain.

Written and reviewed by Last reviewed

7 min read Intermediate NLP & Transformers Lesson 11 of 44

What you'll learn

  • The shared multilingual embedding space and why translations cluster
  • Cross-lingual transfer — train high-resource, apply low-resource
  • mBERT and XLM-R, and the challenges of low-resource languages
  • The tokenizer tax and the curse of multilinguality

Before you start

Almost everything in this course is implicitly about English — but there are roughly 7,000 languages, most with a tiny fraction of English’s labelled data. Multilingual NLP asks: can one model serve many languages, and — crucially — can we transfer (reuse) what we learn from a high-resource language to a low-resource one? The enabling idea is a shared embedding space.

A shared space where translations meet

Train embeddings (lists of numbers that represent each word) so that words meaning the same thing in different languages land in the same region of the vector space. Then “dog,” “chien,” and “perro” are neighbors — and a model that learned to do something with the English vectors works on the others, because they’re in the same place:

import numpy as np

emb = {"dog": [1.0, 0.1], "chien": [0.9, 0.2], "perro": [1.0, 0.0],     # 'dog' across languages
       "cat": [0.1, 1.0], "chat":  [0.2, 0.9], "gato":  [0.0, 1.0]}     # 'cat' across languages

def cos(a, b):
    a, b = np.array(a), np.array(b)
    return a @ b / (np.linalg.norm(a) * np.linalg.norm(b))

q = "dog"
for w in sorted((w for w in emb if w != q), key=lambda w: cos(emb[q], emb[w]), reverse=True)[:3]:
    print(f"nearest to 'dog': {w:<6} cos={cos(emb[q], emb[w]):.2f}")
nearest to 'dog': perro  cos=1.00
nearest to 'dog': chien  cos=0.99
nearest to 'dog': chat   cos=0.31

The nearest neighbors of dog are its translations perro and chien — not the (English) word cat. That alignment is the whole trick: meaning, not language, decides position.

One shared space — words cluster by meaning, not language”dog” clusterdogchienperro”cat” clustercatchatgatoa model trained on the English points transfers to the others — they’re in the same place
Aligned multilingual embeddings group translations together, so learning on one language carries to the rest.

Cross-lingual transfer

This is what makes zero-shot cross-lingual transfer possible. Fine-tune a multilingual model on an English task with English labels (say, named-entity recognition), then run it on Swahili or Hindi text it was never trained on — and it often works, because the multilingual encoder (the part of the model that turns text into vectors) maps both languages into the shared space. The workhorses are mBERT (multilingual BERT, pretrained on 104 languages’ Wikipedia) and XLM-R (trained on 100 languages of web text), which learn this aligned space from raw multilingual text without parallel translations.

In one breath

  • Multilingual NLP serves many of the world’s ~7,000 languages and aims to transfer from high-resource (English) to low-resource ones.
  • The key idea is a shared embedding space where translations cluster (dog/chien/perro are neighbors) — position encodes meaning, not language.
  • That enables zero-shot cross-lingual transfer: fine-tune on an English task, then apply to a language with no labelled data, via models like mBERT and XLM-R (100+ languages from raw text).
  • Disparities persist: the tokenizer tax (low-resource languages split into many more subword tokens) and the curse of multilinguality (fixed capacity dilutes per-language quality).
  • LLMs are multilingual by default but English-skewed; the shared-space idea explains both the reach and the inequity.

Quick check

Quick check

0/5
Q1What is the central idea that makes multilingual NLP work?
Q2What is zero-shot cross-lingual transfer?
Q3What is the 'tokenizer tax' for low-resource languages?
Q4What is the curse of multilinguality?
Q5Your bot reads Tamil customer emails, but the same-length email costs about 3x more tokens than English and often gets cut off. Which fix addresses the root cause?

Next

The shared space builds on word embeddings and subword units; the multilingual encoders are BERT-family models (mBERT, XLM-R). Modern LLMs inherit both the reach and the English skew.

Sign in to track your progress

Completed lessons, your XP, level, and streak save to your account — it's free and takes a few seconds.

Practice this in an interview

All questions
How do multimodal vision-language models combine images and text, and what role does CLIP play?

A multimodal vision-language model turns image regions into visual tokens, maps them into the language model's hidden representation, and combines them with text through attention. CLIP is a contrastively trained dual encoder that aligns image and text embeddings; it can provide a vision backbone or support retrieval and zero-shot classification, but it is not by itself a generative visual question-answering model.

Why do dense word embeddings outperform one-hot vectors?

Dense embeddings usually outperform one-hot vectors because they represent words with learned, low-dimensional relationships rather than isolated IDs, allowing models to share statistical strength between similar words. The advantage is not automatic: one-hot can be preferable for small vocabularies, exact-identity tasks, or when embeddings are poorly trained or mismatched to the domain.

What are embeddings and why are they central to modern deep learning?

An embedding is a dense, learned vector representation of a discrete or high-dimensional object — a word, image, user, product — in a continuous low-dimensional space. Proximity in embedding space reflects semantic or behavioural similarity, making embeddings a universal interface between raw data and neural networks.

How does tokenization work, and why do LLMs rely on subword tokenizers like BPE?

Tokenization converts text into model-specific integer IDs, which are mapped to vectors before the transformer processes them. Subword methods such as Byte-Pair Encoding balance vocabulary size and sequence length: common fragments become single tokens, while rare or new strings can still be represented as smaller known pieces.

Related lessons

Explore further