让大模型更聪明地用记忆:自动整理检索结果成清晰证据链。
MemChain: Learning Interpretable Memory Traces for Memory-Augmented LLM Agents

- 检索后用可训练策略生成有逻辑的证据链,替代直接堆叠记忆。
- 在长记忆任务中减少传递给回答模型的上下文量,性能领先。
- 适合需要长期记忆与可解释性的大模型应用,如智能助手。
记忆增强型大模型代理通常通过检索相关记忆并直接输入答案模型来回答问题。这种‘检索即证据’范式假设检索到的记忆已适合作答,导致答案模型需处理冗余、冲突和弱相关性,且在长期记忆任务中产生大量上下文开销。我们提出MemChain,一种可训练的后检索记忆策略,将检索候选转化为面向答案的主动记忆,以紧凑且具根基的证据上下文形式呈现。给定用户查询和检索结果,MemChain首先生成条件化的证据计划,再构建有序的语义依赖证据链,最后执行显式记忆操作生成简洁证据上下文。为训练该策略,我们引入两阶段学习框架:监督式轨迹学习先教授生成结构有效计划、轨迹、动作与证据上下文;随后提出基于轨迹引导的记忆策略优化(TMPO),通过强化学习优化记忆策略,同时提升下游答案质量、轨迹根基性、证据支持度、结构有效性及多轮次下的答案稳定性。在LoCoMo与LongMemEval-S上的实验表明,MemChain在闭源与开源冻结答案模型上均达到当前最优性能,显著减少传递给答案模型的内存上下文。
原文摘要 · Abstract (English)
Memory-augmented LLM agents typically answer queries by retrieving relevant memories and feeding them directly to an answer model. This retrieval-as-evidence paradigm assumes retrieved memories are already suitable for reasoning, leaving the answer model to resolve redundancy, conflicts, and weak relevance while incurring substantial context overhead in long-term memory tasks. We propose MemChain, a trainable post-retrieval memory policy that transforms retrieved candidates into answer-facing active memory, represented as a compact and grounded evidence context. Given a user query and retrieved candidates, MemChain first generates a question-conditioned evidence plan, then constructs an ordered grounded evidence trace that organizes retrieved memories according to their semantic roles and dependencies, and finally executes explicit memory actions to produce a concise evidence context for answer generation. To train the mediator, we introduce a two-stage learning framework. Supervised trace learning first teaches the policy to generate structurally valid plans, traces, actions, and evidence contexts. We then propose Trace-Guided Memory Policy Optimization (TMPO), a reinforcement learning objective that optimizes the memory policy using downstream answer quality while jointly encouraging trace grounding, evidence support, structural validity, and answer stability across multiple rollouts. Experiments on LoCoMo and LongMemEval-S demonstrate that MemChain consistently achieves state-of-the-art performance across both closed-source and open-weight frozen answer models while substantially reducing the memory context passed to the answer model.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。