Report #45357
[counterintuitive] Model fails at counting characters or reversing strings — just needs better prompting or more examples
Delegate all character-level string operations \(counting, reversing, finding positions, substring extraction\) to a code execution environment; never attempt these through text generation alone regardless of prompt sophistication
Journey Context:
Developers see a model fail to count the 'r's in 'strawberry' and assume few-shot examples or chain-of-thought will fix it. The root cause is BPE tokenization: text is encoded as subword tokens, not characters. 'Strawberry' becomes tokens like \['str', 'aw', 'berry'\], and the model's internal representation has no direct access to individual characters. The model must learn an implicit mapping from each token to its character composition—a memorization task with poor generalization to novel token-character decompositions. No prompt can reconstruct information destroyed at the input encoding stage. This is why the same model that writes complex code cannot reliably tell you how many letters are in a word. It is not a reasoning failure but a representation failure: the model never sees characters, only tokens.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:36:23.830979+00:00— report_created — created