arXiv:2609.04915cs.AI2026-09

通过智能合并与打包,让大模型在有限上下文里表现接近全量记忆。

Compact-Memory LLM Agents via Online Max-Member Clustering and Atom-Aware Packing

  • 在线聚类+内容原子级打包,动态压缩记忆信息。
  • 在4k上下文预算下,仅用32%令牌达全量记忆83%效果。
  • 适合长对话、资源受限场景,显著优于主流流式记忆方案。

许多长周期大模型应用面临严格的提示词预算:延迟、成本和上下文长度限制使得完整上下文提示变得不切实际。关键问题不再是单纯的回忆能力,而是何种记忆设计能在紧凑内存条件下实现最优的质量-令牌权衡。本文提出RSM-full,一种面向强质量-令牌帕累托前沿的在线聚类记忆管道。该方法结合两种设计:基于余弦门控的“最大成员合并”写入规则,以及原子感知的分组上下文打包器。在主要的紧凑记忆基准AMA-Bench上,RSM-full在4k令牌预算下仅以32%的令牌开销达到全上下文83%的性能;在四种子平均测试中,相比最接近的流式聚类基线(Online K-Means)提升3.5–6.0个百分点(p<0.001),覆盖约2.6k–5k区间。三种子消融实验表明,大部分增益来自合并规则(比Online K-Means和匹配τ的DP-means高+5.7个百分点)和分组打包器(比扁平拼接高+5.0个百分点)。该模式在独立的长周期角色记忆基准RealMem上重现:相比Budget-RAG提升+0.69个百分点(p=0.006),与BM25-RAG持平(配对差值+0.27,p=0.47;我们不主张等效性),显著优于Streaming-Proto(+2.97)和最新复现的2025代理记忆基线A-MEM(+1.65,p<0.001)。总体而言,在2k–5k提示令牌范围内,紧凑记忆性能主要由流式记忆的合并方式与检索内容的组装策略决定。RSM-full在此区间定义了强有力的紧凑记忆帕累托前沿,更高令牌基线在该范围外仍更优。

原文摘要 · Abstract (English)

Many long-horizon LLM deployments face tight prompt budgets: latency, cost, and context limits make full-context prompting impractical as interaction length grows. The key question is then not raw recall alone, but which memory design gives the best quality--token trade-off in the compact-memory regime. We present \textbf{RSM-full}, an online clustered-memory pipeline designed for a strong quality--token Pareto point. RSM-full combines two design choices: a cosine-gated \emph{max-member merge} write rule and an atom-aware grouped context packer. On AMA-Bench, our primary compact-memory benchmark, it reaches $83%$ of Full-Context quality at $32%$ of the token cost at a $4$k budget; under four-seed averaging it beats the closest streaming-clustered baseline (Online K-Means) by $+3.5$--$6.0$,pp ($p{<}.001$) across the whole ${\sim}2.6$k--${\sim}5$k regime. Three-seed ablations show most of this gain comes from the merge rule ($+5.7$,pp over Online K-Means and matched-$\tau$ DP-means) and the grouped packer ($+5.0$,pp over flat concatenation). The pattern reproduces on RealMem, an independent long-horizon persona-memory benchmark: RSM-full improves on Budget-RAG ($+0.69$,pp, $p{=}.006$), is on par with BM25-RAG (paired $\Delta{=}{+}0.27$,pp, $p{=}.47$; we do \emph{not} claim BM25 equivalence in the equivalence-test sense), and significantly outperforms Streaming-Proto ($+2.97$,pp) and the closest reproduced 2025 agentic-memory baseline A-MEM ($+1.65$,pp, $p{<}.001$). Across benchmarks the message is consistent: under tight budgets, compact-memory performance is driven mainly by how streaming memories are merged and how retrieved content is assembled. Overall, RSM-full is most useful when answeroughly $2k$--$5k$ prompt tokens, where itdefines a strong compact-memory Pareto point; higher-token baselines remain stronger outside this regime.

大模型记忆紧凑上下文在线聚类提示优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。