mlsanityData to 14 Oct 2026

The Right Answer, the Wrong Direction: Why Transformers Fail at Counting and How to Fix It

arXiv 2605.03258 ↗First posted 5 May 2026cs.LG cs.CLcited by 1

Not on the map. Why?

Abstract (arXiv)

Large language models often fail at simple counting tasks, even when items to count are in the prompt. We investigate whether this failure occurs because transformers do not represent counts internally, or because they cannot convert representations to the correct output tokens. Across three model families: Pythia, Qwen3, and Mistral, ranging from 0.4B to 14B parameters, we find evidence for the second explanation. Linear probes recover the correct count from intermediate layers with R2>0.99, showing that the information is present. However, the internal directions that encode counts are nearly orthogonal to digit-token output-head rows (|cos| ≤ 0.032). In other words, the model stores the count in a form that the digit logits do not naturally read out. We localize this failure with two interventions. Updating only the digit rows of the output head (36,864 parameters) substantially improves constrained digit prediction (60.7--100.0% on four tasks), but it does not fix unconstrained generation (0%); we do not claim that digit-row repair fixes open-ended text. By contrast, small LoRA on attention Q/V (7.67M parameters) improves upstream routing and achieves 83.1%±7.2% in true greedy autoregressive generation (deployable fix). Logit-lens at layer 35 (entity counting; correct-digit rank): (i) median over 3 seeds drops from order-104 to 1; (ii) seed 42 shows 54,332 → 838 (median top-1 while one seed stays far below). Norm, logit-lens, and cross-task analyses generalize the bottleneck to counting, addition, and list length; nulls on MMLU and GSM8K and limited DROP transfer. These results identify counting failure as a geometric readout bottleneck, not an internal-representation failure: the model knows the count but the output pathway is misaligned with tokens needed to express it.

Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 19 of its 23 references that are in the map. First posted on arXiv 5 May 2026.

Builds on

19 of 23 references.

References · 19

  1. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  2. 2023Mistral 7Bcited by 3,164
  3. 2022Locating and Editing Factual Associations in GPTcited by 2,691
  4. 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,786
  5. 2016Understanding intermediate layers using linear classifier probescited by 1,353
  6. 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
  7. 2022Toy Models of Superpositioncited by 971
  8. 2023Progress measures for grokking via mechanistic interpretabilitycited by 839
  9. 2022Discovering Latent Knowledge in Language Models Without Supervisioncited by 767
  10. 2023Towards Automated Circuit Discovery for Mechanistic Interpretabilitycited by 724
  11. 2023The Linear Representation Hypothesis and the Geometry of Large Language Modelscited by 716
  12. 2019Designing and Interpreting Probes with Control Taskscited by 640
7 more
  1. 2023Eliciting Latent Predictions from Transformers with the Tuned Lenscited by 623
  2. 2022Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Spacecited by 532
  3. 2016Using the Output Embedding to Improve Language Modelscited by 272
  4. 2023Linearity of Relation Decoding in Transformer Language Modelscited by 200
  5. 2019Do NLP Models Know Numbers? Probing Numeracy in Embeddingscited by 159
  6. 2023Jump to Conclusions: Short-Cutting Transformers With Linear Transformationscited by 90
  7. 2023A Mechanistic Interpretation of Arithmetic Reasoning in Language Models using Causal Mediation Analysiscited by 89

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2024Counting Ability of Large Language Models and Impact of Tokenization
  2. 2026From Early Encoding to Late Suppression: Interpreting LLMs on Character Counting Tasks
  3. 2026Repeated-Token Counting Reveals a Dissociation Between Representations and Outputs
  4. 2026The Count Is There, but Misaligned: Understanding and Correcting Counting Failures in VLMs
  5. 2024Language Models Need Inductive Biases to Count Inductively
  6. 2026Mechanistic Interpretability of Large-Scale Counting in LLMs through a System-2 Strategy
  7. 2024Language Models Encode the Value of Numbers Linearly
  8. 2026Counting to Four is still a Chore for VLMs