XLM-RoBERTa

XLM-RoBERTa (XLM-R)

A multilingual RoBERTa encoder trained on huge web text for a hundred languages, with a SentencePiece vocabulary of 250 thousand tokens. It clearly outperformed mBERT, especially in low-resource languages, and discussed the "curse of multilinguality".

2019Encoder-onlyPublished weights
DeveloperFacebook AI (Meta)
Year of publication2019
Number of parametersBase 270 million, Large 550 million
Layers12 or 24 layers
Context length512 tokens
Training dataCC-100: about 2.5 TB of filtered Common Crawl text for 100 languages, including Arabic
Training objectiveMultilingual MLM
LicenceMIT
ArabicIt supports Arabic among 100 languages, and was a strong multilingual baseline for Arabic tasks.

The curse of multilinguality

The authors noticed that with a fixed model size, adding more languages first improves the performance of low-resource languages (thanks to transfer), and then overall performance declines because the model's capacity is spread over more languages. The partial solution is a larger model. This explains why models dedicated to Arabic outperform on many tasks.

Cross-lingual transfer

The paper evaluated zero-shot transfer: fine-tuning on English data (such as XNLI) and then testing on other languages, including Arabic, as well as fine-tuning on translations. This is useful when there is no labeled Arabic data for a task.

Encoder-only model (BERT family) Encoder-only (BERT family)
[CLS]T0ذهبT1[MASK]T2إلىT3المدرسةT4[SEP]T5Token + Segment + Position embeddingsN× encoder blocksbidirectional self-attention: every token sees every tokenMLM: the student?classifier

Every token sees the whole context in both directions. In pre-training some tokens are masked and the model predicts them (MLM); in fine-tuning the [CLS] representation or the token representations are used.

Key contributions

  • Cross-lingual transfer: fine-tuning on English and then applying to Arabic without Arabic examples.
  • Huge web data is better for low-resource languages than Wikipedia alone.

Limitations and caveats

  • The "curse of multilinguality": with fixed capacity, adding many languages lowers per-language performance.
  • Dedicated Arabic models usually outperform it on Arabic tasks.

Original references

  1. Conneau, A. et al. (2020). Unsupervised Cross-lingual Representation Learning at Scale. ACL arxiv.org/abs/1911.02116

The figures are taken from the papers and official cards cited in the references. When the developer does not disclose a figure we write "not disclosed" and do not estimate it. Check the model card before any commercial use, because license terms may change.