Targeted Retrieval, Compact Representations: How CoT Reasoning Improves Long-Context Counting

📄 arXiv: 2609.38958v1 📥 PDF

作者: Liang Twist Shan, Tianyu Hu, Hao Yan, Yiqiao Zhong

分类: cs.AI, cs.CL, cs.LG, stat.AP

发布日期: 2026-09-30

备注: 73 pages, including references and appendices


💡 一句话要点

提出目标检索与紧凑表示以提升长文本计数精度

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 长文本处理 链式思维 目标检索 计数任务 信息提取 自然语言处理

📋 核心要点

  1. 现有方法在长文本计数任务中存在准确性不足的问题,尤其是在处理较大计数时表现不佳。
  2. 本文提出通过链式思维(CoT)推理实现目标检索,利用枚举方式逐一检索目标,提升计数精度。
  3. 实验结果表明,思维模型在计数准确性上显著优于非思维模型,尤其在较大计数时提升明显。

📝 摘要(中文)

大型语言模型(LLMs)在长文本任务中的表现迅速提升,得益于链式思维(CoT)推理。然而,这种提升的内部机制尚不明确。本文通过针在干草堆(NIAH)计数任务,探讨了思维与非思维模型在计数准确性上的差异,发现思维模型在较大计数时表现更优。我们识别出两种对比机制:广泛检索与目标检索,前者关注多个目标,后者则通过CoT追踪逐一检索目标。目标检索集中注意力于单个目标,并伴随更紧凑的内部表示。此外,因果干预分析表明,思维模型利用CoT追踪维护和更新内部计数器,即使没有显式编号。我们的结果将长文本检索与计数的表示几何联系起来,支持了CoT推理的状态跟踪理论。

🔬 方法详解

问题定义:本文旨在解决大型语言模型在长文本计数任务中的准确性不足,尤其是在处理分散记录时的挑战。现有方法往往无法有效集中注意力于单个目标,导致计数错误。

核心思路:论文提出通过链式思维(CoT)推理实现目标检索,利用思维模型的推理过程逐步检索目标,集中注意力于每个单独的目标,从而提升计数精度。

技术框架:整体架构包括两个主要阶段:首先是通过CoT推理生成的追踪过程,其次是基于该过程的目标检索。模型在训练过程中通过自回归方式学习,逐步更新内部计数器。

关键创新:最重要的技术创新在于识别并利用目标检索机制,思维模型通过CoT追踪实现对单个目标的集中检索,与传统的广泛检索方法形成鲜明对比。

关键设计:模型在训练时采用自回归训练策略,损失函数设计为优化计数准确性,网络结构上强调了对CoT追踪的有效利用,以实现更紧凑的内部表示。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,思维模型在长文本计数任务中相比非思维模型的准确性提升显著,尤其在较大计数时,准确率提高了约20%。这种提升表明目标检索机制在长文本处理中的有效性。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理中的信息检索、数据分析和智能问答系统。通过提升长文本计数的准确性,可以在法律文书、医学记录等领域实现更高效的信息提取和分析,具有重要的实际价值和未来影响。

📄 摘要(原文)

Large language models (LLMs) have been rapidly improving in long-context tasks, powered by Chain-of-Thought (CoT) reasoning. However, the internal mechanisms underlying this improvement remain unclear. We investigate these mechanisms through a needle-in-a-haystack (NIAH) counting task, where an LLM is asked to count the number of records dispersed in a long text. Across twelve model comparison groups, Thinking (or reasoning) improves counting accuracy over Non-thinking, with pronounced gains at larger counts. This motivates our mechanistic analysis, which identifies two contrasting mechanisms: (i) broad retrieval, where Non-thinking models broadly attend to multiple needles; (ii) targeted retrieval, where Thinking models use enumeration in CoT traces to successively retrieve needles. Targeted retrieval concentrates attention on individual needles and is accompanied by more compact internal representations. Moreover, causal intervention analysis suggests that Thinking models use the CoT trace to maintain and update an internal counter as needles are successively retrieved, even without explicit numbering. In small controlled experiments, both retrieval mechanisms and counter states emerge under standard autoregressive training. Together, our results connect long-context retrieval with representation geometry of counting, supporting a state-tracking account of CoT reasoning.