arXiv:2504.16754cs.CLcs.AI2025-04被引 1

让AI对话保持长期连贯,仿照海马体设计双记忆架构

HEMA : A Hippocampus-Inspired Extended Memory Architecture for Long-Context AI Conversations

  • 用压缩记忆+向量记忆双系统,持续保持对话整体连贯性
  • 300轮以上对话仍保持87%事实准确率,人类评分从2.7提升至4.3
  • 支持超长对话不重训练,适合隐私敏感的长期交互场景

大型语言模型在单次上下文窗口内表现良好,但在数百轮的长对话中难以维持连贯性。本文提出受海马体启发的扩展记忆架构HEMA,包含持续更新的一句话摘要(紧凑记忆)与基于余弦相似度查询的片段嵌入存储(向量记忆)。集成6B参数Transformer后,HEMA可在保持提示长度低于3500令牌的前提下,实现超过300轮的连贯对话。实验表明:事实回忆准确率从41%提升至87%,人类评估的连贯性得分从2.7增至4.3(5分制)。当索引10,000个片段时,向量记忆的P@5 ≥ 0.80,R@50 ≥ 0.74,精度-召回曲线下面积较仅用摘要方法翻倍。消融实验发现:通过年龄加权修剪实现语义遗忘,可降低34%检索延迟且损失极小;两级摘要层级可防止超长对话(>1000轮)中的错误传播。HEMA证明,结合原文记忆与语义连续性,为无需重训练即可实现月级对话的隐私友好型对话AI提供了可行方案。

原文摘要 · Abstract (English)

Large language models (LLMs) struggle with maintaining coherence in extended conversations spanning hundreds of turns, despite performing well within their context windows. This paper introduces HEMA (Hippocampus-Inspired Extended Memory Architecture), a dual-memory system inspired by human cognitive processes. HEMA combines Compact Memory - a continuously updated one-sentence summary preserving global narrative coherence, and Vector Memory - an episodic store of chunk embeddings queried via cosine similarity. When integrated with a 6B-parameter transformer, HEMA maintains coherent dialogues beyond 300 turns while keeping prompt length under 3,500 tokens. Experimental results show substantial improvements: factual recall accuracy increases from 41% to 87%, and human-rated coherence improves from 2.7 to 4.3 on a 5-point scale. With 10K indexed chunks, Vector Memory achieves P@5 >= 0.80 and R@50 >= 0.74, doubling the area under the precision-recall curve compared to summarization-only approaches. Ablation studies reveal two key insights: semantic forgetting through age-weighted pruning reduces retrieval latency by 34% with minimal recall loss, and a two-level summary hierarchy prevents cascade errors in ultra-long conversations exceeding 1,000 turns. HEMA demonstrates that combining verbatim recall with semantic continuity provides a practical solution for privacy-aware conversational AI capable of month-long dialogues without model retraining.

长对话记忆架构海马体对话系统

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