← Back to blog

Why AI Sometimes Miscounts the r's in “strawberry”

Why AI Sometimes Miscounts the r's in “strawberry”

Ask a deliberately simple question: how many r characters are in strawberry? The answer is three. Write the letters out: s t r a w b e r r y; the third, eighth and ninth positions are r.

Give the same question to an AI model and you may occasionally get two, four, or a confident explanation for the wrong number. The example is useful precisely because it is not true that every model always fails. Many models get it right. The lesson is this: a fluent answer is not proof that every character was checked.

The model does not receive a row of tiny squares

People naturally read strawberry as ten separate characters. A language model usually receives a sequence of tokens. A token may be a whole word or part of a word; the tokenizer decides the boundaries. It does not follow the intuition that every English letter is one independent box.

Here is a cha chaan teng analogy. A kitchen does not normally count every grain of rice while preparing a meal. It works with combinations such as rice, side dish and sauce. If someone suddenly asks how many grains are on the plate, the normal workflow was not built for that question; a separate measuring tool is needed.

Tokenisation is only one layer. A language model is primarily trained to predict a plausible continuation of text, not to act as a built-in character counter. When a task demands exact positions inside a word, it may follow a familiar language pattern first and wrap the guess in very smooth prose.

That does not mean “AI cannot see letters.” A model can answer correctly through more deliberate reasoning, a character-oriented representation, or an external tool. Results can vary with the model, context and prompt. The defensible conclusion is not “this model always miscounts”; it is “when the count matters, do not rely on one intuitive answer.”

Three ways to verify the count

Method one: ask for indexed characters

Do not ask for the total first. Ask for an auditable intermediate representation:

Do not give the total immediately. Split “strawberry” into an indexed character table: position | character. Then count only the character r and list its positions.

This changes the task from guessing a total to showing evidence. If the table is wrong, you see the failure before accepting the number.

Method two: change the representation

Separate the letters so the model is less likely to treat the word as one familiar shape:

s | t | r | a | w | b | e | r | r | y

Then ask: “Count only r. Show the positions and the total.” This is not a spell. It is a way to present the input in a structure closer to the one you need to check. The same approach helps with names, product codes and document identifiers.

Method three: use a deterministic tool

If the task is exact counting, give it to a rule-based tool:

word = "strawberry"
count = sum(1 for character in word.lower() if character == "r")
print(count)  # 3

You do not need to write code yourself. Ask the model for a spreadsheet formula, then let the spreadsheet execute it. The important separation is between explanation and calculation: the model translates the question into steps, and the tool returns a reproducible number.

What the tiny test actually teaches

Fluency is not evidence. A complete, confident and grammatical paragraph proves that the model can write. It does not prove that every detail was checked.

The intermediate representation should be readable. A table, an index, a source quotation or a formula opens a narrow inspection path through the black box. You do not need to see every internal operation; you need a route back to the conclusion.

The more exact the task, the more explicit the verification. A first draft of a greeting card can be good enough. An ID number, contract date or medication dose calls for a source, a second check and, where appropriate, a qualified professional.

Three misconceptions

“Ask the same question three times and take the majority.”

Three answers may share the same failure pattern. That is not independent verification. Change the representation, or use a program, spreadsheet or original document to add genuinely different evidence.

“A larger model will never make this mistake.”

A stronger model may get more cases right, but no model can guarantee every character count. The risk of the task determines the checking standard, not the model name.

“Tell it to think step by step and it becomes reliable.”

Steps can make an answer easier to inspect; they do not make every step correct. Check the input, the rule and the result, and keep human review for consequential decisions.

A checklist worth saving

For an exact number, string or clause, use this sequence:

  1. Ask for an answer, but treat it as a draft.

  2. Request an indexed representation, source sentence or formula.

  3. Recalculate using a different representation.

  4. Give important results to a deterministic tool or a qualified second reviewer.

The three r characters in strawberry look like a puzzle. They are really a reminder: AI is excellent at organising material and proposing a direction; when the answer must be exact to the character, let evidence lead the prose.


Information in this article is current as of 6 August 2026 and is provided for general reference only; it does not constitute advice of any kind. Third-party product features, pricing and policies are subject to their official announcements. Essevin service details are as shown on essevin.com and in the console.