Table of Contents
Fetching ...

Explaining and Mitigating Crosslingual Tokenizer Inequities

Catherine Arnett, Tyler A. Chang, Stella Biderman, Benjamin K. Bergen

TL;DR

This work reveals crosslingual token inequities in monolingual tokenizers by training thousands of tokenizers across 97 languages under controlled conditions. It identifies data similarity, mean token length, and especially whitespace proportion as key predictors of token premiums, while showing that simply enlarging vocabulary or training on parallel data offers limited relief. The study demonstrates that language-specific optimal vocabulary sizes and SuperBPE-style whitespace-agnostic tokenization substantially mitigate premiums and improve compression, though some variance remains due to intrinsic language properties. These insights inform equitable tokenizer design and have practical implications for reducing training and inference costs in multilingual NLP systems.

Abstract

The number of tokens it takes to encode parallel text in different languages is known to vary. These disparities are called token premiums. Having high token premiums leads to less throughput during training and increases costs at inference. In this paper, we show that even after controlling for dataset size, vocabulary size, and data content, monolingual tokenizers exhibit a wide range of token premiums across languages. To understand the cross-linguistic differences that cause these token premiums, we train a suite of approximately 7,000 comparable monolingual tokenizers for 97 languages, manipulating tokenization algorithm, vocabulary size, and dataset size. We measure token premiums and test for a relationship between factors such as data similarity (between tokenizer training and evaluation), vocabulary size, and pre-tokenization. We also investigate the role of language-specific features such as writing system and word length. We find that similarity between training and test data does not impact token premiums, but vocabulary size and pre-tokenization do. While simply increasing vocabulary size does not lead to reduced token premium effects, we can determine an ``optimal'' vocabulary size for each language to achieve significantly reduced token premium effects. We also train superword tokenizers which allow merges over whitespaces, and we find that they both reduce token premium effects and improve compression overall. Thus, intervening on the vocabulary size or the pre-tokenizer significantly reduces crosslingual token premium effects.

Explaining and Mitigating Crosslingual Tokenizer Inequities

TL;DR

This work reveals crosslingual token inequities in monolingual tokenizers by training thousands of tokenizers across 97 languages under controlled conditions. It identifies data similarity, mean token length, and especially whitespace proportion as key predictors of token premiums, while showing that simply enlarging vocabulary or training on parallel data offers limited relief. The study demonstrates that language-specific optimal vocabulary sizes and SuperBPE-style whitespace-agnostic tokenization substantially mitigate premiums and improve compression, though some variance remains due to intrinsic language properties. These insights inform equitable tokenizer design and have practical implications for reducing training and inference costs in multilingual NLP systems.

Abstract

The number of tokens it takes to encode parallel text in different languages is known to vary. These disparities are called token premiums. Having high token premiums leads to less throughput during training and increases costs at inference. In this paper, we show that even after controlling for dataset size, vocabulary size, and data content, monolingual tokenizers exhibit a wide range of token premiums across languages. To understand the cross-linguistic differences that cause these token premiums, we train a suite of approximately 7,000 comparable monolingual tokenizers for 97 languages, manipulating tokenization algorithm, vocabulary size, and dataset size. We measure token premiums and test for a relationship between factors such as data similarity (between tokenizer training and evaluation), vocabulary size, and pre-tokenization. We also investigate the role of language-specific features such as writing system and word length. We find that similarity between training and test data does not impact token premiums, but vocabulary size and pre-tokenization do. While simply increasing vocabulary size does not lead to reduced token premium effects, we can determine an ``optimal'' vocabulary size for each language to achieve significantly reduced token premium effects. We also train superword tokenizers which allow merges over whitespaces, and we find that they both reduce token premium effects and improve compression overall. Thus, intervening on the vocabulary size or the pre-tokenizer significantly reduces crosslingual token premium effects.
Paper Structure (56 sections, 15 figures, 13 tables)

This paper contains 56 sections, 15 figures, 13 tables.

Figures (15)

  • Figure 1: Distribution of corpus token counts (CTCs) for all languages in our sample as a density plot over CTC scores, for the BP-unscaled BPE tokenizers. Higher CTCs indicate worse compression. The distribution for each vocabulary size is plotted separately. As vocabulary size increases, the distribution shifts left and becomes more compressed, and the right tail becomes less extreme.
  • Figure 2: Comparison of CTCs for tokenizers trained on non-parallel (solid lines) versus parallel (dashed lines) data for three languages: Luxembourgish, Khmer, Maltese. Figures for the remaining languages are in Appendix \ref{['app:parallel data']}.
  • Figure 3: Left: the distribution of CTCs for BPE and Unigram tokenizers using Hugging Face (HF) or SentencePiece (SP) implementations, all with vocabulary sizes of approximately 50000. Right: the distribution of CTCs for same-vocabulary and optimal-vocabulary BPE tokenizers. The optimal-vocabulary tokenizers have target CTCs of 56000. The same-vocabulary tokenizers have a vocabulary size of 32768.
  • Figure 4: Left: the distribution of CTCs for BPE and SuperBPE tokenizers for each vocabulary size. Right: the distribution of CTCs for same-vocabulary and predicted CTCs for the optimal-vocabulary SuperBPE tokenizers. The optimal-vocabulary tokenizers have target CTCs of 43000. The same-vocabulary tokenizers have a vocabulary size of 49152.
  • Figure 5: The solid curves, fit using a power law, represent the measured CTCs for each vocabulary size, plotted as points along the curve. The horizontal dashed lines indicate the CTCs of the OLMo, Pythia, and SmolLM tokenizers.
  • ...and 10 more figures