Counting Circuits: Mechanistic Interpretability of Visual Reasoning in Large Vision-Language Models

Liwei Che, Zhiyu Xue, Yihao Quan, Benlin Liu, Zeru Shi, Michelle Hurst, Jacob Feldman, Ruixiang Tang, Ranjay Krishna, Vladimir Pavlovic, [4pt] Rutgers University, [2pt] Equal contribution · 2026

Read Counting Circuits: Mechanistic Interpretability of Visual Reasoning in Large Vision-Language Models by Liwei Che, Zhiyu Xue, Yihao Quan, Benlin Liu, Zeru Shi, Michelle Hurst, Jacob Feldman, Ruixiang Tang, Ranjay Krishna, Vladimir Pavlovic, [4pt] Rutgers University, [2pt] Equal contribution (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2603-18523.txt.

Introduction

Che and co-authors probe how large vision-language models count objects, using mechanistic interpretability tools. Counting forces a model to find each item and sum them, a clean reasoning test. Models count small numbers precisely but estimate larger ones with noise, like humans. Visual Activation Patching and HeadLens reveal a shared counting circuit across visual tasks. Fine-tuning on synthetic counting images alone lifts out-of-distribution counting by 8.36% on average.

Catalog record

CREATORLiwei Che, Zhiyu Xue, Yihao Quan, Benlin Liu, Zeru Shi, Michelle Hurst, Jacob Feldman, Ruixiang Tang, Ranjay Krishna, Vladimir Pavlovic, [4pt] Rutgers University, [2pt] Equal contribution
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE83889
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2603.18523

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Counting Circuits: Mechanistic Interpretability of Visual Reasoning in Large Vision-Language Models Liwei Che, Zhiyu Xue, Yihao Quan, Benlin Liu, Zeru Shi, Michelle Hurst, Jacob Feldman, Ruixiang Tang, Ranjay Krishna, Vladimir Pavlovic, [4pt] Rutgers University, [2pt] Equal contribution Abstract Counting serves as a simple but powerful test of a Large Vision-Language Model’s (LVLM) reasoning; it forces the model to identify each individual object and then add them all up. In this study, we investigate how LVLMs implement counting using controlled synthetic and real-world benchmarks, combined with mechanistic analyses. Our results show that LVLMs display a human-like counting behavior, with precise performance on small numerosities and noisy estimation for larger quantities. We introduce two novel interpretability methods, Visual Activation Patching and HeadLens, and use them to uncover a structured “counting circuit” that is largely shared across a variety of visual reasoning tasks. Building on these insights, we propose a lightweight intervention strategy that exploits simple and abundantly available synthetic images to fine-tune arbitrary pretrained LVLMs exclusively on counting. Despite the narrow scope of this fine-tuning, the intervention not only enhances counting accuracy on in-distribution synthetic data, but also yields an average improvement of +8.36% on out-of-distribution counting benchmarks and an average gain of +1.54% on complex, general visual reasoning tasks for Qwen2.5-VL. These findings highlight the central, influential role of counting in visual reasoning and suggest a potential pathway for improving overall visual reasoning capabilities through targeted enhancement of counting mechanisms. 1 Introduction Counting is one of the most fundamental yet revealing capacities of visual intelligence. Cognitive science reveals that human numerosity perception is shaped by severe information-processing constraints, resulting in near-perfect accuracy for small sets (subitizing) and noisy estimation for larger quantities [ 6 ] . Recent work further demonstrates that these discontinuities arise not from separate cognitive modules, but from resource-rational trade-offs [ 20 ] between precision, exposure time, and environmental statistics, suggesting that counting reflects a core organizing principle of visual reasoning rather than a task-specific heuristic [ 7 ] . Recent LVLMs [ 21 , 3 ] have demonstrated remarkable generalization across diverse visual reasoning tasks [ 37 , 22 , 35 , 32 ] . However, our benchmarks ( table 1 ) reveal a surprising phenomenon: these models struggle to count even fewer than ten simple black dots, a trivial task for human vision. This discrepancy raises fundamental questions regarding the nature of counting ability in LVLMs and its relation to general visual reasoning. Unlike standard recognition, counting cannot be bypassed through semantic memorization or dataset priors. It strictly requires models to individuate discrete entities, maintain intermediate representations, and aggregate information under architectural constraints. Therefore, in this work, we utilize the counting task as a minimalist probe to investigate the internal visual reasoning process of LVLMs and explore how these mechanism discoveries can support more complex, high-level visual reasoning tasks. Figure 1 : Overview of Main Contributions Existing works often treat counting as an isolated task, attempting to improve the counting performance of LVLMs with methods like image preprocessing [ 28 ] , fine-tuning [ 27 ] , and attention intervention [ 30 ] . However, as specialized computer vision methods [ 39 , 15 ] undoubtedly yield better performance, we argue that understanding and evaluating the visual reasoning process of LVLMs via counting should be the primary focus. Closer work such as CountScope [ 13 ] and [De|Re] [ 1 ] heavily rely on probing methods to understand the counting pattern of LVLMs, which is unreliable due to the simplicity of the representation of their synthetic data. More importantly, they fail to understand the circuit-level mechanism of counting. Therefore, in this work, we investigate how LVLMs execute counting tasks from the dual perspectives of human cognitive alignment and mechanistic interpretability. First, we leverage the controllability of synthetic images to extend activation patching [ 14 ] to multimodal inputs. By tracing the flow of counting-related information across model layers, we reveal the cross-modal information routing occurring in the middle layers and the emergence of counting answers in the later layers. To further isolate and verify the roles of different model components, we propose HeadLens, a novel tool that interprets the output of attention heads into semantic tokens. Through this, we identify four critical categories of attention heads: (1) Visual Grounding Heads (Early Layers): Extract foundational visual features (color, shape) directly from image tokens. (2) Cross-Modal Routing Heads (Middle Layers): Translate visual information into abstract numerical concepts. (3) Counting Aggregation Heads (Late Layers): Attend heavily to text prompts; their top-10 HeadLens decoded tokens highly correlate with the final prediction. (4) Awareness Heads (Late Layers): Two specialized heads encoding object existence and difficulty estimations. Building on the interpretability findings, we design targeted intervention methods tailored to specific layers and heads via parameter tuning, attention regularization, and head temperature tuning. Utilizing 8,000 highly simplified synthetic images (e.g., black dots or colored polygons on a white canvas) that can be generated in minutes on a standard computer, our approach not only improves performance on synthetic data but also achieves up to an 8.36\% average accuracy increase on out-of-distribution (OOD) real-world object counting. Furthermore, it yields a 1.54\% average accuracy improvement across broader OOD visual tasks (e.g., general VQA, visual math). This demonstrates that counting serves as a vital foundational pillar of general visual intelligence and validates the existence of generalized visual reasoning mechanisms operating as internal circuits within LVLMs. Our main contributions are summarized as follows: Cognitive Alignment: Our investigation reveals that LVLMs exhibit a striking discontinuity in visual counting that mirrors human behavior, characterized by precise subitizing for small sets and noisy estimation for larger quantities. We ground the model’s behavioral failures in the topological entanglement of hidden state manifolds. Methodological Innovation: We propose Visual Activation Patching (VAP) and HeadLens, two novel mechanistic interpretability techniques designed to isolate head-specific functions and perform circuit discovery for LVLMs. Circuit Discovery: We identify four distinct functional categories of attention heads essential for visual counting: visual grounding , cross-modal routing , counting aggregation , and difficulty/existence detection . We further demonstrate that a great proportion of these specialized heads also serve as foundational components for general visual reasoning. Performance Enhancement: We develop an interpretability-inspired intervention strategy. Using only the simplest synthetic images, we significantly enhance the model’s OOD counting robustness and its performance on complex, general visual reasoning benchmarks. 2 Related Work 2.1 LVLMs for counting task. The strong general visual capabilities of LVLMs have sparked considerable attention to their counting performance. Early exploration [ 27 ] utilizes additional counting data to fine-tune the CLIP for better counting performance. LVLM-count [ 28 ] utilizes SAM [ 17 ] and a pixel search algorithm to preprocess the image into pieces for better counting performance. Guo et al. [ 12 ] explore the relationship between object types and quantities, revealing the compositional counting failure modes of LVLMs. More recent works explore the counting task via internal states analysis. CountScope [ 13 ] verified that LVLMs will accumulate counting information along the layers and tokens in a causal order due to the auto-regressive pattern, yet failed to provide circuit-level functionality understanding on how the internal mechanism actually works. [De|Re] [ 1 ] identified that the incorrect mapping

Read the complete text