Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
o200k_base doubles the vocabulary to ~200k tokens with a refreshed regex, so multilingual and emoji-heavy text tokenizes into far fewer tokens than under cl100k_base.
Imagine you label moving boxes with sticky notes. With only 100 notes you give the boxes you pack most often (English words) their own label, but rarer boxes (Japanese, emoji) have to share. Now picture getting 200 notes. A lot of those once-shared boxes suddenly get their own label, so you write fewer notes overall to describe the same pile. That is what o200k_base does: it is the newer OpenAI vocabulary with twice as many labels as cl100k_base, so non-English text and emoji get packed into fewer pieces.
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: vocabulary 100k vs 200k + where the budget shifts (CJK, emoji) + regex refresh + cost = tokens x price + embedding/lm_head tradeoff + sticky encoding per model.
import tiktoken
cl100k = tiktoken.get_encoding("cl100k_base")
o200k = tiktoken.get_encoding("o200k_base")
text = "今日はいい天気です。" # "It's nice weather today." in Japanese
print(len(cl100k.encode(text))) # more tokens (English-biased vocab)
print(len(o200k.encode(text))) # fewer tokens (larger CJK coverage)
# Always resolve the encoding from the model, never hardcode:
enc = tiktoken.encoding_for_model("gpt-4o") # -> o200k_base| Property | cl100k_base | o200k_base |
|---|---|---|
| Vocabulary size | ~100,000 tokens | ~200,000 tokens |
| Model family | GPT-4, GPT-3.5-turbo | GPT-4o, GPT-5.5 |
| Multilingual / CJK efficiency | English-biased, higher fertility | Lower fertility, fewer tokens |
| Pre-tokenization regex | Older pattern | Updated for ZWJ emoji and multilingual runs |
| Embedding / lm_head cost | Smaller | Larger (vocabulary scales both) |
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.
Reading the '200k' as a 200,000-token context window rather than a 200,000-entry vocabulary: the number describes the tokenizer, not the prompt budget.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.