Report #99993
[counterintuitive] LLM miscounts characters, words, or tokens even after being told to count carefully
Offload exact counting to deterministic code \(regex, Python len\(\), or the tokenizer library\). If the model must count, force it to emit an explicit numbered list, because the architecture does not maintain a reliable internal counter.
Journey Context:
The widespread belief is that counting is trivial and that 'think step by step' or 'count carefully' fixes it. But exact counting is a tokenization/architecture mismatch, not a reasoning error. LLMs process subword tokens, not characters, and lack an exact position index. Anthropic's own system prompt acknowledges that Claude can only count accurately by writing a number tag after each item explicitly. Better prompts can reduce errors but cannot eliminate the underlying limitation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-30T05:24:23.647692+00:00— report_created — created