From Early Encoding to Late Suppression: Interpreting LLMs on Character Counting Tasks

Ayan Datta, Mounika Marreddy, Alexander Mehler, Zhixue Zhao, Radhika Mamidi


Abstract
Large language models (LLMs) still fail at counting the characters in a word, even while they excel on far harder benchmarks. Using character counting (e.g., "How many ’p’s are in apple?”) as a controlled task, we find a consistent pattern across Llama, Qwen, and Gemma in both base and instruction-tuned variants. The models compute the correct answer internally but fall back on degenerate output strategies, such as always predicting "1" or guessing uniformly among "1", "2", and "3". Probing classifiers, activation patching, and logit lens analysis show that character-level information is encoded in early and mid layers, then actively attenuated by a small set of later components, mainly the penultimate and final layer MLP and sometimes the final layer attention heads. The failure is not missing information or insufficient scale but structured interference in the computation graph, which explains why these errors persist under scaling and instruction tuning.
Anthology ID:
2026.findings-aacl.70
Volume:
Findings of the Association for Computational Linguistics: IJCNLP-AACL 2026
Month:
November
Year:
2026
Address:
Hengqin, China
Editors:
Yue Zhang, Ruifeng Xu, Ayu Purwarianti, Tong Rong, Jun Suzuki
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
1370–1391
Language:
URL:
https://aclanthology.org/2026.findings-aacl.70/
DOI:
Bibkey:
Cite (ACL):
Ayan Datta, Mounika Marreddy, Alexander Mehler, Zhixue Zhao, and Radhika Mamidi. 2026. From Early Encoding to Late Suppression: Interpreting LLMs on Character Counting Tasks. In Findings of the Association for Computational Linguistics: IJCNLP-AACL 2026, pages 1370–1391, Hengqin, China. Association for Computational Linguistics.
Cite (Informal):
From Early Encoding to Late Suppression: Interpreting LLMs on Character Counting Tasks (Datta et al., Findings 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.findings-aacl.70.pdf