On this page
Ask a chatbot how many times the letter r appears in “strawberry”, and many popular models have got it wrong. The word has three. It sounds like a party trick, but the same blind spot can creep into your homework: counting atoms in a formula, checking a spelling, or counting terms in a long expression. Once you know why it happens, you can word your questions so it rarely bites.
What is a token in AI?
A chatbot never sees your words as a row of letters. Before the model reads anything, a program called a tokenizer chops the text into tokens: chunks of characters that can be a whole word or part of one, as Fu and colleagues explain in their study of letter counting. Their paper notes that the GPT-4o tokenizer splits “strawberry” into three tokens: “st”, “raw” and “berry”.
The idea comes from machine translation. In 2016, Rico Sennrich, Barry Haddow and Alexandra Birch showed that a translation model could handle rare and unknown words by breaking them into subword units, using a method based on byte pair encoding. Chunks are a compromise between whole words and single letters: the vocabulary stays manageable, and texts stay shorter than they would be letter by letter.
The catch is that each token arrives as one unit. The CUTE benchmark paper says most models process tokens “as atomic units without direct access to individual characters.”
Why does AI get letter counting wrong?
Because “berry” arrives as one piece, the model has to have learned from its training text that this piece holds two r’s, then add the r inside “raw”. Lukas Edman, Helmut Schmid and Alexander Fraser, who built the CUTE benchmark, found that most models they tested seem to know how their tokens are spelled, yet fail to use that knowledge to manipulate text.
Tokens are not the whole story. Fu and colleagues tested eight models from 2024, including GPT-4o and Llama 3.1, on 10,000 English words picked at random. Most models miscounted the letters in more than half the words, and even the best one, GPT-4o, got 17% wrong. Errors rose with word length, and most of all when a letter appeared more than once. The authors concluded that the counting itself is the hard part: how common a word or its tokens are in a large body of English text made no significant difference. The study is now published in ACM Transactions on Intelligent Systems and Technology.
Where does this show up in maths and chemistry?
Treat any answer that depends on counting individual symbols as worth a second look:
Atoms in a formula such as C6H12O6, or in a condensed formula like CH3CH2CH(CH3)COOH.
Terms, brackets or minus signs in a long algebraic expression.
Zeros in a number like 0.000045 when you convert it to scientific notation.
Spellings of technical words such as stoichiometry or parallelogram.
Counting isomers is a close cousin of this problem; our guide to checking an AI’s count of isomers shows how to count them yourself first.
How do you word questions so AI counts correctly?
Turn a hidden count into a visible list. Fu and colleagues found that models can recognise the letters even when they cannot count them. That points to a simple fix: ask for the pieces first and the total last.
Here is a worked example. Instead of asking “How many hydrogen atoms are in CH3CH2CH(CH3)COOH?”, send three short steps:
“Write each group in CH3CH2CH(CH3)COOH on its own line.”
“Next to each group, write how many H atoms it has.”
“Add that column and show the sum.”
You should see CH3 (3), CH2 (2), CH (1), CH3 (3) and COOH (1), so 3 + 2 + 1 + 3 + 1 = 10. That matches the molecular formula of 2-methylbutanoic acid, C5H10O2, which is a quick way to check the AI and yourself.
The same move works for words: “Spell strawberry one letter per line, numbered. Then list the line numbers that hold r.” You get lines 3, 8 and 9, so three.
A few more habits:
Ask for the working, not just the number, and check the final total yourself.
If the chatbot can run code, ask it to count with code and show you the code.
Never accept a count you could do by hand in ten seconds without doing it.
The same idea sits behind a good tutor: Fermi’s AI tutor works through problems alongside you, writing on a board and checking understanding as it goes, so the steps stay where you can see them. For practice, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer.
Tokens are only one part of how a chatbot works. To see the rest, read how AI chatbots are trained with human feedback and the difference between fine-tuning and prompting. Next time an AI gives you a count, ask it to show the pieces.



