Thought-Retriever: Don't Just Retrieve Raw Data, Retrieve Thoughts for Memory-Augmented Agentic Systems

📄 arXiv: 2604.12231v1 📥 PDF

作者: Tao Feng, Pengrui Han, Guanyu Lin, Ge Liu, Jiaxuan You

分类: cs.CL, cs.IR

发布日期: 2026-04-14

期刊: Transactions on Machine Learning Research (TMLR), 04/2026


💡 一句话要点

Thought-Retriever:通过检索思维而非原始数据,增强记忆增强型Agentic系统

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

关键词: 检索增强学习 长期记忆 大型语言模型 思维检索 知识问答

📋 核心要点

  1. 现有检索增强的LLM受限于上下文长度,无法有效利用海量外部知识,阻碍了其在复杂任务中的应用。
  2. Thought-Retriever通过检索LLM在过去交互中产生的“思维”,构建长期记忆,从而突破上下文长度限制。
  3. 实验表明,Thought-Retriever在学术问答等任务中显著优于现有方法,并能实现LLM的自我进化。

📝 摘要(中文)

大型语言模型(LLMs)凭借其强大的内部能力和知识,已经改变了人工智能研究。然而,现有的LLMs在与世界交互时,仍然无法有效地整合海量的外部知识。虽然提出了检索增强的LLMs来缓解这个问题,但它们仍然受到LLMs上下文长度的根本限制,因为它们只能从通常由数百万个数据块组成的外部知识库中检索前K个原始数据块。本文提出了Thought-Retriever,一种新颖的、模型无关的算法,它可以帮助LLMs生成以任意长度的外部数据为条件的输出,而不受上下文长度或检索到的数据块数量的限制。我们的关键见解是让LLM充分利用其在解决过去用户查询时生成的中间响应(思维),过滤无意义和冗余的思维,将它们组织在思维记忆中,并在处理新查询时检索相关的思维。这有效地为基于LLM的Agent配备了一个自我进化的长期记忆,该记忆通过持续的交互变得更加强大。除了算法创新之外,我们还精心准备了一个新的基准测试AcademicEval,它要求LLM忠实地利用超长上下文来回答基于真实学术论文的查询。在AcademicEval和另外两个公共数据集上的大量实验验证了Thought-Retriever显著优于最先进的基线,在各种任务中,F1得分平均提高了至少7.6%,胜率提高了16%。更重要的是,我们进一步展示了两个令人兴奋的发现:(1)Thought-Retriever确实可以帮助LLM在解决更多用户查询后自我进化;(2)Thought-Retriever学会利用更深层次的思维来回答更抽象的用户查询。

🔬 方法详解

问题定义:现有检索增强的语言模型在处理需要利用大量外部知识的任务时,受限于LLM的上下文长度。它们只能检索少量原始数据块,无法有效利用海量外部知识,导致性能瓶颈。现有方法无法有效组织和利用LLM自身产生的中间推理过程(即“思维”),造成信息浪费。

核心思路:Thought-Retriever的核心思路是让LLM将过去解决问题时产生的中间响应(“思维”)存储起来,形成一个长期记忆。当面对新的查询时,LLM不再仅仅检索原始数据,而是检索与当前查询相关的“思维”。这样可以突破上下文长度的限制,并有效利用LLM自身的推理能力。

技术框架:Thought-Retriever包含以下主要模块:1) 思维生成:LLM在解决用户查询时,生成一系列中间响应(“思维”)。2) 思维过滤:过滤掉无意义和冗余的“思维”,保留有价值的信息。3) 思维组织:将过滤后的“思维”组织成一个长期记忆,例如使用向量数据库进行存储。4) 思维检索:当接收到新的查询时,从长期记忆中检索与查询相关的“思维”。5) 答案生成:LLM利用检索到的“思维”和原始查询,生成最终答案。

关键创新:Thought-Retriever最重要的创新点在于它改变了检索的对象,从原始数据块变为LLM自身的“思维”。这种方法可以突破上下文长度的限制,并有效利用LLM的推理能力。与现有方法相比,Thought-Retriever能够构建一个自我进化的长期记忆,使LLM能够随着交互的进行而变得更加强大。

关键设计:思维过滤可以使用多种方法,例如基于相似度的过滤或基于重要性的过滤。思维组织可以使用向量数据库,例如FAISS或Annoy。思维检索可以使用相似度搜索或语义搜索。具体参数设置需要根据具体任务进行调整。论文中提出的AcademicEval基准测试,精心设计了需要利用超长上下文的学术问答任务,为Thought-Retriever的评估提供了有效的平台。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

在AcademicEval基准测试中,Thought-Retriever显著优于现有方法,F1得分平均提高了至少7.6%,胜率提高了16%。实验还表明,Thought-Retriever可以帮助LLM在解决更多用户查询后自我进化,并且能够利用更深层次的思维来回答更抽象的用户查询。这些结果验证了Thought-Retriever的有效性和潜力。

🎯 应用场景

Thought-Retriever具有广泛的应用前景,例如智能客服、知识问答、科研助手等。它可以帮助LLM更好地利用外部知识,提高其在复杂任务中的性能。通过构建自我进化的长期记忆,Thought-Retriever可以使LLM在持续交互中不断学习和进步,从而实现更智能、更个性化的服务。

📄 摘要(原文)

Large language models (LLMs) have transformed AI research thanks to their powerful internal capabilities and knowledge. However, existing LLMs still fail to effectively incorporate the massive external knowledge when interacting with the world. Although retrieval-augmented LLMs are proposed to mitigate the issue, they are still fundamentally constrained by the context length of LLMs, as they can only retrieve top-K raw data chunks from the external knowledge base which often consists of millions of data chunks. Here we propose Thought-Retriever, a novel model-agnostic algorithm that helps LLMs generate output conditioned on arbitrarily long external data, without being constrained by the context length or number of retrieved data chunks. Our key insight is to let an LLM fully leverage its intermediate responses generated when solving past user queries (thoughts), filtering meaningless and redundant thoughts, organizing them in thought memory, and retrieving the relevant thoughts when addressing new queries. This effectively equips LLM-based agents with a self-evolving long-term memory that grows more capable through continuous interaction. Besides algorithmic innovation, we further meticulously prepare a novel benchmark, AcademicEval, which requires an LLM to faithfully leverage ultra-long context to answer queries based on real-world academic papers. Extensive experiments on AcademicEval and two other public datasets validate that Thought-Retriever remarkably outperforms state-of-the-art baselines, achieving an average increase of at least 7.6% in F1 score and 16% in win rate across various tasks. More importantly, we further demonstrate two exciting findings: (1) Thought-Retriever can indeed help LLM self-evolve after solving more user queries; (2) Thought-Retriever learns to leverage deeper thoughts to answer more abstract user queries.