XLM-V: Overcoming the Vocabulary Bottleneck in Multilingual Masked Language Models

Davis Liang, Hila Gonen, Yuning Mao, Rui Hou, Naman Goyal, Marjan Ghazvininejad, Luke Zettlemoyer, Madian Khabsa

TL;DR

XLM-V addresses the long-standing "vocabulary bottleneck" in multilingual language models by scaling the vocabulary from the standard 250K tokens to 1 million tokens. By utilizing a novel language-clustering and data-driven capacity allocation strategy, XLM-V significantly reduces over-tokenization and produces more semantically meaningful text segments. This approach yields substantial performance gains across a wide variety of multilingual tasks, particularly for low-resource languages.

What Problem Does This Paper Address?

While modern large language models have scaled dramatically in parameter count and depth, their vocabulary sizes have remained largely stagnant. State-of-the-art multilingual models like XLM-R, mT5, and BLOOM all share a vocabulary size of roughly 250K tokens across more than 100 languages.

This creates a severe vocabulary bottleneck. When averaged out, each language receives only about 2,500 unique tokens. As a result, the tokenizer is forced to chop words into tiny, fragmented subwords or individual characters (over-tokenization). This fragmentation strips away semantic meaning, lengthens sequences (increasing computational cost), and severely degrades model performance on tasks requiring fine-grained token-level understanding, such as question answering and named entity recognition (NER)—especially for low-resource languages.

Methods

The authors introduce XLM-V, a multilingual masked language model featuring a 1-million-token vocabulary. To build this massive vocabulary efficiently without diluting language representations, they employ a two-pronged methodology:

  1. Lexical Fingerprinting & Clustering: Instead of using simple binary vectors to represent whether a token exists in a language, the authors represent each language using the unigram log probability of its tokens. This weights tokens by their actual usage frequency. They then use K-Means ($k=8$) to cluster lexically similar languages together, preventing languages with little overlap from competing for the same vocabulary space.
  2. Dynamic Capacity Allocation: Rather than allocating vocabulary size to clusters proportionally, they utilize the Average Log Probability (ALP) metric. ALP measures how well a vocabulary represents a specific language. A greedy algorithm uses ALP to allocate optimal token capacity to each cluster, ensuring that complex or distinct language groups (such as East Asian languages) receive sufficient coverage.
Comparison of lexical fingerprinting methods between prior work (binary vectors) and the proposed log-probability approach.

Datasets

  • Pretraining: The model was trained on CC100 (2.5TB of text spanning 116 languages).
  • Evaluation: The authors evaluated XLM-V across a diverse suite of multilingual benchmarks:
  • XNLI & AmericasNLI: Natural language inference (including indigenous languages of the Americas).
  • MLQA, XQuAD, & TyDiQA-GoldP: Multilingual question answering.
  • WikiAnn & MasakhaNER: Named entity recognition (including African languages).
  • FLoRes-200: Used for evaluating tokenization length and utilization across 200 languages.

Key Insights and Ideas

  • The Zipf Ceiling: Bigger isn't always better. The authors discovered that expanding the vocabulary beyond 1M tokens (e.g., to 1.5M or 2M) actually degrades downstream task performance. This happens because the extra capacity inherits tokens from the extreme long tail of the Zipfian distribution. These rare tokens are seldom seen during pretraining, leading to poorly trained, sub-optimal token embeddings.
  • Efficient Conditional Compute: A 1M token vocabulary means the embedding matrix accounts for a staggering 93% of the model's trainable parameters. However, because the model only looks up a tiny fraction of these embeddings for any given input sequence, it acts as a highly efficient form of conditional compute.
  • Semantic Tokenization Out-of-the-Box: Qualitatively, the XLM-V tokenizer naturally learns to group characters into meaningful multi-character words (e.g., correctly segmenting "Cambridge University" in Chinese as a single block [剑桥大学]) rather than fragmenting them into individual characters like XLM-R does.

Key Results

  • Downstream Superiority: XLM-V outperforms the XLM-R baseline on every single multilingual task tested, achieving an average absolute improvement of 3.5 points across the board.
  • Low-Resource Windfalls: The model shines brightest on low-resource languages, achieving an outsized 11.2% absolute F1 gain on MasakhaNER and a 5.8% absolute accuracy gain on AmericasNLI.
  • Shorter Sequences: By reducing over-tokenization, XLM-V produces sequences that are 11.5% shorter on average than XLM-R across the FLoRes-200 dataset, directly translating to faster downstream inference speeds.
  • Training Efficiency: As shown in partial training experiments, XLM-V scales parameter count by 3.3x while incurring only a 25% increase in actual training time per iteration.
Figure 2: We compare the performance of the same model trained with different sentencepiece vocabularies. The models are all trained for 300K iterations with a batch size of 2,048 on the CC100 corpus.
Figure 4: We track training speed vs. vocabulary size using a typical training setup on XNLI: one A100 GPU, a batch size of 16, sequence length of 128, and float16 precision. The text above each point denotes the vocab- ulary size.

Limitations and Future Work

Despite its efficiency as conditional compute, a 1M token vocabulary introduces notable scalability challenges. Computing the full softmax over a million tokens during pretraining is computationally expensive, making each iteration take 2.5x longer than a 250K baseline when no approximation shortcuts are used. Additionally, the massive embedding matrix significantly increases the model's initial memory footprint.

For future work, the authors suggest exploring vocabulary approximation techniques (like adaptive softmax) to mitigate pretraining slowdowns, experimenting with alternative clustering techniques like hierarchical clustering, and extending large-vocabulary architectures to autoregressive language models.

Summary updated

BibTeX
@inproceedings{liang2023xlm,
  author = {Davis Liang and Hila Gonen and Yuning Mao and Rui Hou and Naman Goyal and Marjan Ghazvininejad and Luke Zettlemoyer and Madian Khabsa},
  title = {{XLM-V: Overcoming the Vocabulary Bottleneck in Multilingual Masked Language Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  url = {https://openreview.net/forum?id=VQ4yE7SxNH},
}
Figure