Why do modern LLMs use subword tokenization instead of word-level or character-level approaches?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Subword tokenization is the compromise that handles unseen words by splitting them into known pieces while keeping sequences short, avoiding both word-level OOV failures and character-level length explosion.
Imagine you have a box of building blocks. With word blocks, you can only build things you have a block for, so a brand-new shape you have never seen is impossible to make. With single-dot blocks, you can build anything, but even a tiny shape needs hundreds of dots and takes forever. Subword blocks are medium-sized pieces. Common shapes have their own ready-made block, and anything new you can still build from smaller pieces. That way you can always make the shape, and you do not need a mountain of tiny dots to do it.
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.
2 min: word-level OOV failure + character-level length explosion + O(n^2) attention cost + subword merges common patterns + splits rare words + byte-level BPE removes UNK.
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.
Claiming subword always yields shorter sequences than word-level, when in fact word-level is shortest and subword trades a little length to gain open-vocabulary coverage.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.