← All writing
NLP · 5 min read · 23 Nov 2026

How Tokeniser Vocabulary Size Quietly Shapes Model Behaviour

A single word, split three different ways, reveals why vocabulary size is a modelling decision and not just a preprocessing detail.

Cover image for the article: How Tokeniser Vocabulary Size Quietly Shapes Model Behaviour

Why this is not a trivial setting

Vocabulary size is usually treated as a configuration number you pick once and forget, somewhere between 8,000 and 100,000 depending on the recipe you copied. I used to treat it the same way, until I started tracing what actually happens to a single input string as it passes through tokenisers built with different vocabulary sizes. The differences are not cosmetic. They change how long your sequences are, how much of the model's capacity goes into spelling things out versus reasoning about them, and how gracefully the model handles words it has never seen.

This matters because vocabulary size sits upstream of almost everything else. It affects sequence length, which affects training cost and the effective context the model can use. It affects how rare or novel words are represented, which affects generalisation. And it affects the granularity of the prediction problem itself, since the model is, at every step, choosing from a probability distribution over the vocabulary. A vocabulary of 8,000 subwords and one of 64,000 are not the same task with a different dial turned; they are meaningfully different learning problems wearing the same architecture.

One word, three tokenisers

Take the word unfathomable. It is a reasonably common English word, but not one that appears in children's books, so it sits in that awkward middle ground: frequent enough to matter, rare enough to test a tokeniser's assumptions.

Run the same sentence through all three and the token count for that one word ranges from one to four. Multiply that across an entire document and you can see sequence lengths differing by a meaningful margin purely because of a preprocessing choice made before training even started.

open dictionary book close up

What that length difference actually costs and buys

The immediate, measurable consequence is compute and context budget. A transformer's self-attention cost grows with sequence length, so a tokeniser that turns your corpus into more tokens makes training and inference more expensive for the same text, and it eats into the effective context window a model has available for the content that matters. If your context limit is 4,096 tokens and your tokeniser needs four tokens for words a competitor's tokeniser handles in one, you are fitting noticeably less actual text into that window. This is not a hypothetical concern for long documents, transcripts, or anything with specialist vocabulary.

The subtler consequence is about what the model has to learn rather than just how much it costs. When unfathomable is split into un, fath, om, able, the model has to learn, essentially from scratch through its own internal composition, that this particular sequence of fragments means something coherent and specific. It is solving a mini compositional puzzle at every occurrence. When the same word is one token, that compositional work has been done in advance by the tokeniser, and the model instead has to learn a good embedding for that one symbol from however many times it appears in training. Neither approach is free; you are choosing where the generalisation burden sits.

This has real consequences for rare and unseen words. A small vocabulary, because it relies on small, high-frequency fragments, tends to degrade more gracefully on genuinely novel or technical vocabulary; it has seen prefixes and suffixes often enough to decompose something unfamiliar into plausible pieces. A large vocabulary with many whole-word tokens can be efficient on common text but brittle when it meets a word just outside its learned set, since it has fewer general-purpose fragments to fall back on and may end up fragmenting unfamiliar words in a less sensible way. I have seen this cause visibly odd behaviour on domain-specific text, technical terms, and non-English names, which is exactly where you would want robustness most.

The practical takeaway

If you are choosing or evaluating a tokeniser, do not treat vocabulary size as a hyperparameter you tune purely for perplexity on a held-out set and then forget. Check what it does to the inputs you actually care about, not just average documents. Pick a handful of domain terms, rare names, and technical words from your real use case, run them through the tokeniser, and look at the token counts and splits directly, the same way I did with one word above. It takes minutes and tells you things a loss curve will not.

Also be honest with yourself about the trade-off direction for your task. If your application involves long documents, cost and context efficiency push you towards a larger vocabulary. If it involves rare, technical, multilingual, or user-generated text full of novel words, a smaller or more balanced vocabulary with sensible subword fallback may generalise better even if it costs more tokens per sentence on average. There is no universally correct size; there is only the size that matches the shape of the text your model will actually see, and the only way to know that is to look at concrete examples rather than trust a default copied from someone else's recipe.

stack of books with bookmarks
← All writing See the project case studies →