Older tokenizers had an OOV problem. Why did byte-level BPE kill it?
OOV means an input the tokenizer cannot represent in its vocabulary. For modern byte-level BPE the base vocabulary is the 256 byte values, so any UTF-8 input is representable and there is no UNK token by design.
Imagine a tokenizer is a translator that has to convert your text into a fixed alphabet of stickers. An old word-level translator only had stickers for words it had seen before; if you wrote a brand-new word it had no sticker for, it would slap down a UNK sticker meaning 'I have no idea'. That was the out-of-vocabulary problem, OOV for short. The modern fix is to give the translator a tiny sticker for every possible raw byte value, all 256 of them. Now no matter what you write (a new word, a non-Latin script, an emoji, even random binary data), it can always be broken down into bytes the translator knows. There is no UNK sticker anymore. The downside is that unusual inputs use more stickers to express than common ones, so things like Tamil or Hindi text cost more tokens per word than English. But the model never refuses to encode anything.
Detailed answer & concept explanation~7 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.
5 min: define OOV, explain why byte-level BPE has none, contrast the 256-byte base vocabulary with WordPiece's UNK, distinguish OOV from fertility, and name which 2026 tokenizers do and do not have UNK.
Real products, models, and research that use this idea.
- OpenAI's tiktoken (cl100k_base for GPT-4 and GPT-3.5-turbo, o200k_base for GPT-4o, o1, o3, GPT-5, GPT-5.5) is byte-level BPE with no UNK token; any UTF-8 input encodes losslessly.
- Meta's Llama 3 and Llama 4 tokenizer is tiktoken-style byte-level BPE at 128K vocab; same lossless property, no UNK.
- Hugging Face's BERT WordPiece tokenizer does include `[UNK]` as a real fallback for unknown characters; loading bert-base-uncased and tokenizing rare Unicode shows the UNK appearing.
- Llama 2's SentencePiece tokenizer used byte_fallback=True, so it was lossless despite SentencePiece's potential for OOV in other configurations; Llama 3 moved away from SentencePiece entirely.
What an interviewer would ask next. Try answering before peeking at the approach.
QIf byte-level BPE has no OOV, why do we still talk about tokenization being hard for some languages?
QWhat does WordPiece do when it encounters an unknown character?
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.
Claiming modern LLMs still suffer from OOV problems. Byte-level BPE eliminates OOV by construction; the related real problem is high fertility on rare scripts, not failure to encode.
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.