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 · OpenReview

Abstract

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).

Introduction: The Vocabulary Bottleneck

In the evolution of multilingual Large Language Models (LLMs), a significant disparity has emerged between model depth and vocabulary breadth. While architectures like XLM-R and mT5 have scaled to billions of parameters, their vocabularies have remained stagnant at approximately 250,000 tokens. When this limited capacity is shared across more than 100 languages, the average allocation per language is insufficient.

This constraint creates a "vocabulary bottleneck" characterized by over-tokenization. In this state, the model is forced to decompose words into tiny, semantically opaque fragments—particularly in languages with complex scripts (e.g., Chinese) or those under-represented in the training data. Over-tokenization increases the computational burden on the model to reconstruct meaning and results in longer input sequences, which effectively reduces the model's context window and slows down inference.

The XLM-V Methodology

XLM-V addresses this bottleneck by scaling the vocabulary to one million tokens using three primary innovations in vocabulary construction:

  1. Lexical Fingerprinting: Rather than treating token presence as a binary metric, the authors represent each language through "unigram log probabilities." This creates a nuanced "fingerprint" of how subwords are actually utilized within a specific language.
  2. Language Clustering: Using K-Means, the researchers grouped 116 languages into eight distinct clusters based on their lexical fingerprints. This ensures that languages with shared roots (such as Romance languages) can share tokens efficiently, while preventing unrelated languages from competing for the same limited vocabulary space.
  3. Dynamic Capacity Allocation: To avoid arbitrary distribution, the model employs the Average Log Probability (ALP) metric. This allows the system to determine the optimal number of tokens required for each cluster to achieve high-quality representation.

The resulting XLM-V model maintains a transformer encoder architecture similar to XLM-R base but incorporates a massive 1-million-token embedding layer.

Experimental Setup

XLM-V was pre-trained on 2.5TB of CC100 data covering 116 languages. Evaluation spanned a diverse array of benchmarks:

  • Standard Benchmarks: XNLI (Inference), MLQA, XQuAD, and TyDiQA (Question Answering), and WikiAnn (Named Entity Recognition).
  • Low-Resource Benchmarks: AmericasNLI (indigenous languages) and MasakhaNER (African languages).
  • Efficiency Metrics: The FLoRes-200 dataset was utilized to measure tokenization efficiency across 200 languages.

Key Insights and Results

The "Zipf Ceiling"

The research identified a critical threshold for vocabulary scaling. While increasing the vocabulary to 1 million tokens yielded significant gains, performance began to plateau or decline at 1.5M and 2M tokens. This "Zipf Ceiling" occurs because the long tail of rare tokens lacks sufficient frequency in the training corpus for the model to learn robust embeddings. One million tokens represents the current "sweet spot" for multilingual representation.

Vocabulary as Conditional Compute

Despite a 3.3x increase in total parameter count due to the 1M vocabulary, training time only increased by approximately 25%. This is because the embedding layer acts as a form of conditional compute; for any specific input, the model only activates a small fraction of the total embedding matrix, making it a highly efficient method for increasing model capacity.

Performance Gains

XLM-V demonstrated superior performance across the board:

  • Universal Improvement: XLM-V outperformed XLM-R on every tested task, achieving an average gain of 3.5 points.
  • Low-Resource Impact: The most dramatic improvements were seen in under-represented languages, including an 11.2% absolute F1 increase on MasakhaNER and a 5.8% accuracy boost on AmericasNLI.
  • Zero-Shot Transfer: The model showed remarkable zero-shot capabilities, with gains of +18.2% for Quechua and +17.2% for Guaraní on AmericasNLI.
  • Tokenization Efficiency: Input sequences were 11.5% shorter on average than XLM-R, leading to faster inference and more effective use of the context window.

Limitations and Future Directions

While XLM-V successfully mitigates the vocabulary bottleneck, it introduces new challenges. The primary concern is the softmax bottleneck; as the vocabulary grows, the final output layer becomes computationally expensive. Scaling beyond 2 million tokens may require approximation techniques like adaptive softmax. Additionally, the physical size of the 1M token embedding matrix poses memory challenges for deployment on hardware with limited VRAM. Future work will likely explore applying these large-scale vocabulary techniques to autoregressive (generative) 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