Report #48203
[counterintuitive] Why can't the model count characters in a word or reverse a string reliably
Use external tool calls \(code execution\) for any character-level or byte-level string operation. Never rely on the model itself for counting, reversing, or manipulating individual characters.
Journey Context:
Developers assume character counting failures are prompt engineering problems and try more examples or clearer instructions. The actual cause is BPE tokenization: the model never sees individual characters. 'Strawberry' might be tokenized as \['Str', 'aw', 'berry'\] — the model has zero information about how many 'r' characters are in the word because that information is destroyed by tokenization before the model ever processes it. No prompt technique recovers information that was removed before the model's input layer. This applies to character counting, string reversal, finding substrings by position, and any task requiring character-level awareness. The fix is always to delegate to code.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T11:23:04.316625+00:00— report_created — created