跳到正文
arXiv cs.CL· Ziyan Yang, Taiwei Shi, Jieyu Zhao·· 10 小时前AI 评分55

GrepMem:用纯文本日志与 grep 实现无损无索引的长程智能体记忆

Forget Freely, Grep Later: Lossless, Index-Free Memory for Long-Horizon LLM Agents

AI 导读

研究者提出 GrepMem,一种由只追加的纯文本历史日志和正则表达式检索工具组成的无损、无索引记忆机制,不需要嵌入向量、检索索引、记忆抽取或额外模型。他们用强化学习在五种上下文管理策略下训练 Qwen3.5-9B,在 ContextBench 上取得 95-97% 准确率,而有损基线最高仅 21%,并在 BCP-Multi 上比 SUPO 的摘要方法高 8.8 个百分点。

正文 · 原文

View PDF HTML (experimental)

Abstract:Long-horizon LLM agents often exceed their context windows, forcing them to discard information that may be needed later. Existing context management strategies rely on summarization, masking, or structured memory, requiring decisions about what to preserve or how to retrieve it before future needs are known. However, these methods can introduce lossy compression, potentially discarding details needed for future tasks. To address this limitation, we introduce GrepMem, a simple, lossless, and index-free memory mechanism built on two components: an append-only plain-text log of the agent's complete history and a regular-expression search tool for on-demand recall. Unlike structured memory systems, GrepMem requires no embeddings, retrieval index, memory extraction, or additional models. We train Qwen3.5-9B with reinforcement learning under five context management strategies and evaluate on multi-question research sessions, long-stream recall, and agent-trajectory question answering. GrepMem achieves 95-97% accuracy on ContextBench, versus at most 21% for lossy baselines, and outperforms SUPO's summarization by 8.8 percentage points on BCP-Multi. GrepMem scales effectively to increasingly long input streams while remaining on the accuracy-token-cost Pareto frontier across all five evaluation tasks. Our results show that a plain-text log and grep provide a simple but competitive approach to long-horizon agent memory, without requiring complex structured memory infrastructure.
Comments: 17 pages, 6 figures, 6 tables. Ziyan Yang and Taiwei Shi contributed equally
Subjects: Computation and Language (cs.CL); Artificial Intelligence (cs.AI)
Cite as: arXiv:2611.25123 [cs.CL]
  (or arXiv:2611.25123v1 [cs.CL] for this version)
  https://doi.org/10.48550/arXiv.2611.25123

arXiv-issued DOI via DataCite (pending registration)

Submission history

From: Ziyan Yang [view email]
[v1] Wed, 18 Nov 2026 20:02:57 UTC (285 KB)

来源:arXiv cs.CL · arxiv.org