MemSearcher: Training LLMs to Reason, Search and Manage Memory via End-to-End Reinforcement Learning

  • 2025-11-04 18:27:39
  • Qianhao Yuan, Jie Lou, Zichao Li, Jiawei Chen, Yaojie Lu, Hongyu Lin, Le Sun, Debing Zhang, Xianpei Han
  • 0

Abstract

Typical search agents concatenate the entire interaction history into the LLMcontext, preserving information integrity but producing long, noisy contexts,resulting in high computation and memory costs. In contrast, using only thecurrent turn avoids this overhead but discards essential information. Thistrade-off limits the scalability of search agents. To address this challenge,we propose MemSearcher, an agent workflow that iteratively maintains a compactmemory and combines the current turn with it. At each turn, MemSearcher fusesthe user's question with the memory to generate reasoning traces, performsearch actions, and update memory to retain only information essential forsolving the task. This design stabilizes context length across multi-turninteractions, improving efficiency without sacrificing accuracy. To optimizethis workflow, we introduce multi-context GRPO, an end-to-end RL framework thatjointly optimize reasoning, search strategies, and memory management ofMemSearcher Agents. Specifically, multi-context GRPO samples groups oftrajectories under different contexts and propagates trajectory-leveladvantages across all conversations within them. Trained on the same dataset asSearch-R1, MemSearcher achieves significant improvements over strong baselineson seven public benchmarks: +11% on Qwen2.5-3B-Instruct and +12% onQwen2.5-7B-Instruct relative average gains. Notably, the 3B-based MemSearchereven outperforms 7B-based baselines, demonstrating that striking a balancebetween information integrity and efficiency yields both higher accuracy andlower computational overhead. The code and models will be publicly available athttps://github.com/icip-cas/MemSearcher

 

Quick Read (beta)

loading the full paper ...