Report #65934
[counterintuitive] LLM fails to count characters or reverse strings despite step-by-step prompting
Use a code interpreter or external script for any character-level manipulation; never rely on the LLM's text generation for it.
Journey Context:
Developers assume the model is just not reasoning hard enough and add prompts like 'count carefully'. The reality is the model does not see characters; it sees BPE tokens. A word like 'strawberry' might be 1 or 2 tokens, making character-level operations fundamentally opaque to the model's architecture. No prompt can bridge the gap between token embeddings and character arrays.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T17:09:17.712825+00:00— report_created — created