Mechanistic Interpretability of Large-Scale Counting in LLMs through a System-2 Strategy
该论文提出了一种基于系统-2认知过程的简单测试时间策略,通过将大型计数任务分解为更小的子任务来提高大型语言模型在计数任务中的准确性。
更新于 2026-01-13。作者:Hosein Hasani、Mohammadali Banayeeanzade、Ali Nafisi、Sadegh Mohammadian、Fatemeh Askari、Mobin Bagherian、Amirmohammad Izadi、Mahdieh Soleymani Baghshah。
中文摘要
大型语言模型(LLMs)虽然在复杂数学问题上的表现强劲,但在计数任务中却表现出系统性限制。这个问题源于变换器架构的限制,计数是在层之间进行的,由于深度限制,对于较大的计数问题,精度会下降。为了解决这个限制,我们提出了一种简单的测试时策略,该策略受制于System-2认知过程的启发,将大型计数任务分解成更小的、独立的子问题,这些子问题模型可以可靠地解决。我们使用观察法和因果中介分析来评估这种方法,以了解这种类似System-2策略的潜在机制。我们的机制分析确定了关键组成部分:潜在计数被计算并存储在每个部分的最终项目表示中,通过专门的注意力头来传递到中间步骤,并在最终阶段汇总以产生总数。实验结果表明,这种策略使LLMs能够超越架构限制,在大规模计数任务上实现高精度。这项工作为LLMs中的System-2计数提供了机制见解,并提出了一种可推广的方法,用于改进和理解它们的推理行为。
英文摘要
Large language models (LLMs), despite strong performance on complex mathematical problems, exhibit systematic limitations in counting tasks. This issue arises from architectural limits of transformers, where counting is performed across layers, leading to degraded precision for larger counting problems due to depth constraints. To address this limitation, we propose a simple test-time strategy inspired by System-2 cognitive processes that decomposes large counting tasks into smaller, independent sub-problems that the model can reliably solve. We evaluate this approach using observational and causal mediation analyses to understand the underlying mechanism of this System-2-like strategy. Our mechanistic analysis identifies key components: latent counts are computed and stored in the final item representations of each part, transferred to intermediate steps via dedicated attention heads, and aggregated in the final stage to produce the total count. Experimental results demonstrate that this strategy enables LLMs to surpass architectural limitations and achieve high accuracy on large-scale counting tasks. This work provides mechanistic insight into System-2 counting in LLMs and presents a generalizable approach for improving and understanding their reasoning behavior.
解读
一句话总结
该论文提出了一种基于系统-2认知过程的简单测试时间策略,通过将大型计数任务分解为更小的子任务来提高大型语言模型在计数任务中的准确性。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:大型语言模型(LLMs)在计数任务中表现出系统性限制,这源于变压器架构的局限性,导致在较大计数问题中精度下降。
- 现有方案不足:LLMs的计数机制依赖于层级的累积,随着项目数量的增加,这种渐进式计数机制会饱和。
- 研究目标:通过分解大型计数任务为更小的子任务,提高LLMs在计数任务中的准确性。
问题2:论文的核心创新点是什么?
- 技术创新:提出了一种基于系统-2认知过程的测试时间策略,将大型计数任务分解为更小的子任务。
- 方法改进:通过外部分隔符将输入列表划分为更小的分区,每个分区由模型独立计数,然后汇总结果。
- 优势:与现有方法相比,这种方法能够显著提高LLMs在大型计数任务中的准确性,而无需修改模型参数或训练程序。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:在多种LLMs上进行了行为实验,包括开源和闭源模型。
- 性能提升:实验结果表明,该方法在大型计数任务中实现了更高的准确性,尤其是在复杂场景中。
- 对比结果:与未使用此策略的模型相比,使用该策略的模型在大型计数任务中取得了显著的性能提升。
问题4:这个研究的实际应用价值是什么?
- 应用场景:该策略可以应用于需要精确计数的场景,如长度受限的摘要、序列枚举和更广泛的数值/算术推理。
- 实施建议:建议在LLMs的计数任务中使用这种分解和汇总的策略,以提高准确性。
- 局限与展望:该方法依赖于结构化提示,可能限制了泛化能力。未来的研究可以探索更通用的解决方案,并进一步探索其在复杂推理任务中的应用。
来源
机器可读索引:llms.txt