Test-Time Memory Construction
Zijun Wang, Yifan Ji, Haidong Xin, Zhenghao Liu, Yukun Yan, Zulong Chen, Yu Gu, Ge Yu, Maosong Sun
Abstract
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 TMem, a Test-Time Memory construction framework that defers memory construction to inference and progressively builds memory along the reasoning process. Specifically, TMem 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 TMem 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.
Create a lesson
Related papers
Beyond Self-Consistency: Recursive Self-Improvement at Test Time
Shared title terminologycs.CLJianyu Wu, Yizhou Wang, Encheng Su et al.
Failure Broadens, Success Sharpens: Continual Adaptation of Tool-Use Agents Across Diverse Tasks with Dual-Polarity Memory
Shared title terminologycs.CLTianmai M. Zhang, Hoda Shajari, Amr Hendy et al.
Worth the Wait? How Response Time and Streaming Shape Judgments of Generative AI Answers and Chatbot Engagement
Shared title terminologycs.CLZihan Chen, Di Zhu, Lei Nico Zheng
Leto: Utility-Centric Agent Memory
Shared title terminologycs.CLShuguang Chen, Salman Paracha
Joint Detection of Constructive Speech, Hate Speech and Agreement in Online Conversations
Shared title terminologycs.CLIda Dencker, Simon Karg, Kenneth Enevoldsen
When "Neutral" Means Irrelevant: A Construct-Validity Audit of NormAd-ETI
Shared title terminologycs.CLAarav Singh, Animesh Pathak, Christian Hoang et al.