让大模型学会检索思考而非原始数据,实现无限长记忆。
Thought-Retriever: Don't Just Retrieve Raw Data, Retrieve Thoughts for Memory-Augmented Agentic Systems
- 用模型过往的思考过程构建可检索的记忆库
- 在学术问答上提升7.6%准确率和16%胜率
- 适合需要长期学习与抽象推理的应用场景
大语言模型虽具备强大能力,但在与外部世界交互时仍难以有效利用海量外部知识。现有检索增强方法受限于上下文长度,仅能检索前K个原始数据块,而这些数据块可能达数百万。本文提出Thought-Retriever,一种模型无关算法,使大模型能基于任意长的外部数据生成输出,突破上下文长度和检索数量限制。核心思想是让模型利用过去回答用户问题时生成的中间响应(即思考),过滤冗余内容,组织成思考记忆,并在新任务中检索相关思考。这赋予基于大模型的智能体持续进化的长期记忆能力。我们还构建了新基准AcademicEval,要求模型基于真实学术论文的超长上下文作答。在AcademicEval及另外两个公开数据集上的实验表明,Thought-Retriever显著优于现有基线,平均F1得分提升至少7.6%,胜率提升16%。更重要的是,我们发现:(1) 随着处理更多查询,模型能自我进化;(2) 模型学会利用更深层次的思考应对更抽象的问题。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。