让大模型像人一样通过关联记忆长期对话,减少上下文占用。
HeLa-Mem: Hebbian Learning and Associative Memory for LLM Agents

- 用生物启发的动态图结构模拟记忆,通过共激活强化连接。
- 在LoCoMo数据集上四项任务表现更优,上下文使用量大幅减少。
- 适合需要长程对话与知识积累的智能体应用。
大语言模型代理的长期记忆是关键挑战,因固定上下文窗口无法维持长时间交互的连贯性。现有记忆系统将对话历史表示为无结构的嵌入向量,通过语义相似性检索信息,这一范式未能捕捉人类记忆中相关经验通过重复共激活逐步增强联结的关联结构。受认知神经科学启发,我们识别出生物记忆的三大核心机制:关联、巩固与扩散激活,这些在当前研究中仍基本缺失。为此,我们提出HeLa-Mem,一种仿生记忆架构,将记忆建模为具有赫布学习动态的动态图。该架构采用双层组织:(1) 通过共激活模式演化的事件记忆图;(2) 通过赫布提炼构建的语义记忆库,由反思代理识别密集连接的记忆枢纽并提炼为结构化可复用的知识。该双路径设计融合语义相似性与学习到的关联,模仿人类认知中的情景-语义区分。在LoCoMo上的实验显示,该方法在四个问题类别中表现更优,且显著减少上下文令牌使用量。代码已开源:https://github.com/ReinerBRO/HeLa-Mem
原文摘要 · Abstract (English)
Long-term memory is a critical challenge for Large Language Model agents, as fixed context windows cannot preserve coherence across extended interactions. Existing memory systems represent conversation history as unstructured embedding vectors, retrieving information through semantic similarity. This paradigm fails to capture the associative structure of human memory, wherein related experiences progressively strengthen interconnections through repeated co-activation. Inspired by cognitive neuroscience, we identify three mechanisms central to biological memory: association, consolidation, and spreading activation, which remain largely absent in current research. To bridge this gap, we propose HeLa-Mem, a bio-inspired memory architecture that models memory as a dynamic graph with Hebbian learning dynamics. HeLa-Mem employs a dual-level organization: (1) an episodic memory graph that evolves through co-activation patterns, and (2) a semantic memory store populated via Hebbian Distillation, wherein a Reflective Agent identifies densely connected memory hubs and distills them into structured, reusable semantic knowledge. This dual-path design leverages both semantic similarity and learned associations, mirroring the episodic-semantic distinction in human cognition. Experiments on LoCoMo demonstrate superior performance across four question categories while using significantly fewer context tokens. Code is available on GitHub: https://github.com/ReinerBRO/HeLa-Mem
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。