Why did a chatbot famously miscount the r’s in “strawberry”?
Lesson 21.1 · The R’s in “Strawberry”
Rosa · Felix
Sonnets: fine. Counting r’s: two. It never saw the letters.
Rosa asks a chatbot how many r’s are in “strawberry.”
It says two. There are three.
A machine that can write a sonnet can’t count letters in one word, and the reason is that it never saw the letters.
It saw chunks.
The short answer
Because the model never counted letters. It saw “strawberry” as a couple of chunks and answered from what it had read about the word, and people rarely write down how many r’s it has. Newer models have been patched to handle this case. The underlying reason hasn’t changed.
Try it yourself
Type a word or a sentence and see how it gets chopped into tokens. Try your name.
What you just did has a name
Tokens
A token is the unit a language model reads and writes: sometimes a whole word, often a piece of one, sometimes punctuation.
Text gets chopped into tokens before the model sees it, and each token becomes a number.
“Strawberry” might be two or three tokens, and none of them is the letter r.
A few more things
It’s Module 2’s encoding, for text
A photo became a grid of numbers. Text becomes a list of token numbers. The model only ever sees the list. Anything about the letters inside a token is invisible to it.
Why chunks and not letters
Letters make sequences too long, and whole words make the vocabulary too big (and unknown words impossible). Pieces of words are the compromise: a few tens of thousands of chunks that can spell anything.
Tokens are what you pay for
Chatbot services charge by the token, and models have a limit on how many they can hold in mind at once. A long conversation is a long list of numbers, and eventually the front of it falls off.
Go deeper
The longer version, if you want it.
How the chunks get chosen
The common method starts with single characters and repeatedly merges the most frequent adjacent pair into a new token, thousands of times, until it has a vocabulary of the desired size. Frequent words end up as one token. Rare words get built from pieces. Names and made-up words get chopped finely. The app’s tokenizer imitates this with a fixed list of common pieces; real ones learn the list from the training text.
This is why the same model handles English better than languages it saw less of during that merging: their words get split into more, less meaningful pieces.
Quick check
You ask a chatbot to spell your friend’s unusual last name backward. It gets it wrong. Why?
Let’s take it slower
Think of it as reading a sentence printed on toy bricks instead of paper. Common words are one brick. Long or unusual words come as two or three bricks snapped together. The model gets the bricks, each stamped with an ID number, and never the print on them. Ask it anything about how a word is spelled and it has to guess from what it has read about that word, because it was never handed the letters. Everything it does well, it does with bricks.
More examples
The emoji that counts as three
Some emoji get chopped into two or three tokens, because the model rarely saw them during training. Ask a chatbot to count the emoji in a message and it may be off. To it, one taco isn’t one thing but a few numbers in a row.
The made-up brand name
A startup called Zynqlo asks a chatbot for slogans and it keeps misspelling the name. Zynqlo isn’t a word the model has seen, so it arrives as four or five scraps. The slogans are fine, but the name comes back reassembled from scraps it half-remembers, and it’s a coin flip.
Back to the question
So why two r’s?
Show the answer
Because the model never counted letters. It saw “strawberry” as a couple of chunks and answered from what it had read about the word, and people rarely write down how many r’s it has. Newer models have been patched to handle this case. The underlying reason hasn’t changed.
More on this: How does ChatGPT work?
One last question
What does a language model actually read?
Talk Card
Talk Card · 21.1
Chatbots read in chunks called tokens, not letters, which is why one famously miscounted the r’s in “strawberry.” Everything it knows is patterns between chunks.
Data to AI · pettigrewlab.com/learn

