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.


翻译:大型语言模型(LLMs)在多轮对话场景中的部署日益广泛,但其表现仍受限于简单历史管理策略的瓶颈。每轮对话完全重放历史记录虽然简单但成本高昂,而基于时效性的截断或静态摘要方法常导致早期高影响力的用户约束条件逐渐脱离有效上下文。因此,模型可能保留了文本却未能在关键时刻可靠应用。本文提出自适应聚焦记忆(AFM)——一种轻量级上下文管理系统,该系统基于语义相关性、时间衰减和重要性分类,动态为每条历史消息分配三种保真度级别之一:完整、压缩或占位符。AFM在固定令牌预算下按时间顺序封装消息,以高保真度保存关键约束条件,同时允许低重要性上下文平缓降级。我们在两个专为测试长时域约束保持能力而设计的多轮对话基准上评估AFM:涉及严重花生过敏用户的安全关键型旅行场景,以及涉及非法避税请求的政策关键型税务合规场景。在要求同时满足显式约束召回与条件适配生成的严格评分标准下,AFM在过敏测试场景中实现了83.3%的成功率(所有基线策略均失败),并在税务基准中保持了正确的拒绝行为。这些结果表明,有效的对话记忆不仅需要保留历史文本,通过对过往消息的选择性保真度分配,可在有限上下文增长条件下实现可靠的约束保持,且无需修改模型权重或引入外部检索架构。我们开源了兼容OpenAI风格聊天API的AFM实现,以支持可复现研究及实际部署。

0
下载
关闭预览

相关内容

专知会员服务
30+阅读 · 2020年9月18日
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员