Report #46994
[counterintuitive] Model cannot reverse a string correctly even with few-shot examples
Use code execution for any string manipulation task \(reversal, substring extraction by index, character-at-position\). Do not attempt to prompt-engineer string reversal.
Journey Context:
Developers assume string reversal is trivial and that providing few-shot examples should teach the model the pattern. The actual problem requires two interleaved operations: reversing the order of tokens AND reversing the characters within each token. The model must know the internal character composition of each BPE token, which is learned inconsistently from training data. For single-character tokens this is easy; for multi-character tokens it requires memorized knowledge of token internals. The failure is non-uniform — the model might reverse 'abc' fine but fail on 'strawberry' because the token boundaries differ. No prompting strategy fixes this because the model lacks reliable access to character-level token decomposition. This is the same root cause as character counting \(BPE tokenization\) but manifests as a distinct, surprising failure mode because developers expect reversal to be 'just reading backwards.'
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:21:08.252754+00:00— report_created — created