Report #102339
[counterintuitive] LLM miscounts characters, words, or tokens no matter how carefully you prompt it
Never ask the model to count characters, words, or tokens by reasoning. Use an actual tokenizer library \(tiktoken, Hugging Face tokenizers\) or a code function \(len\(\), regex\) for the exact count, and treat any model-generated count as approximate.
Journey Context:
The widespread belief is that a detailed prompt \('count slowly, letter by letter'\) fixes counting errors. It does not, because the model never sees letters or words individually; it sees variable-length tokens whose boundaries do not align with characters or whitespace. This is a representational limitation of subword tokenization, not a reasoning lapse that better prompting can cure.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-08T05:22:48.321973+00:00— report_created — created