A language model team is debating whether to use word-level, character-level, or subword tokenization. Trace the specific failure modes of word-level and character-level approaches, quantifying the character-level sequence-length penalty on a typical 10-word English sentence, and explain why subword is the standard choice.
Word-level loses unseen words to [UNK]; character-level explodes length into quadratic attention cost; subword splits rare words into known pieces and merges common ones, staying near word-level length.
Think of packing a suitcase. Whole-outfit packing is fast, but if you need an outfit you never packed, you simply cannot wear it. Packing one thread at a time means you can make any outfit, but the suitcase needs thousands of threads and weighs a ton. Subword packing uses pre-made sleeves, collars, and panels. Common outfits snap together from a few pieces, and anything new you can still assemble from the panels. You can always dress for the occasion, and the suitcase stays light enough to carry.
Detailed answer & concept explanation~4 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 min: word-level closed-vocab OOV + character-level 5-6x length + O(n^2) means ~36x attention cost + subword merges and splits + 1.3 tokens/word + byte-level removes UNK + fairness caveat.
Real products, models, and research that use this idea.
- OpenAI's GPT-5.5 tokenizer o200k_base is byte-level BPE, keeping English near 1.3 tokens per word with no unknown token across arbitrary Unicode.
- Meta's Llama 4 uses a SentencePiece-based subword vocabulary so it handles code, names, and many languages without an OOV marker.
- Anthropic's Claude and Google's Gemini 3.1 Pro both use subword tokenizers rather than word or character schemes to balance coverage against sequence length.
What an interviewer would ask next. Try answering before peeking at the approach.
QYou computed about 36x more attention cost for character-level. Does anything reduce that in modern architectures?
QSubword averages 1.3 tokens per word for English. Why can a different language see 4 or 5?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Naming the character-level length penalty but forgetting it multiplies attention cost quadratically, so a 5x longer sequence is roughly 25x more compute, not 5x.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.