arXiv:2511.17699cs.CVcs.AI2025-11中稿 · CVPR被引 3

揭秘大模型如何自动数数,发现其内部计数机制的层级演化规律。

Understanding Counting Mechanisms in Large Language and Vision-Language Models

  • 通过可控实验和工具CountScope,解析模型在文本与图像中对数量的编码方式。
  • 低层编码小数量,高层逐步抽象出大数,最终计数信息存于最后一项。
  • 模型依赖分隔符等结构线索快速计数,适合研究可解释性与模型推理机制者。

计数是大型语言模型(LLMs)和视觉-语言模型(LVLMs)的基础能力之一。本文通过控制实验,使用重复的文本和视觉项目,结合行为、观察与因果中介分析,研究这些基础模型在计数任务中如何表征和计算数值信息。为此,我们设计了专用工具CountScope,用于数值内容的机制可解释性分析。结果表明,单个标记或视觉特征可编码潜在的位置计数信息,且可在不同上下文中提取与迁移。层间分析显示,数值表征呈渐进式涌现:底层编码小数,高层代表大数。我们识别出一个随每个项目更新的内部计数机制,主要存储于最后一个标记或区域。在LVLMs中,数值信息也出现在视觉嵌入中,其位置随空间布局在背景与前景间切换。此外,模型依赖文本中的分隔符等结构线索作为计数捷径,显著影响数值预测的准确性。总体而言,计数在LLMs中表现为结构化、分层的过程,在LVLMs中遵循相似模式,受视觉编码器特性影响。

原文摘要 · Abstract (English)

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.

模型可解释性计数机制视觉语言模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。