arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2610.19472cs.AI
收藏

MemCode:用于智能体长期记忆的离散语义表示

MemCode: Discrete Semantic Representations for Long-Term Agent Memory

Tongji University(同济大学);WorldMind

Xin Li, Liang Hu, Duoqian Miao, Ming Peng, Qi Zhang

AI总结:

针对LLM智能体长期记忆的瓶颈,提出MemCode框架,通过离散语义表示结合向量搜索,在多个数据集上实现最优准确率且大幅提升记忆构建速度。

摘要:

长期记忆仍是跨会话大型语言模型(LLM)智能体的基本瓶颈。现有系统通常采用“先写入后检索”范式,存储依赖上下文的对话片段并通过连续嵌入空间中的最近邻搜索进行检索。该设计会产生不稳定的访问单元,且系统性遗漏逻辑相关但词汇距离较远的证据。我们提出MemCode,一种将面向检索的写入与离散关联检索相结合的智能体长期记忆框架。MemCode将对话重写为自包含的原子记忆单元(AMU),通过同构语义量化(ISQ)将AMU映射到可学习码本,并将码本共现拓扑作为向量搜索的补充检索路径。对于长期记忆存储,MemCode将在线原子写入与异步离线整合分离。在LongMemEval-S和LoCoMo数据集上,使用GPT-4o-mini和Qwen3-30B-A3B-Instruct-2507骨干模型,MemCode实现了最佳整体准确率,同时将每轮对话的记忆构建时间控制在约40~130秒,比LightMem快3~21倍,比A-MEM和MemoryOS快一个数量级以上。

英文摘要:

Long-term memory remains a fundamental bottleneck for large language model (LLM) agents across sessions. Existing systems typically adopt a write-then-retrieve paradigm, storing context-dependent dialogue fragments and retrieving them via nearest-neighbor search in a continuous embedding space. This design yields unstable access units and systematically misses logically related but lexically distant evidence. We propose MemCode, a long-term agent memory framework that couples retrieval-oriented writing with discrete associative retrieval. MemCode rewrites dialogue into self-contained atomic memory units (AMUs), maps AMUs into a learnable codebook with isomorphic semantic quantization (ISQ), and uses codebook co-occurrence topology as a retrieval path complementary to vector search. For long-term memory stores, MemCode separates online atomic writes from asynchronous offline consolidation. On LongMemEval-S and LoCoMo with GPT-4o-mini and Qwen3-30B-A3B-Instruct-2507 backbones, MemCode achieves the best overall accuracy while keeping per-dialogue memory construction within roughly 40~130 seconds, making it 3~21 times faster than LightMem and over an order of magnitude faster than A-MEM and MemoryOS.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑