NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Tokenizer Choice For LLM Training: Negligible or Crucial?

Mehdi Ali, Michael Fromm, Klaudia Thellmann, Richard Rutmann, Max Lübbering, Johannes Leveling, Katrin Klug, Jan Ebert, Niclas Doll, Jasper Schulze Buschhoff, Charvi Jain, Alexander Arno Weber, Lena Jurkschat, Hammam Abdelwahab, Chelsea John, Pedro Ortiz Suarez, Malte Ostendorff, Samuel Weinbach, Rafet Sifa, Stefan Kesselheim, Nicolas Flores-Herr

Introduction

In the development of Large Language Models (LLMs), significant resources are typically allocated to architectural scaling and data curation. However, the tokenizer—the component responsible for segmenting raw text into discrete units—is often treated as a "blind spot." This study challenges the assumption that tokenizer choice is negligible, demonstrating that it is a critical factor influencing both model intelligence and training efficiency. Through a comprehensive ablation study of 24 models, the authors show that suboptimal tokenizer selection can degrade downstream performance by up to 9% and inflate training costs by as much as 68%.

Methodology

The researchers trained 24 decoder-only models, each with 2.6 billion parameters, keeping training data (52.6 billion tokens) and hyperparameters constant. The variables tested included:

  • Algorithms: Byte-Pair Encoding (BPE) and Unigram.
  • Libraries: HuggingFace (HF) and SentencePiece (SP).
  • Vocabulary Sizes: 33k to 100k tokens.
  • Language Settings: Monolingual (English) and Multilingual (English, German, French, Italian, Spanish).

The models were evaluated using two massive 70-billion-word datasets (Monolingual and Multilingual) across a suite of standard benchmarks, including XNLI, ARC, and HellaSwag.

Key Findings

The "Fertility" Fallacy

A common metric for evaluating tokenizers is fertility—the number of tokens required to represent a word. While lower fertility implies better compression, this study reveals it is a questionable proxy for model performance. For English models, increasing vocabulary size beyond 33k improved compression but negatively impacted downstream task performance.

Fertility comparison between non-English (a) and English (b) documents across various vocabulary sizes.

The Hidden Cost of English-Centricity

The choice of tokenizer has profound financial implications. Using an English-centric tokenizer for multilingual models leads to "excessive fragmentation" of non-English text. This fragmentation forces the model to process significantly more tokens to capture the same information, increasing training costs by up to 68%.

Computational efficiency (gflops) for different tokenizers on multilingual data.

Library and Linguistic Nuances

The implementation library proved as significant as the algorithm itself. SentencePiece generally outperformed HuggingFace’s BPE implementation, likely due to differences in pre-processing. Furthermore, linguistic preferences emerged: Germanic languages (English, German) favored BPE, while Romanic languages (French, Spanish) performed better with the Unigram algorithm.

Key Results and Performance

  • Optimal Vocabulary: The "sweet spot" for monolingual English is a 33k vocabulary. For multilingual models covering five European languages, a larger vocabulary of approximately 100k is necessary to maintain performance.
  • Accuracy Gaps: Tokenizer choice resulted in performance variances of up to 9% on tasks like ARC-Easy.
  • Top Performer: The SentencePiece BPE implementation with a 100k vocabulary (BPE-SP-100) was identified as the most effective configuration for multilingual settings.

Conclusion and Future Work

The study underscores that tokenization is a primary design choice in LLM training. Future research should expand these findings to "frontier" scales (70B+ parameters) and more diverse language scripts, such as Cyrillic or Hanzi, to further refine our understanding of optimal tokenization strategies.

Summary updated

BibTeX
@inproceedings{ali2024tokenizer,
  author = {Mehdi Ali and Michael Fromm and Klaudia Thellmann and Richard Rutmann and Max Lübbering and Johannes Leveling and Katrin Klug and Jan Ebert and Niclas Doll and Jasper Schulze Buschhoff and Charvi Jain and Alexander Arno Weber and Lena Jurkschat and Hammam Abdelwahab and Chelsea John and Pedro Ortiz Suarez and Malte Ostendorff and Samuel Weinbach and Rafet Sifa and Stefan Kesselheim and Nicolas Flores-Herr},
  title = {{Tokenizer Choice For LLM Training: Negligible or Crucial?}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-naacl.247},
}
Figure