arXiv:2603.13017cs.AIcs.CL2026-03

将用户对话压缩至1/11长度,还能精准检索。

Structured Distillation for Personalized Agent Memory: 11x Token Reduction with Retrieval Preservation

  • 用四字段结构化压缩每段对话,平均仅38词
  • 4182次对话压缩后仍保持96%检索效果
  • 适合需要长期记忆的AI助手开发者

长对话会积累大量历史数据,直接保存成本高。本文研究个性化代理记忆:将单个用户的对话历史压缩为可检索的紧凑层。每段对话被转化为包含四个字段的复合对象(exchange_core, specific_context, thematic_room_assignments, regex-extracted files_touched)。压缩后的可搜索文本平均每条38词。在6个软件工程项目的4,182次对话(共14,340次交互)上应用,平均每条对话长度从371词降至38词,实现11倍压缩。通过201个召回查询、107种配置(5种纯模式和5种跨层模式)、5个LLM评分器(共214,519对共识评分),评估压缩后的召回能力。最佳纯压缩配置达到基准原始文本MRR的96%(0.717 vs 0.745)。所有向量搜索配置经邦弗朗尼校正后均不显著,而所有BM25配置显著退化(效应量|d|=0.031-0.756)。最佳跨层方案略超最优原始基线(MRR 0.759)。结构化蒸馏在降低1/11上下文开销的同时,保留了有效检索能力。数千条交互可纳入单个提示,原始数据仍可用于深入分析。代码与分析流程已开源。

原文摘要 · Abstract (English)

Long conversations with an AI agent create a simple problem for one user: the history is useful, but carrying it verbatim is expensive. We study personalized agent memory: one user's conversation history with an agent, distilled into a compact retrieval layer for later search. Each exchange is compressed into a compound object with four fields (exchange_core, specific_context, thematic room_assignments, and regex-extracted files_touched). The searchable distilled text averages 38 tokens per exchange. Applied to 4,182 conversations (14,340 exchanges) from 6 software engineering projects, the method reduces average exchange length from 371 to 38 tokens, yielding 11x compression. We evaluate whether personalized recall survives that compression using 201 recall-oriented queries, 107 configurations spanning 5 pure and 5 cross-layer search modes, and 5 LLM graders (214,519 consensus-graded query-result pairs). The best pure distilled configuration reaches 96% of the best verbatim MRR (0.717 vs 0.745). Results are mechanism-dependent. All 20 vector search configurations remain non-significant after Bonferroni correction, while all 20 BM25 configurations degrade significantly (effect sizes |d|=0.031-0.756). The best cross-layer setup slightly exceeds the best pure verbatim baseline (MRR 0.759). Structured distillation compresses single-user agent memory without uniformly sacrificing retrieval quality. At 1/11 the context cost, thousands of exchanges fit within a single prompt while the verbatim source remains available for drill-down. We release the implementation and analysis pipeline as open-source software.

记忆压缩检索增强对话系统结构化蒸馏

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