Notes

XLM-RoBERTa (XLM-R)

Train one encoder on a hundred languages at once and something slightly surprising happens: fine-tune it on English labelled data and it works in Swahili. XLM-R is the model that made that transfer reliable enough to build on.

What it is
XLM-R applies RoBERTa's recipe at multilingual scale: an encoder-only transformer pre-trained with masked language modelling alone — no next-sentence prediction, no translation pairs, no language-identity signal — over roughly 2.5 terabytes of filtered CommonCrawl text covering 100 languages. A single 250,000-piece SentencePiece vocabulary serves all of them, and that shared subword space is what lets representations line up across scripts without any parallel text. Facebook AI released base and large sizes in 2019; both load from Hugging Face Transformers as xlm-roberta-base and xlm-roberta-large.

Why it became the default multilingual encoder
It beat mBERT decisively on cross-lingual benchmarks such as XNLI and multilingual NER, and the margin is widest for the low-resource languages mBERT's smaller corpus barely covered. The pattern that follows is zero-shot cross-lingual transfer: fine-tune on the one language where annotations exist and serve all the others, which is frequently the only option for classification or entity recognition in a language with no labelled data. Two caveats ride along. High-resource languages pay a small price for sharing capacity — the curse of multilinguality, which more parameters relieves — and per-language quality is uneven, tracking how much of that language survived the crawl filter, so a dedicated monolingual encoder still wins where one exists.

XLM-R is an encoder-only transformer that applies RoBERTa's pre-training recipe — masked language modelling alone, no next-sentence prediction — to 2.5TB of filtered CommonCrawl text in 100 languages, sharing one 250,000-piece subword vocabulary. That shared space aligns representations across languages without parallel data, enabling zero-shot cross-lingual transfer: fine-tune on one language, serve many. It outperforms mBERT, most clearly on low-resource languages.

Imagine somebody who has read enormous amounts in a hundred languages, never with a translation sitting alongside, and has simply absorbed how each one works. Teach that person to spot angry customer emails using English examples, and they can spot them in Hindi too.

XLM-R is software built that way. It learned from raw text off the web in a hundred languages at once, so a skill it picks up in one language largely carries over to the others.

That is why it matters. Most of the world's languages have almost no hand-labelled examples for software to learn from. This approach lets them borrow from the handful of languages that do.