让大模型在推理时主动检索上下文,解决越想越乱的‘思维迷失’问题。
RecaLLM: Addressing the Lost-in-Thought Phenomenon with Explicit In-Context Retrieval

- 推理与检索交替进行,用显式检索支撑每一步推理
- 在128K上下文窗口下性能超越基线,训练仅用10K token数据
- 适合需要长文本理解与精准引用的复杂推理任务
我们提出RecallLM,一种通过后训练使大模型更有效利用长上下文信息的推理语言模型。在上下文检索中,识别相关证据与推理过程紧密交织:检索支持推理,而推理也决定需检索的内容。但在初步实验中发现,即使经过短短几轮推理,上下文检索性能也会显著下降,这构成了测试时扩展的关键瓶颈,我们称之为‘思维迷失’现象。为解决此问题,RecallLM将推理与显式上下文检索交替进行,交替执行推理和获取解决中间子问题所需的上下文信息。我们引入一种开销极小的约束解码机制,实现证据片段的原样复制,增强后续生成的可追溯性。在多种词汇与语义检索任务上训练后,RecallLM在两个长上下文基准RULER和HELMET上表现优异,显著优于基线。值得注意的是,其在高达128K token的上下文窗口中仍保持一致提升,而训练样本最长仅10K token,远低于现有长上下文方法所需,展示了无需昂贵长文本训练数据即可提升长上下文能力的可行路径。
原文摘要 · Abstract (English)
We propose RecaLLM, a set of reasoning language models post-trained to make effective use of long-context information. In-context retrieval, which identifies relevant evidence from context, and reasoning are deeply intertwined: retrieval supports reasoning, while reasoning often determines what must be retrieved. However, their interaction remains largely underexplored. In preliminary experiments on several open-source LLMs, we observe that in-context retrieval performance substantially degrades even after a short reasoning span, revealing a key bottleneck for test-time scaling that we refer to as lost-in-thought: reasoning steps that improve performance also make subsequent in-context retrieval more challenging. To address this limitation, RecaLLM interleaves reasoning with explicit in-context retrieval, alternating between reasoning and retrieving context information needed to solve intermediate subproblems. We introduce a negligible-overhead constrained decoding mechanism that enables verbatim copying of evidence spans, improving the grounding of subsequent generation. Trained on diverse lexical and semantic retrieval tasks, RecaLLM achieves strong performance on two long-context benchmarks, RULER and HELMET, significantly outperforming baselines. Notably, we observe consistent gains at context windows of up to 128K tokens using training samples of at most 10K tokens, far shorter than those used by existing long-context approaches, highlighting a promising path toward improving long-context performance without expensive long-context training data.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。