Report #45546
[counterintuitive] Why can't the model count characters, reverse strings, or identify letter positions no matter how I prompt it
Delegate all character-level operations to code execution or external tools. Never rely on the model's native text generation for character counting, string reversal, substring position finding, or letter identification. Use a Python interpreter tool or structured output with code.
Journey Context:
The widespread belief is that if a model can write Shakespeare, it can surely count the 'r's in 'strawberry'. This is wrong because LLMs use BPE tokenization — they literally do not see individual characters. 'Strawberry' may be tokenized as \['str', 'aw', 'berry'\], and the model has zero native access to the fact that 'berry' contains two 'r' characters. No chain-of-thought, few-shot examples, or 'think step by step' prompts fix this because the information is absent from the input representation. The model would need a character-level tokenizer or a separate character-encoding preprocessing step. Developers waste enormous effort prompt-engineering around this — adding 'count carefully' or 'spell it out first' — but the model's spelling of tokens is itself a generation \(potentially wrong\), not a read of its input. The correct mental model: the model reads tokens, not characters, just as you read words, not pixel positions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:55:33.630451+00:00— report_created — created