arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.09819cs.CL
收藏

注意力揭示的信息超越 Token:基于注意力引导检索的免训练长上下文推理

Attention Reveals More Than Tokens: Training-Free Long-Context Reasoning with Attention-guided Retrieval

University of California, San Diego(加利福尼亚大学圣迭戈分校);Cisco(思科公司)

Yuwei Zhang, Jayanth Srinivasa, Gaowen Liu, Jingbo Shang

AI总结:

针对 LLM 长上下文推理中隐含事实召回不足的问题,提出免训练的 Attrieval,利用 CoT token 的注意力权重检索并注入相关事实,显著提升多模型在合成与真实 QA 数据集上的表现。

摘要:

大型语言模型(LLM)的有效上下文长度通常明显短于其宣称的能力,尤其是在处理复杂推理任务时;这类任务需要整合长上下文中多个部分的信息并执行多步推理。尽管 Chain-of-Thought(CoT,思维链)提示在降低任务复杂性方面显示出潜力,但我们的实证分析表明,它并未完全解决这一限制。通过受控实验,我们发现对隐含事实的召回不佳是失败的主要原因,这显著妨碍了推理性能。有趣的是,我们观察到,由已生成 CoT token 产生的内部注意力权重能够有效锚定隐含事实,即使这些事实没有被显式召回。基于这一洞见,我们提出一种新颖的免训练算法 Attrieval,该算法利用注意力权重从长上下文中检索相关事实,并将其纳入推理过程。此外,我们发现从 CoT token 中选择上下文 token 可进一步提升性能。我们的结果表明,在多种模型上,Attrieval 在合成和真实世界 QA 数据集上均显著增强了长上下文推理能力。

英文摘要:

Large Language Models (LLMs) often exhibit substantially shorter effective context lengths than their claimed capacities, especially when handling complex reasoning tasks that require integrating information from multiple parts of a long context and performing multi-step reasoning. Although Chain-of-Thought (CoT) prompting has shown promise in reducing task complexity, our empirical analysis reveals that it does not fully resolve this limitation. Through controlled experiments, we identify poor recall of implicit facts as the primary cause of failure, which significantly hampers reasoning performance. Interestingly, we observe that the internal attention weights from the generated CoT tokens can effectively ground implicit facts, even when these facts are not explicitly recalled. Building on this insight, we propose a novel training-free algorithm, Attrieval, which leverages attention weights to retrieve relevant facts from the long context and incorporates them into the reasoning process. Additionally, we find that selecting context tokens from CoT tokens further improves performance. Our results demonstrate that Attrieval enhances long-context reasoning capability notably on both synthetic and real-world QA datasets with various models.

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

↑