Explain why word-level and character-level tokenization both fail for modern LLMs, and how subword tokenization resolves each failure mode.
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
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.
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.
What an interviewer would ask next. Try answering before peeking at the approach.
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.