Learn to Memorize: Optimizing LLM-based Agents with Adaptive Memory Framework

Zeyu Zhang, Quanyu Dai, Rui Li, Xiaohe Bo, Xu Chen +1 more
8/15/2025
cs.LGcs.AIcs.CL

Official code: nuster1128/learn_to_memorize (18 stars, last commit 2025-09-22).

Abstract

LLM-based agents have been extensively applied across various domains, where memory stands out as one of their most essential capabilities. Previous memory mechanisms of LLM-based agents are manually predefined by human experts, leading to higher labor costs and suboptimal performance. In addition, these methods overlook the memory cycle effect in interactive scenarios, which is critical to optimizing LLM-based agents for specific environments. To address these challenges, in this paper, we propose to optimize LLM-based agents with an adaptive and data-driven memory framework by modeling memory cycles. Specifically, we design an MoE gate function to facilitate memory retrieval, propose a learnable aggregation process to improve memory utilization, and develop task-specific reflection to adapt memory storage. Our memory framework empowers LLM-based agents to learn how to memorize information effectively in specific environments, with both off-policy and on-policy optimization. In order to evaluate the effectiveness of our proposed methods, we conduct comprehensive experiments across multiple aspects. To benefit the research community in this area, we release our project at https://github.com/nuster1128/learn_to_memorize.

View on arXivView PDF

Code Implementations(1)

The official repository of paper "Learn to Memorize: Optimizing LLM-based Agents with Adaptive Memory Framework".

180Python, MakefileApr 28, 20251 years ago

Similar Papers

Cite this paper

@article{zhang2025learn,
  title  = {Learn to Memorize: Optimizing LLM-based Agents with Adaptive Memory Framework},
  author = {Zeyu Zhang and Quanyu Dai and Rui Li and Xiaohe Bo and Xu Chen and Zhenhua Dong},
  year   = {2025},
  eprint = {2508.16629},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2508.16629v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2508.16629.svg)](https://codeofpaper.com/paper/2508.16629)

Discussion