动态分配对话记忆的保留精度,让大模型更牢牢记住关键约束。
Adaptive Focus Memory for Language Models
- 按语义重要性、时间衰减和权重分级,动态分配记忆精度
- 在过敏场景中正确响应率达83.3%,所有基线方法均失败
- 无需修改模型或外接检索,适合实际对话系统部署
大型语言模型在多轮对话中日益普及,但其表现受限于简单的历史管理策略。每轮重播全部对话虽简单却代价高,而基于近期性的截断或静态摘要常导致早期重要用户约束丢失。为此,我们提出自适应聚焦记忆(AFM),一种轻量级上下文管理系统,根据语义相关性、时间衰减和重要性分类,为每条历史消息动态分配全量、压缩或占位三种保真度。AFM 在固定令牌预算下按时间顺序打包消息,确保关键约束以高保真度保留,同时允许低重要性内容渐进退化。我们在两个多轮对话基准上评估了AFM,分别测试长时约束保持能力:一个涉及严重花生过敏的安全敏感旅行场景,以及一个涉及非法避税请求的政策敏感税务场景。在严格评分标准下(要求显式约束回忆与恰当生成),AFM 在83.3%的过敏任务中成功,而所有基线方法均失败;在税务基准上也保持了正确的拒绝行为。结果表明,有效对话记忆不仅需要保留过往文本,更需在有限上下文增长下,通过选择性分配保真度实现可靠约束维持。该方法无需修改模型权重或引入外部检索系统。我们开源了兼容OpenAI风格聊天API的AFM实现,支持可复现研究与实际部署。
原文摘要 · Abstract (English)
Large language models (LLMs) are increasingly deployed in multi-turn dialogue settings, yet their behavior remains bottlenecked by naive history management strategies. Replaying the full conversation at every turn is simple but costly, while recency-based truncation or static summarization often causes early, high-impact user constraints to drift out of effective context. As a result, models may retain text without reliably applying it when it matters. We present Adaptive Focus Memory (AFM), a lightweight context management system that dynamically assigns each past message one of three fidelity levels: Full, Compressed, or Placeholder, based on semantic relevance, temporal decay, and importance classification. AFM packs messages chronologically under a fixed token budget, preserving critical constraints at high fidelity while allowing low-importance context to degrade gracefully. We evaluate AFM on two multi-turn dialogue benchmarks designed to stress long-horizon constraint preservation: a safety-critical travel scenario involving a user with a severe peanut allergy, and a policy-critical tax compliance scenario involving an illegal evasion request. Under strict grading that requires both explicit constraint recall and appropriately conditioned generation, AFM succeeds in 83.3 percent of allergy runs where all baseline strategies fail, and preserves correct refusal behavior on the tax benchmark. These results demonstrate that effective dialogue memory requires more than retaining prior text. Selectively allocating fidelity across past messages enables reliable constraint preservation under bounded context growth, without modifying model weights or introducing external retrieval infrastructure. We release an open-source implementation of AFM compatible with OpenAI-style chat APIs to support reproducible research and practical deployment.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。