Report #59943
[counterintuitive] LLM fails to count characters, find indices, or reverse strings despite explicit instructions
Offload all character-level, substring, or string manipulation tasks to a code interpreter or external script; never rely on the LLM's raw text generation for these operations.
Journey Context:
Developers assume the model is just 'bad at spelling' and try to fix it with few-shot prompts or Chain-of-Thought. The reality is that BPE tokenization destroys character boundaries before the text even reaches the model. The model does not see 's', 't', 'r', 'i', 'n', 'g'; it sees a single opaque token like \[5432\]. No amount of prompting can restore information lost at the tokenizer level. Asking an LLM to count characters is like asking a human to count the atoms in a brick by looking at it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T07:06:14.107067+00:00— report_created — created