arXiv:2503.09819cs.CL2025-03被引 5

利用注意力权重找回长文本中隐含信息,无需训练提升推理能力

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

  • 通过生成过程中的注意力权重定位隐含事实
  • 在多个数据集上显著提升长上下文推理准确率
  • 无需训练,适配各类大模型用于复杂推理任务

大语言模型的实际有效上下文长度远低于宣称容量,尤其在需要多步推理和整合长上下文信息的任务中表现不佳。尽管思维链(CoT)提示有一定效果,但我们的实验证明其未能完全解决该问题。分析发现,隐含事实召回失败是主要原因。有趣的是,生成的CoT token内部注意力权重能有效定位这些未被显式回忆的隐含事实。基于此,我们提出无需训练的新算法Attrieval,利用注意力权重从长上下文中检索相关事实并融入推理过程。此外,从CoT token中选择上下文片段进一步提升性能。实验表明,Attrieval在多种合成与真实世界问答数据集上均显著增强不同模型的长上下文推理能力。

原文摘要 · Abstract (English)

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.

长上下文推理增强注意力机制无训练

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