WordPiece › Limitations and Impact

Michael BrenndoerferUpdated March 3, 20265 min read
Language AI HandbookAll chapters
Part 5 of 67Subword Tokenization
Chapter 30WordPiece › Limitations and Impact
Reading section 11 of 13 · Limitations and Impact · 5 minSection 11 of 13 · 5 min

Book contents

Section 11 of 13 · 5 min read

WordPiece › Limitations and ImpactOne section · Sections in this chapter11 / 13 ↓
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

WordPiece represents a significant advance over character and word tokenization, but like any engineering solution it makes trade-offs that create real limitations. Understanding these limitations is essential for knowing when to use WordPiece-based systems and when to consider alternatives.

Limitations

WordPiece's likelihood objective is a strength in theory but comes with practical trade-offs. The PMI-based scoring is computationally more expensive than BPE's raw frequency counting, because each iteration requires computing token probabilities across the entire corpus. Modern implementations are highly optimized, but this cost historically limited WordPiece to settings with significant engineering investment, which is why it remained largely confined to Google's internal systems until BERT made the algorithm public.

The greedy tokenization algorithm, while fast and deterministic, produces only one segmentation of a word. This is unlike the Unigram Language Model tokenizer (which we will cover in the next chapter), which assigns probabilities to all possible segmentations and can sample different splits during training. For many tasks, a single deterministic segmentation is exactly what you want. But for data augmentation or regularization during model training, the lack of stochasticity is a limitation. Research has shown that tokenization-based data augmentation, where you randomly vary how words are segmented, can improve model robustness on morphologically ambiguous inputs. WordPiece's determinism forecloses this option.

WordPiece vocabularies trained on English perform poorly on morphologically rich languages. Languages like Finnish, Turkish, or Hungarian have complex inflectional and derivational systems that can produce thousands of word forms from a single root. A WordPiece vocabulary optimized for English will over-split words in these languages into very short pieces, increasing sequence length and reducing the semantic coherence of individual tokens. For a concrete example: the Finnish word "juoksentelisinkohan" (meaning "I wonder if I should run around") is a single grammatical word that would be split into many short subword pieces by an English WordPiece tokenizer. This length explosion can exhaust the maximum sequence length of transformer models very quickly when processing morphologically rich languages.

The ## prefix convention creates a mild vocabulary inefficiency: every character that can appear as a continuation needs both its plain form (as a word-initial character) and its ## form. For languages like Japanese or Chinese, where there is no notion of whitespace-delimited words, the ## convention becomes largely meaningless. These languages require entirely different pre-tokenization strategies, often treating each character or each Unicode codepoint as a word boundary. SentencePiece's approach of using a special character to mark word beginnings rather than word continuations handles these languages more gracefully.

Another limitation is that the vocabulary is static once trained. If the training corpus is from 2018 but you are using the tokenizer in 2026, new technical terms, product names, and cultural references that emerged after training will be split into small pieces. The word "ChatGPT", for example, would be tokenized by BERT's 2018 vocabulary into something like chat, ##g, ##pt, which captures almost none of its meaning. This vocabulary staleness is a practical problem for long-lived models and requires either periodic retraining of the tokenizer or careful out-of-vocabulary handling.

The training corpus bias also affects how well the tokenizer handles different registers and domains. A tokenizer trained on general web text will have a vocabulary that reflects common web language, with domain-specific technical vocabulary from medicine, law, or specialized sciences being over-split. When using BERT for specialized domains, a common approach is domain-adaptive pre-training with a re-trained tokenizer, precisely to give the vocabulary better coverage of domain-specific terminology.

Impact

WordPiece's most lasting contribution is its role in BERT. BERT demonstrated that pretraining transformer models on large text corpora with a masked language modeling objective could produce representations powerful enough to set state-of-the-art results across nearly every NLP benchmark, and WordPiece was the tokenizer that made this possible at a practical vocabulary size.

The choice to use a 30,000-token vocabulary was significant. Earlier neural language models often used vocabularies of 50,000 or more words, with substantial unknown word rates. BERT's WordPiece vocabulary achieves an unknown token rate near zero while keeping the vocabulary small enough that the embedding matrix does not dominate model parameters. This efficiency helped make BERT and its descendants (RoBERTa, DistilBERT, ALBERT) practical to train and deploy.

WordPiece also popularized the ## continuation prefix convention. The practice of explicitly marking subword boundaries in the token stream has influenced tokenizer design well beyond BERT. SentencePiece (which we will cover in a later chapter) uses a different convention (a special prefix to mark word beginnings rather than word continuations), but both approaches solve the same problem: preserving word boundary information within a subword vocabulary so downstream models can reconstruct the original tokenization.

The likelihood-based scoring that distinguishes WordPiece from BPE has influenced the development of the Unigram Language Model tokenizer, which takes this probabilistic framing much further. Where WordPiece uses PMI to choose among candidate merges in a bottom-up process, the Unigram model starts from a large vocabulary and prunes it by maximizing data likelihood, giving even more principled probabilistic tokenization. The two algorithms share the same philosophical foundation: both ask "what vocabulary best explains the training corpus?" and use that question to guide vocabulary construction. WordPiece does so approximately, one merge at a time. The Unigram model does so globally, optimizing over the entire vocabulary simultaneously.

The broader lesson of WordPiece is that the choice of tokenization has downstream consequences for everything the model learns. The subword vocabulary shapes which units receive embeddings, which units share embeddings, and which morphological patterns are visible to the model's attention mechanism. The move from word-level to subword tokenization, enabled by algorithms like WordPiece, was one of the key factors that made transformer models practical: it allowed a single model with a fixed vocabulary to handle open-domain text without drowning in out-of-vocabulary tokens.