Memex(RL): 通过索引经验记忆扩展长周期LLM代理
Memex(RL): Scaling Long-Horizon LLM Agents via Indexed Experience Memory
AI总结:
Memex(RL)通过索引经验记忆机制,实现长周期LLM代理的高效记忆管理,减少信息损失并提升任务成功率。
摘要:
大型语言模型(LLM)代理在长周期任务中受到有限上下文窗口的限制。随着轨迹的增长,保留工具输出和中间推理的上下文很快变得不可行:工作上下文变得过于冗长,最终超出上下文预算,即使存在远距离证据,也难以使用。现有解决方案通常通过截断或运行摘要来缩短上下文,但这些方法本质上是损失性的,因为它们压缩或丢弃了过去的证据本身。我们引入了Memex,一种索引经验记忆机制,它通过压缩上下文而不丢弃证据。Memex维护一个由简洁结构化摘要和稳定索引组成的紧凑工作上下文,同时在这些索引下存储完整的底层交互记录在外部经验数据库中。代理可以根据需要解引用索引,以恢复当前子目标所需的精确过去证据。我们通过我们的强化学习框架MemexRL优化写入和读取行为,使用针对索引内存使用和上下文预算定制的奖励塑造,使代理学会如何总结、如何归档、如何索引以及何时检索。这产生了比仅总结方法更少损失的长周期记忆形式。我们进一步提供了一个理论分析,展示了Memex循环在保持决策质量的同时,能够通过有限的解引用保持有效的上下文计算。在具有挑战性的长周期任务中,使用MemexRL训练的Memex代理在使用显著更小的工作上下文中提高了任务成功率。
英文摘要:
Large language model (LLM) agents are fundamentally bottlenecked by finite context windows on long-horizon tasks. As trajectories grow, retaining tool outputs and intermediate reasoning in-context quickly becomes infeasible: the working context becomes prohibitively long, eventually exceeds the context budget, and makes distant evidence harder to use even when it is still present. Existing solutions typically shorten context through truncation or running summaries, but these methods are fundamentally lossy because they compress or discard past evidence itself. We introduce Memex, an indexed experience memory mechanism that instead compresses context without discarding evidence. Memex maintains a compact working context consisting of concise structured summaries and stable indices, while storing full-fidelity underlying interactions in an external experience database under those indices. The agent can then decide when to dereference an index and recover the exact past evidence needed for the current subgoal. We optimize both write and read behaviors with our reinforcement learning framework MemexRL, using reward shaping tailored to indexed memory usage under a context budget, so the agent learns what to summarize, what to archive, how to index it, and when to retrieve it. This yields a substantially less lossy form of long-horizon memory than summary-only approaches. We further provide a theoretical analysis showing the potential of the Memex loop to preserve decision quality with bounded dereferencing while keeping effective in-context computation bounded as history grows. Empirically, on challenging long-horizon tasks, Memex agent trained with MemexRL improves task success while using a significantly smaller working context.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。