arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.13348cs.CL
收藏

测试时记忆构建

Test-Time Memory Construction

School of Computer Science and Engineering, Northeastern University(东北大学计算机科学与工程学院);Department of Computer Science and Technology, Tsinghua University(清华大学计算机科学与技术系);Alibaba Group(阿里巴巴集团)

Zijun Wang, Yifan Ji, Haidong Xin, Zhenghao Liu, Yukun Yan, Zulong Chen, Yu Gu, Ge Yu, Maosong Sun

AI总结:

针对LLMs处理长交互历史问题的困难,提出测试时记忆构建框架T²Mem,通过推迟记忆构建至推理阶段,在LoCoMo和LongMemEval上优于强基线并降低了开销。

摘要:

大型语言模型(LLMs)在回答涉及长交互历史的问题时存在困难,相关证据可能分散在不同的远程会话中。现有记忆系统通常在观察用户查询前离线构建和维护复杂的记忆表示,这会产生大量开销,且限制了其根据查询特定信息需求调整记忆构建的能力。本文提出T²Mem,一种测试时记忆构建框架,该框架将记忆构建推迟到推理阶段,并沿推理过程逐步构建记忆。具体而言,T²Mem离线提取轻量级的会话级元数据,以捕获关键事件和时间关联作为检索线索,同时保留与原始交互的链接,以促进跨会话依赖关系的重建。在测试时,LLM自适应地检索和组织元数据与原始交互,随着推理的展开逐步构建查询特定的记忆。在LoCoMo和LongMemEval上的实验表明,T²Mem在不同骨干LLMs上始终优于强基线,同时大幅降低了记忆构建的开销,验证了其有效性。进一步分析表明,将记忆构建推迟到推理阶段,可使记忆构建过程动态适应单个查询的信息需求。所有代码可在该https URL获取。

英文摘要:

Large Language Models (LLMs) struggle to answer questions over long interaction histories, where relevant evidence may be scattered across distant sessions. Existing memory systems typically construct and maintain sophisticated memory representations offline, before user queries are observed, incurring substantial overhead and limiting their ability to adapt memory construction to query-specific information needs. In this paper, we propose T$^2$Mem, a Test-Time Memory construction framework that defers memory construction to inference and progressively builds memory along the reasoning process. Specifically, T$^2$Mem extracts lightweight episode-level metadata offline to capture key events and temporal associations as retrieval cues, while retaining links to the original interactions to facilitate the reconstruction of dependencies across episodes. At test time, the LLM adaptively retrieves and organizes metadata and raw interactions, progressively constructing query-specific memory as reasoning unfolds. Experiments on LoCoMo and LongMemEval show the effectiveness of T$^2$Mem by consistently outperforming strong baselines across different backbone LLMs while substantially reducing the overhead of memory construction. Further analysis demonstrates that deferring memory construction to inference enables the memory construction process to dynamically adapt to the information needs of individual queries. All code is available at https://github.com/OpenBMB/T2Mem.

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

↑