arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2511.17699cs.CVcs.AI
收藏

理解大语言和视觉-语言模型中的计数机制

Understanding Counting Mechanisms in Large Language and Vision-Language Models

Sharif University of Technology(谢里夫大学)

Hosein Hasani, Amirmohammad Izadi, Fatemeh Askari, Mobin Bagherian, Sadegh Mohammadian, Mohammad Izadi, Mahdieh Soleymani Baghshah

AI总结:

本文研究大语言和视觉-语言模型在计数任务中如何表示和计算数值信息,通过实验和分析揭示了计数机制的分层结构及内部计数器的作用。

摘要:

计数是大语言模型(LLMs)和大视觉-语言模型(LVLMs)的基本能力之一。本文探讨了这些基础模型在计数任务中如何表示和计算数值信息。我们通过受控实验和重复的文本和视觉项目,分析了LLMs和LVLMs的计数过程,通过行为、观察和因果中介分析。为此,我们设计了专门的工具CountScope,用于数值内容的机制可解释性。结果表明,单个标记或视觉特征编码了潜在的位置计数信息,可以跨上下文提取和转移。分层分析揭示了数值表示的逐步出现,低层编码小计数,高层表示更大的计数。我们识别出一个内部计数器机制,随着每个项目更新,主要存储在最终标记或区域中。在LVLMs中,数值信息也出现在视觉嵌入中,根据空间组成在背景和前景区域之间转移。我们进一步揭示模型依赖于结构线索,如文本中的分隔符,这些线索作为跟踪项目计数的快捷方式,并强烈影响数值预测的准确性。总体而言,计数在LLMs中表现为结构化的、分层的过程,在LVLMs中遵循相同的总体模式,受视觉编码器属性的影响。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑