Unigram Language Model Tokenization › Limitations and Impact

Michael BrenndoerferUpdated February 14, 20264 min read
Language AI HandbookAll chapters
Part 5 of 67Subword Tokenization
Chapter 31Unigram Language Model Tokenization › Limitations and Impact
Reading section 9 of 11 · Limitations and Impact · 4 minSection 9 of 11 · 4 min

Book contents

Section 9 of 11 · 4 min read

Unigram Language Model Tokenization › Limitations and ImpactOne section · Sections in this chapter9 / 11 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

The unigram LM approach is principled and powerful, but it comes with real limitations that you should understand before applying it to new problems.

The most significant practical limitation is computational cost during tokenizer training. The EM algorithm requires multiple passes over the full corpus, and each pass involves computing segmentation probabilities for every word. For large corpora with hundreds of gigabytes of text, this is expensive. BPE, by contrast, can be trained with simple frequency counting that scales to large corpora more easily. In practice, this means unigram LM tokenizers are most often trained on a representative subset of the full training data rather than the entire corpus. The assumption is that a well-sampled subset captures the same morphological patterns as the full corpus, which is usually true for morphological tokenization but may not hold for rare vocabulary in very domain-specific text.

A subtler limitation is the independence assumption at the heart of the model. Treating each token's probability as independent of its neighbors is mathematically convenient but linguistically false. The probability of seeing the suffix "-ness" in reality depends heavily on what precedes it: it follows adjectives but not verbs, and it follows certain stems but not others. This means the model's probability estimates are inaccurate in absolute terms, even if they produce useful relative rankings between segmentations. For most applications this doesn't matter since we only care about which segmentation has the highest probability, but it means the absolute probability values assigned to segmentations should not be interpreted as true linguistic probabilities. If you use the probabilities for downstream tasks like calibration or uncertainty estimation, be aware of this systematic bias.

The vocabulary pruning strategy also introduces a failure mode worth understanding. The algorithm scores tokens by their marginal impact on the corpus log-likelihood, but this marginal impact depends on which other tokens are present in the vocabulary. Removing a token changes the optimal segmentations of words that used it, which changes the effective value of other tokens, which can cause the pruning to make suboptimal decisions in some cases. The prune-then-EM loop mitigates this by re-estimating probabilities after each pruning step, but it does not guarantee globally optimal pruning decisions. The final vocabulary is a local optimum, not necessarily the global optimum.

Despite these limitations, the unigram LM approach has had wide use on production NLP systems. Its main contribution goes beyond the training algorithm: it introduced probability-based tokenization that enables subword regularization. Research on multilingual models consistently finds that models trained with subword regularization are more less brittle, particularly on low-resource languages and text that differs from the tokenizer's training distribution. The SentencePiece library made these ideas practical and accessible, and it remains widely used in production systems years after its introduction.

The approach also changed how researchers think about tokenization itself. Before the unigram LM, tokenizers were viewed as deterministic preprocessing steps: you run the tokenizer, you get tokens, you move on. The probabilistic framing introduced by the unigram LM model encouraged thinking of tokenization as a modeling choice with uncertainty, opening the door to more flexible approaches to text representation. This philosophical shift influenced later work on learned tokenization, byte-level models, and tokenization-free architectures, all of which grapple with the same fundamental question of what the right granularity for text representation is. The unigram LM's answer, that there is no single right granularity and that maintaining a distribution over segmentations is more principled than committing to one, remains relevant in current research.

The approach also benefits for low-resource and morphologically rich languages. Languages like Turkish, Finnish, and Swahili have agglutinative morphology where a single word form can carry the meaning of an entire English phrase. A deterministic tokenizer trained on a balanced multilingual corpus may consistently make suboptimal choices for these languages, systematically over-segmenting or under-segmenting based on the dominant language's statistics. Subword regularization, by exposing the downstream model to multiple segmentations, allows it to learn to handle each language's morphological patterns even when the tokenizer was not perfectly trained for that language. This robustness property is especially valuable in production systems that must handle multilingual input at scale.