Report #40688
[counterintuitive] LLM fails to count characters or reverse strings accurately
Delegate character-level manipulation and counting to a Python interpreter or external script; never rely on the LLM's direct text generation for these tasks.
Journey Context:
Developers assume the model 'sees' text like a human and just needs a better prompt \(e.g., 'think step by step about each letter'\). However, LLMs ingest BPE tokens, not characters. A word like 'strawberry' might be a single token. The model literally does not have access to the character sequence in its input, and predicting character-level reversals requires simulating an algorithm it has no architectural mechanism for. No prompt can grant character-level vision; it requires an architecture change or tool use.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T22:46:03.534678+00:00— report_created — created