Animation shows how GPT-4o's o200k_base tokenizer handles "strawberry"
An author made a roughly 6-minute animated explainer showing how the o200k_base tokenizer used by GPT-4o handles "strawberry", using actual output from tiktoken 0.14.0. In o200k_base, " strawberry" with a leading space is a single token with id 101830, so the three r's sit inside one id, while the full sentence "How many r's are in strawberry?" is split into 8 tokens. The video also walks through byte pair encoding merges on a made-up text until "strawberry" becomes st | raw | berry, and notes that "strawberry", " strawberry" and "Strawberry" are three different token sequences. The author says all splits come from tiktoken 0.14.0, the narration is AI-read from a script the author wrote, and corrections are invited.
o200k_base is the tokenizer vocabulary used by the GPT-4o series, while its predecessor cl100k_base is used by earlier models such as GPT-4. The same passage of text can differ several-fold in token count between the two, which directly affects billing and context usage. The so-called "strawberry problem" refers to models struggling to count the number of r's in strawberry, and when the word carries a leading space it is merged into a single token (id 101830), so the letter information is no longer exposed as separate tokens.
For people learning about tokenization, the demo gives a reproducible concrete reference: the same word maps to different token sequences depending on leading space and capitalisation, and letter-counting questions are not directly visible at the token level. The author also mentions that in OpenAI's 2025 paper "Why Language Models Hallucinate", DeepSeek-R1 spells out DEEPSEEK letter by letter before counting while DeepSeek-V3 answers incorrectly; this is the author's retelling of the paper's content, not independent verification by this video.