Large multilingual language models typically rely on a single vocabulary shared across 100+ languages. As these models have increased in parameter count and depth, vocabulary size has remained largely unchanged. This vocabulary bottleneck limits the representational capabilities of multilingual models like XLM-R. In this paper, we introduce a new approach for scaling to very large multilingual vocabularies by de-emphasizing token sharing between languages with little lexical overlap and assigning vocabulary capacity to achieve sufficient coverage for each individual language. Tokenizations using our vocabulary are typically more semantically meaningful and shorter compared to XLM-R. Leveraging this improved vocabulary, we train XLM-V, a multilingual language model with a one million token vocabulary. XLM-V outperforms XLM-R on every task we tested on ranging from natural language inference (XNLI), question answering (MLQA, XQuAD, TyDiQA), and named entity recognition (WikiAnn) to low-resource tasks (Americas NLI, MasakhaNER).
1>>> from transformers import pipeline
2>>> unmasker = pipeline('fill-mask', model='facebook/xlm-v-base')
3>>> unmasker("Paris is the <mask> of France.")
4
5[{'score': 0.9286897778511047,
6 'token': 133852,
7 'token_str': 'capital',
8 'sequence': 'Paris is the capital of France.'},
9 {'score': 0.018073994666337967,
10 'token': 46562,
11 'token_str': 'Capital',
12 'sequence': 'Paris is the Capital of France.'},
13 {'score': 0.013238662853837013,
14 'token': 8696,
15 'token_str': 'centre',
16 'sequence': 'Paris is the centre of France.'},
17 {'score': 0.010450296103954315,
18 'token': 550136,
19 'token_str': 'heart',
20 'sequence': 'Paris is the heart of France.'},
21 {'score': 0.005028395913541317,
22 'token': 60041,
23 'token_str': 'center',
24 'sequence': 'Paris is the center of France.'}]1@ARTICLE{2023arXiv230110472L,
2 author = {{Liang}, Davis and {Gonen}, Hila and {Mao}, Yuning and {Hou}, Rui and {Goyal}, Naman and {Ghazvininejad}, Marjan and {Zettlemoyer}, Luke and {Khabsa}, Madian},
3 title = "{XLM-V: Overcoming the Vocabulary Bottleneck in Multilingual Masked Language Models}",
4 journal = {arXiv e-prints},
5 keywords = {Computer Science - Computation and Language, Computer Science - Machine Learning},
6 year = 2023,
7 month = jan,
8 eid = {arXiv:2301.10472},
9 pages = {arXiv:2301.10472},
10 doi = {10.48550/arXiv.2301.10472},
11archivePrefix = {arXiv},
12 eprint = {2301.10472},
13 primaryClass = {cs.CL},
14 adsurl = {https://ui.adsabs.harvard.edu/abs/2023arXiv230110472L},
15 adsnote = {Provided by the SAO/NASA Astrophysics Data System}
16}