Saved in:
Bibliographic Details
Main Authors: Hasani, Hosein, Izadi, Amirmohammad, Askari, Fatemeh, Bagherian, Mobin, Mohammadian, Sadegh, Izadi, Mohammad, Baghshah, Mahdieh Soleymani
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2511.17699
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910148033773568
author Hasani, Hosein
Izadi, Amirmohammad
Askari, Fatemeh
Bagherian, Mobin
Mohammadian, Sadegh
Izadi, Mohammad
Baghshah, Mahdieh Soleymani
author_facet Hasani, Hosein
Izadi, Amirmohammad
Askari, Fatemeh
Bagherian, Mobin
Mohammadian, Sadegh
Izadi, Mohammad
Baghshah, Mahdieh Soleymani
contents Counting is one of the fundamental abilities of large language models (LLMs) and large vision-language models (LVLMs). This paper examines how these foundation models represent and compute numerical information in counting tasks. We use controlled experiments with repeated textual and visual items and analyze counting in LLMs and LVLMs through a set of behavioral, observational, and causal mediation analyses. To this end, we design a specialized tool, CountScope, for the mechanistic interpretability of numerical content. Results show that individual tokens or visual features encode latent positional count information that can be extracted and transferred across contexts. Layerwise analyses reveal a progressive emergence of numerical representations, with lower layers encoding small counts and higher layers representing larger ones. We identify an internal counter mechanism that updates with each item, stored mainly in the final token or region. In LVLMs, numerical information also appears in visual embeddings, shifting between background and foreground regions depending on spatial composition. We further reveal that models rely on structural cues such as separators in text, which act as shortcuts for tracking item counts and strongly influence the accuracy of numerical predictions. Overall, counting emerges as a structured, layerwise process in LLMs and follows the same general pattern in LVLMs, shaped by the properties of the vision encoder.
format Preprint
id arxiv_https___arxiv_org_abs_2511_17699
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Understanding Counting Mechanisms in Large Language and Vision-Language Models
Hasani, Hosein
Izadi, Amirmohammad
Askari, Fatemeh
Bagherian, Mobin
Mohammadian, Sadegh
Izadi, Mohammad
Baghshah, Mahdieh Soleymani
Computer Vision and Pattern Recognition
Artificial Intelligence
Counting is one of the fundamental abilities of large language models (LLMs) and large vision-language models (LVLMs). This paper examines how these foundation models represent and compute numerical information in counting tasks. We use controlled experiments with repeated textual and visual items and analyze counting in LLMs and LVLMs through a set of behavioral, observational, and causal mediation analyses. To this end, we design a specialized tool, CountScope, for the mechanistic interpretability of numerical content. Results show that individual tokens or visual features encode latent positional count information that can be extracted and transferred across contexts. Layerwise analyses reveal a progressive emergence of numerical representations, with lower layers encoding small counts and higher layers representing larger ones. We identify an internal counter mechanism that updates with each item, stored mainly in the final token or region. In LVLMs, numerical information also appears in visual embeddings, shifting between background and foreground regions depending on spatial composition. We further reveal that models rely on structural cues such as separators in text, which act as shortcuts for tracking item counts and strongly influence the accuracy of numerical predictions. Overall, counting emerges as a structured, layerwise process in LLMs and follows the same general pattern in LVLMs, shaped by the properties of the vision encoder.
title Understanding Counting Mechanisms in Large Language and Vision-Language Models
topic Computer Vision and Pattern Recognition
Artificial Intelligence
url https://arxiv.org/abs/2511.17699