让大模型像人一样分步计数,突破自身精度瓶颈
Mechanistic Interpretability of Large-Scale Counting in LLMs through a System-2 Strategy
- 用分步拆解法模拟人类系统2思维,提升计数能力
- 在100+计数任务中准确率显著提升,突破深度限制
- 适合研究模型推理机制或改进复杂计算能力的学者
大型语言模型(LLMs)虽在复杂数学问题上表现优异,但在计数任务中存在系统性局限。这源于Transformer架构的深层限制:计数需跨层完成,导致大数量问题精度下降。为此,我们提出一种受人类系统2认知启发的测试时策略,将大规模计数任务分解为多个独立的小任务,由模型可靠求解。通过观察与因果中介分析,我们揭示了该策略的机制:各部分的隐式计数被存储于最终项表示中,经专用注意力头传递至中间步骤,并在最终阶段聚合得出总数。实验表明,该策略使模型突破架构限制,在100+规模计数任务中实现更高准确率。本工作提供了对LLM系统2计数行为的机制解析,提出了一种可推广的推理增强方法。
原文摘要 · Abstract (English)
Large language models (LLMs), despite strong performance on complex mathematical problems, exhibit systematic limitations in counting tasks. This issue arises from the 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 higher 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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。