让大模型代理记忆不生成任何中间文本,直接用原始对话记录推理。
Zero-Mem: Zero-Token Memory Operations for LLM Agents

- 记忆操作全程不调用大模型,零额外令牌消耗
- 通过实体-上下文图和时间层级结构双重组织对话记录
- 在长对话问答中性能接近顶尖,速度提升57.6%
大模型代理需要记忆以维持长期交互的一致性,但现有系统常通过额外的大模型调用操作记忆,生成中间记录并检索会带来重复的令牌和时间开销,而省略或合并细节可能掩盖原始证据。我们提出:结构化记忆访问是否必须生成?Zero-Mem引入零令牌记忆操作:除最终问答外,任何步骤均不调用大模型,也不消耗输入或输出令牌;编码计算单独计费。它将原始交互轨迹作为唯一记录源,以实体-上下文图揭示跨交互关联,以时间层次结构保留对话局部性和会话状态。每个查询同时权衡两种视图,从两者中检索,并依其结构恢复支持关系或上下文。确定性校准先剔除冲突证据,再确保回答基于检索到的轨迹。仅最终问答阅读器调用大模型。在长记忆与长上下文问答基准上,Zero-Mem实现竞争力表现,且完全消除记忆操作中的大模型调用与令牌消耗。相同问答阅读器和上下文预算下,相比最快基线,记忆操作时间成本降低57.6%。消融实验证明两种视图及其查询依赖协调均具贡献。结果表明,结构化代理记忆无需生成过去经历的中间表示。代码与实现细节将在同行评审后公开于 https://github.com/TheMoon0815/Zero-mem。
原文摘要 · Abstract (English)
LLM agents need memory to act consistently over long interactions, yet many systems use additional LLM calls to operate that memory. Generating intermediate records and mediating their retrieval adds recurring token and time costs, while omitted or merged details can obscure the original evidence. We ask whether structured memory access requires generation at all. Zero-Mem introduces \emph{zero-token memory operations}: no step outside final question answering invokes an LLM or consumes LLM input or output tokens; encoder computation is accounted for separately. Zero-Mem preserves original interaction traces as its source of record. It organizes the traces in two complementary ways. An entity--context graph exposes connections across interactions, while a temporal hierarchy preserves conversational locality and session state. For each query, Zero-Mem weighs the two views, retrieves from both, and follows their structure to recover supporting relations or surrounding context. Deterministic calibration first discards conflicting evidence and then keeps the reader's answer grounded in the retrieved traces. Only the final-QA reader invokes an LLM. Across long-memory and long-context question-answering benchmarks, Zero-Mem achieves competitive performance while eliminating LLM calls and LLM-token consumption from memory operations. With the same final-QA reader and context budget, it reduces memory-operation time cost by 57.6\% relative to the fastest compared baseline. Ablations support the contribution of the two views and their query-dependent coordination. Overall, the results show that structured agent memory need not generate an intermediate representation of the past. After peer review, the code and implementation details will be available at \textcolor{blue}{https://github.com/TheMoon0815/Zero-mem}.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。