MEM1: Learning to Synergize Memory and Reasoning for Efficient Long-Horizon Agents
MemoryRLPPO310+160+ICLR 2026CCF-A新加坡-麻省理工学院研究与技术联盟MEM1:学习协同记忆与推理以构建高效长程智能体
Abstract
Modern language agents often need to solve long-horizon tasks requiring multiple turns of interactions with the environment, where they retrieve external information, adapt to observations, and answer interdependent queries. Yet, most LLM systems rely on full-context prompting, appending all past turns regardless of their relevance. This leads to unbounded memory growth, increased computational costs, and degraded reasoning performance on out-of-distribution input lengths due to LLM forgetting the context. We introduce MEM1, an end-to-end reinforcement learning framework that enables agents to operate with nearly near constant context size when solving long-horizon tasks. At each turn, MEM1 updates a compact shared internal state that jointly supports memory consolidation and reasoning. Leveraging reinforcement learning (RL) and rollout trajectory truncation, we train a MEM1 agent to develop internal states that integrate prior memory with new observations from the environment while strategically discarding irrelevant or redundant information. Experiments across three domains, including internal retrieval QA, open-domain web QA, and multi-turn web shopping, show that MEM1-7B improves performance by
现代语言智能体常常需要解决需要与环境进行多轮交互的长程任务,在此过程中检索外部信息、适应观测结果,并回答相互依赖的问题。 然而,大多数 LLM 系统仍依赖完整上下文提示,不管历史轮次是否相关,都会把所有过去交互追加到提示中。 这会导致记忆无界增长、计算成本增加,并由于 LLM 遗忘上下文而使模型在分布外输入长度上推理性能下降。 本文提出 MEM1,这是一个端到端强化学习框架,使智能体在解决长程任务时能够以近似常数的上下文大小运行。 在每一轮中,MEM1 会更新一个紧凑的共享内部状态,同时支持记忆整合与推理。 借助 reinforcement learning (RL) 和 rollout trajectory truncation,我们训练 MEM1 agent 形成内部状态,把先前记忆与来自环境的新观测整合起来,同时有策略地丢弃无关或冗余信息。 在内部检索 QA、开放域 Web QA 和多轮 Web 购物三个领域的实验表明,在每个任务含
1. Introduction
Large language models (LLMs) have shown remarkable performance in single-turn tasks such as question answering, summarization, and code generation. However, emerging real-world applications increasingly operate over multiple turns--searching documents, interacting with environments, and making decisions based on evolving external information. Examples include AI search agents such as Perplexity AI that automate complex tasks by iteratively gathering information, and web-navigation agents such as OpenManus and BrowserUse, which must complete goals across dozens of interactive turns.
大型语言模型(LLM)已经在问答、摘要和代码生成等单轮任务中展现出显著表现。 然而,新兴真实应用越来越多地运行在多轮场景中:搜索文档、与环境交互,并基于不断变化的外部信息做出决策。 例如 Perplexity AI 这类 AI search agents 会通过迭代收集信息来自动完成复杂任务;OpenManus 和 BrowserUse 这类网页导航智能体则需要在数十轮交互中完成目标。
Unlike traditional tasks where the input is static or self-contained, long-horizon settings often involve answering a sequence of related questions, requiring the agent to continuously retrieve new information, revise beliefs, and adapt to evolving contexts over time. For instance, consider a research assistant tasked with "What is the evidence for X?". Subsequent queries like "Who published it?" require further information retrieval, while "Is the source credible?" calls for self-reflection and assessment. Each query builds on the previously collected and accumulated information. Similarly, a shopping assistant may be first asked "Which product is cheapest?", then "What are its reviews?", and "Is it compatible with my device?". These interactions span multiple turns, featuring evolving contexts and compound reasoning.
传统任务中的输入通常是静态或自包含的,而长程场景往往涉及一系列相关问题,要求智能体持续检索新信息、修正信念,并随着上下文变化不断适应。 例如,一个研究助手可能被要求回答“X 的证据是什么?”。 后续问题如“是谁发表的?”需要进一步检索信息,而“这个来源可靠吗?”则需要自我反思和评估。 每个问题都建立在此前已经收集并积累的信息之上。 类似地,一个购物助手可能先被问到“哪个产品最便宜?”,随后又被问到“它的评价如何?”以及“它和我的设备兼容吗?”。 这些交互跨越多个轮次,具有持续演化的上下文和复合推理。
In long-horizon systems, a common strategy is to append all past observations, actions, and thoughts to the context at each step. This creates three challenges. (1) Growing inference cost and memory usage. Transformer-based LLMs typically incur
在长程系统中,一种常见策略是在每一步都把所有过去观测、动作和思考追加到上下文中。 这会产生三个挑战。 (1) 推理成本和记忆使用增长。 随着上下文长度
Recent progress in long-context modeling largely targets static inputs (e.g., long documents) and does not address multi-turn interaction with external environments. Some other approaches introduce external memory modules (e.g., summarizers or retrievers), but these are typically trained separately and cannot be optimized end-to-end with the agent's policy. This also introduces additional engineering overhead, as engineers must manage and integrate two separate models. Meanwhile, existing works on tool-using agent systems trained with reinforcement learning leave memory management unsolved, letting the prompt length grow unboundedly. A natural question is raised: Can a language model learn to consolidate its memory as part of its reasoning process so that it retains only what is essential for solving the task?
长上下文建模的近期进展主要针对静态输入(例如长文档),并没有解决与外部环境进行多轮交互的问题。 另一些方法引入外部记忆模块(例如 summarizer 或 retriever),但这些模块通常单独训练,无法与智能体策略进行端到端优化。 这还会引入额外工程开销,因为工程师必须管理并集成两个独立模型。 与此同时,已有的使用工具并通过强化学习训练的智能体系统仍未解决记忆管理问题,任由提示长度无界增长。 这自然引出一个问题:语言模型能否把记忆整合作为其推理过程的一部分来学习,从而只保留解决任务所必需的信息?
Motivated by this question, we present MEM1: Memory-Efficient Mechanism via learning 1-step integrated reasoning and consolidation--a method for training LLM agents that maintain nearly constant memory usage across arbitrarily long horizons.
受这一问题启发,我们提出 MEM1:Memory-Efficient Mechanism via learning 1-step integrated reasoning and consolidation,即通过学习一步式集成推理与整合来实现记忆高效机制,这是一种训练 LLM 智能体的方法,使其能在任意长程任务中保持近似常数的记忆使用。
At each turn, the model updates a consolidated state composed of prior memory and newly obtained information. This consolidated state becomes the agent's only retained memory, allowing all observations obtained via external tool use to be discarded after use, which prevents prompt expansion altogether (illustrated later in Section 4.2). A key insight of our method is that inference-time reasoning serves two purposes: while reasoning about the current query, the model also extracts and stores the essential information it needs for the future. By unifying reasoning and memory consolidation, MEM1 enables the agent to both reason and remember within a shared representational space, without requiring extra modules or architectural changes.
在每一轮中,模型都会更新一个由先前记忆和新获得信息组成的整合状态。 这个整合状态成为智能体唯一保留的记忆,使所有通过外部工具获得的观测都能在使用后被丢弃,从而彻底避免提示膨胀(稍后在第 4.2 节说明)。 本文方法的关键洞见是,推理时 reasoning 有两个目的:模型在推理当前查询的同时,也会提取并存储未来所需的关键信息。 通过统一推理和记忆整合,MEM1 使智能体能够在共享表征空间中同时推理和记忆,而不需要额外模块或架构改动。
We train this behavior end-to-end with reinforcement learning (RL), optimizing for task success via verifiable rewards. Although not explicitly optimized for memory efficiency through reward signals, the agent learns to manage memory as part of its policy, resulting in near-constant memory usage across long horizons. Additionally, we notice that current training and evaluation environments predominantly focus on single-objective tasks, limiting their ability to fully prepare agents for realistic, long-horizon scenarios that inherently involve multiple sequential objectives. To address this challenge, we introduce a scalable task augmentation approach, transforming existing single-objective QA datasets into complex multi-objective tasks through compositions of
我们使用强化学习(RL)端到端训练这种行为,并通过可验证奖励来优化任务成功率。 虽然奖励信号并没有显式优化记忆效率,但智能体会把记忆管理学习为其策略的一部分,从而在长程任务中实现近似常数记忆使用。 此外,我们注意到当前训练和评估环境主要关注单目标任务,这限制了它们为真实长程场景充分准备智能体的能力,而这些场景本质上涉及多个连续目标。 为了解决这一挑战,我们提出一种可扩展的任务增强方法:通过组合
We empirically evaluate MEM1 on (i) a multi-turn information retrieval task, where standard single-objective QA datasets are augmented into multi-objective settings by composing
我们在两类环境中实证评估 MEM1:(i) 多轮信息检索任务,其中标准单目标 QA 数据集通过组合
2. Related Work
2.1. LLM Agents in Multi-Turn Environment
LLM-based agents have evolved from handling single-turn queries to serving as autonomous agents capable of multi-turn interactions such as web navigation and complex research. To enable such capabilities, Yao et al. introduced the ReAct (i.e., Reason + Act) framework, which enhances LLMs' ability to interact with external environments by interleaving reasoning and action. Building on this reasoning-acting prompting paradigm, subsequent works have explored ways to improve agent performance through natural language feedback, enabling iterative refinement. Recently, inference-time scaling has emerged as a promising direction for enabling complex reasoning, with prior research incorporating evaluators (e.g., verifier, reward model) or world models. In addition, there are two major lines of training approaches: (1) behavior cloning (BC), which involves imitating expert trajectories to guide agent behavior by supervised fine-tuning (SFT), and (2) reinforcement learning (RL), which optimizes agent policies by incentivizing desirable outcomes through rewards. These methods aim to align the agents' behaviors with task objectives, enabling more robust and generalizable performance.
基于 LLM 的智能体已经从处理单轮查询,发展为能够进行网页导航和复杂研究等多轮交互的自主智能体。 为了支持这些能力,Yao et al. 提出了 ReAct(即 Reason + Act)框架,该框架通过交错推理与行动来增强 LLM 与外部环境交互的能力。 在这种 reasoning-acting 提示范式基础上,后续工作探索了利用自然语言反馈改进智能体表现的方法,使其能够迭代修正。 近期,推理时扩展成为支持复杂推理的一个有前景方向,已有研究引入 evaluator(例如 verifier、reward model)或 world model。 此外,训练方法主要有两条路线:(1) behavior cloning (BC),即通过监督微调(SFT)模仿专家轨迹以引导智能体行为;(2) reinforcement learning (RL),即通过奖励激励期望结果来优化智能体策略。 这些方法旨在让智能体行为与任务目标对齐,从而获得更稳健、更具泛化性的表现。
2.2. Context Management for LLM Agents
A widely adopted approach to context management in LLM-based agent systems involves appending all prior information, such as observations, intermediate thoughts, and actions, into the prompt at each interaction turn. While this method is straightforward and effective when the number of interactions required is small, it results in unbounded context growth, leading to linearly scaled inference memory. Moreover, long contexts often contain irrelevant or redundant information, which impairs the model's reasoning capabilities. To mitigate these issues, recent studies have proposed external memory frameworks, including retrieval-augmented generation and summarization modules and hierarchical working memories. However, these methods are typically applied independently of the agent's policy, creating a disconnect between memory and the reasoning process. In addition, managing and integrating such modules often incurs extra computational overhead and system complexity. Despite these advancements, many RL approaches for training LLM agents still rely on accumulating the full interaction history as memory, leaving memory management during training an underexplored area. In this work, we seek to bridge this gap by tightly integrating memory with the agent's reasoning process, thereby enabling more efficient and context-aware decision-making.
LLM 智能体系统中一种常见的上下文管理方法,是在每轮交互中把所有先前信息追加到提示里,包括观测、中间思考和动作。 当所需交互轮数较少时,这种方法简单且有效,但它会导致上下文无界增长,并使推理记忆线性扩张。 此外,长上下文通常包含无关或冗余信息,会损害模型的推理能力。 为了缓解这些问题,近期研究提出了外部记忆框架,包括检索增强生成、摘要模块和层次化工作记忆。 然而,这些方法通常独立于智能体策略应用,从而造成记忆与推理过程之间的脱节。 此外,管理和集成这类模块往往会带来额外计算开销和系统复杂度。 尽管已有这些进展,许多用于训练 LLM 智能体的 RL 方法仍然依赖于把完整交互历史作为记忆来累积,使得训练期间的记忆管理仍是一个探索不足的领域。 在本文中,我们希望通过把记忆与智能体推理过程紧密整合来弥合这一缺口,从而实现更高效、更具上下文感知能力的决策。
3. MEM1
Complex reasoning tasks often require an iterative process of information gathering and synthesis, as seen in applications such as deep search and web-based agents. We consider an interactive agent operating in a multi-turn environment with vocabulary space
复杂推理任务通常需要一个迭代的信息收集与综合过程,这可见于 deep search 和基于 Web 的智能体等应用。 我们考虑一个在多轮环境中运行、词表空间为
Formally, let
形式化地,令

3.1. Memory as Part of Reasoning
To achieve a constant memory, MEM1 is particularly trained to iteratively refine its understanding by processing new information in conjunction with a consolidation of its prior state. At each turn
为了实现常数记忆,MEM1 被专门训练为通过结合新信息与先前状态整合,来迭代修正自己的理解。 在每一轮
RL offers a powerful mechanism for shaping agent behavior through reward signals. In MEM1, we leverage this framework to incentivize effective state consolidation by designing environments in which the agent is rewarded only when it strategically retains and integrates useful information. Specifically, we construct tasks that require numerous interactions with the environment to arrive at a correct answer (see Section 3.3). Success depends on the agent's ability to rely on information collected along the inference path. At each turn, we prune the agent's context to retain only the most recent internal state
RL 通过奖励信号为塑造智能体行为提供了强有力的机制。 在 MEM1 中,我们利用这一框架来激励有效的状态整合:我们设计的环境只有在智能体有策略地保留并整合有用信息时才给予奖励。 具体而言,我们构造了需要与环境进行大量交互才能得到正确答案的任务(见第 3.3 节)。 成功取决于智能体依赖推理路径中所收集信息的能力。 在每一轮,我们都会剪除智能体上下文,只保留最近的内部状态
3.2. Masked Trajectory for Policy Optimization
Popular RL algorithms update the policy with policy gradient, which requires the calculation of
流行的 RL 算法使用 policy gradient 更新策略,这需要计算
To overcome this challenge, we introduce a masked trajectory that compresses
为了克服这一挑战,我们引入 masked trajectory,将一个包含
Specifically, let the attention mask for the
具体而言,令第
3.3. Multi-Objective Task Design
Although MEM1 is designed to address the tasks involving multi-turn interaction with the external world, there are limited publicly available datasets that support training for such long-horizon interactive processes. Existing benchmarks, such as HotpotQA, Bamboogle, and 2wiki, are often cited as multi-hop benchmarks, yet they typically involve only two information-seeking steps. Moreover, these datasets are not explicitly structured to support long-horizon interactions that necessitate the agent to manage the memory state.
虽然 MEM1 旨在处理涉及与外部世界进行多轮交互的任务,但公开可用于训练这种长程交互过程的数据集仍然有限。 HotpotQA、Bamboogle 和 2wiki 等已有 benchmark 常被视为 multi-hop benchmark,但它们通常只涉及两个 information-seeking steps。 此外,这些数据集并没有被显式设计成支持需要智能体管理记忆状态的长程交互。
To bridge this gap, we introduce a novel task--multi-objective question answering (QA)--that extends the number of reasoning steps required to solve a problem. Building on existing multi-turn datasets such as HotpotQA and Natural Questions, we interleave multiple questions from the original QA corpus and construct a single composite query that requires answering all constituent sub-questions, shown in Prompt 1 of Appendix B.3. Unlike standard multi-turn QA, this formulation compels the agent to (i) issue multiple search queries, each targeting a distinct sub-question, and (ii) organize the sub-answers into a coherent final response. The augmented dataset inherits the multi-turn retrieval tasks presented in the original HotpotQA. Additionally, to test the agent's long-horizon processing capability, our multi-objective QA combines multiple multi-turn questions into a grand objective and tasks the agent to answer all the questions combined. For instance, two original HotpotQA questions can be combined into one augmented task that asks the agent to answer each question, organize the final answer in <answer> and </answer>, and separate the answer to each question with semicolon.
为了弥合这一缺口,我们提出了一种新任务 multi-objective question answering (QA),它会增加问题求解所需的推理步骤数。 基于 HotpotQA 和 Natural Questions 等已有多轮数据集,我们交错组合原始 QA 语料中的多个问题,并构造一个单一复合查询,要求回答所有组成子问题,相关内容见附录 B.3 的 Prompt 1。 不同于标准多轮 QA,这种形式迫使智能体:(i)发出多条搜索查询,每条针对一个不同子问题;(ii)将子答案组织成连贯的最终回答。 增强后的数据集继承了原始 HotpotQA 中的多轮检索任务。 此外,为测试智能体的长程处理能力,我们的 multi-objective QA 会将多个多轮问题组合成一个总体目标,并要求智能体回答所有组合后的问题。 例如,两个原始 HotpotQA 问题可以被组合成一个增强任务,要求智能体分别回答每个问题,把最终答案组织在 <answer> 与 </answer> 中,并用分号分隔每个问题的答案。
4. Experiments & Results
We empirically demonstrate the effectiveness of our approach in training the MEM1 agent to perform multi-turn tasks while preserving a near-constant-sized memory state. We evaluate MEM1 against several baselines using a comprehensive set of metrics categorized into accuracy (e.g., Exact Match, F1 score, Environment Reward) and efficiency (e.g., Peak Token Usage, Dependency Length, Inference Time). All MEM1 variants are fine-tuned from the Qwen2.5-7B Base model. We use PPO as the RL algorithm as it computes token-level advantages, bringing stability to the training process. While we also experimented with instruction-tuned and supervised fine-tuned models using curated high-quality trajectories, reinforcement learning from the base model consistently yielded the best performance and generalization.
我们通过实验验证本文方法在训练 MEM1 智能体执行多轮任务、同时保持近似常数大小记忆状态方面的有效性。 我们使用一组综合指标将 MEM1 与多个基线比较,这些指标分为准确性(例如 Exact Match、F1 score、Environment Reward)和效率(例如 Peak Token Usage、Dependency Length、Inference Time)两类。 所有 MEM1 变体都从 Qwen2.5-7B Base 模型微调而来。 我们使用 PPO 作为 RL 算法,因为它可以计算逐 token advantage,从而为训练过程带来稳定性。 虽然我们也实验了 instruction-tuned 模型,以及使用精选高质量轨迹进行 supervised fine-tuned 的模型,但从 base model 出发进行 reinforcement learning 始终带来最佳性能和泛化。
Our experiments are conducted in two standard environments, each reflecting real-world scenarios that require multi-turn agent interactions. The first environment is question answering with retrieval-augmented generation (RAG), where the agent must answer queries by retrieving relevant information from an external knowledge store (either a database or an online search engine). We trained on RAG with a local database (i.e., Wikipedia Corpus) and evaluated on tasks involving open web browsing. For QA, following Section 3.3, we construct multi-objective tasks and tested the model performance on tasks with more questions than seen in the training. The second environment is WebShop navigation, where the agent assists users in online shopping by browsing a website and selecting items based on natural language descriptions. This task requires the agent to iteratively read page content and make navigation decisions, following protocols similar to those in WebGPT.
我们的实验在两个标准环境中进行,每个环境都反映了需要多轮智能体交互的真实场景。 第一个环境是带检索增强生成(RAG)的问答任务,智能体必须从外部知识库(数据库或在线搜索引擎)中检索相关信息来回答查询。 我们在带本地数据库(即 Wikipedia Corpus)的 RAG 上训练,并在涉及开放网页浏览的任务上评估。 对于 QA,我们遵循第 3.3 节构造 multi-objective tasks,并在问题数量超过训练时所见数量的任务上测试模型表现。 第二个环境是 WebShop navigation,智能体需要根据自然语言描述浏览购物网站并选择商品,帮助用户完成在线购物。 该任务要求智能体迭代地阅读页面内容并做出导航决策,遵循与 WebGPT 类似的协议。
4.1. Implementation Details
Datasets and evaluation metrics. We train two versions of MEM1 agent for both long-horizon QA and web navigation. For long-horizon QA, we augment the multi-turn QA dataset that mixes data from both HotpotQA and Natural Question to form a multi-objective composite tasks. During training, we use 2-objective task only and test the agent's performance on tasks with more objectives. For the web agent, we use the WebShop environment, which also produces a reward during training. For all datasets, the train-test split follows the original papers. During RL training, we employ the exact match (EM) metric for QA tasks (details in Appendix B.4.1) and the environment reward for WebShop. To evaluate the effectiveness of various approaches, we measure the EM and F1 score for QA tasks and final reward for the WebShop environment. To evaluate efficiency, we consider the peak token usage, average dependency, and average inference time. The test datasets are obtained from the original papers which consist of out-of-distribution data. The former two metrics measure the memory efficiency, while the latter measures the time efficiency. The detailed definitions of the metrics are in Appendix B.4.1. The prompt and format can be found in Appendix B.3.
数据集和评估指标。 我们为 long-horizon QA 和 web navigation 分别训练两个版本的 MEM1 agent。 对于 long-horizon QA,我们增强了混合 HotpotQA 和 Natural Question 数据的 multi-turn QA 数据集,以形成 multi-objective 复合任务。 训练期间,我们只使用 2-objective task,并在更多 objectives 的任务上测试智能体性能。 对于 web agent,我们使用 WebShop 环境,该环境在训练时也会产生奖励。 对于所有数据集,train-test split 遵循原论文。 在 RL 训练中,我们对 QA 任务使用 exact match (EM) 指标(细节见附录 B.4.1),对 WebShop 使用环境奖励。 为了评估各种方法的有效性,我们对 QA 任务测量 EM 和 F1 score,并对 WebShop 环境测量 final reward。 为了评估效率,我们考虑 peak token usage、average dependency 和 average inference time。 测试数据集取自原论文,其中包含 out-of-distribution 数据。 前两个指标衡量 memory efficiency,后一个指标衡量 time efficiency。 这些指标的详细定义见附录 B.4.1。 Prompt 和 format 见附录 B.3。
Baselines. To evaluate the accuracy and efficiency of MEM1, we compare it against two groups of baselines: (i) prior published methods, and (ii) ablations of our approach. Prior published baselines.
- QA environment: Search-R1, DeepResearcher, and the larger-scale model Qwen2.5-14B-Instruct. Details of Search-R1 and DeepResearcher are provided in Appendix B.4.2.
- WebShop environment: Agent-FLAN, Agent-R, and AgentLM.
- Context compression baseline: A-MEM, which augments an Instruct model with a vector database for memory retrieval.
Ablations of our method.
- Truncation baseline (prompt only): We apply MEM1's agentic truncation prompt template and rollout to an instruct model without RL, isolating the effect of the prompt and rollout design alone. We find that training provides significant performance gains, even though prompt-only rollout already offers some efficiency benefits. Detailed results are presented in Table 1, Table 2, and Table 3.
- SFT baseline: Train a supervised fine-tuned model on trajectories curated from GPT-4o based on MEM1's rollout, enabling comparison with the RL-trained agent. We find that although supervised fine-tuning improves performance, reinforcement learning is much more effective at enabling generalizability. Detailed results are presented in Appendix F.1.
- Memory-Reasoning Coupling: Explicitly separate memory and coupling in MEM1's internal state to investigate the effect of integrating the two in terms of performance and efficiency. We find that integrated memory and reasoning can benefit both performance and efficiency in our evaluated tasks. Detailed results are presented in Appendix F.3.
基线。 为了评估 MEM1 的准确性和效率,我们将其与两组基线比较:(i)已有公开方法;(ii)我们方法的消融。 已有公开基线。
- QA 环境: Search-R1、DeepResearcher 和更大规模模型 Qwen2.5-14B-Instruct。Search-R1 和 DeepResearcher 的细节见附录 B.4.2。
- WebShop 环境: Agent-FLAN、Agent-R 和 AgentLM。
- Context compression baseline: A-MEM,它用 vector database 增强 Instruct model 以进行 memory retrieval。
我们方法的消融。
- Truncation baseline (prompt only): 我们把 MEM1 的 agentic truncation prompt template 和 rollout 应用于没有 RL 的 instruct model,从而隔离 prompt 和 rollout design 本身的作用。我们发现 training 带来了显著性能增益,尽管 prompt-only rollout 已经提供了一定效率收益。详细结果见表1、表2和表3。
- SFT baseline: 在基于 MEM1 rollout 并由 GPT-4o 筛选的轨迹上训练 supervised fine-tuned model,以便与 RL-trained agent 比较。我们发现,尽管 supervised fine-tuning 会提升性能,reinforcement learning 对实现泛化能力更有效。详细结果见附录 F.1。
- Memory-Reasoning Coupling: 在 MEM1 的 internal state 中显式分离 memory 和 coupling,以研究将二者整合起来对性能和效率的影响。我们发现,integrated memory and reasoning 能够让评估任务中的性能和效率都受益。详细结果见附录 F.3。
Meta info injection. In our agentic pipeline, the agent's context is programmatically truncated at each turn--immediately after it generates a search query or an answer--following the procedure outlined in Section 3. As past context is truncated, the agent may have difficulty determining when to terminate. To address this, we prepend a hint [HINT: YOU HAVE {turns_left} TURNS LEFT] at the beginning of each <info> tag to remind the agent of its remaining turns budget. For all experiments, we set the maximally allowed turns to
Meta info injection. 在我们的 agentic pipeline 中,智能体上下文会按照第 3 节所述流程,在每一轮生成 search query 或 answer 后立即由程序截断。 由于过去上下文被截断,智能体可能难以判断何时终止。 为了解决这一点,我们会在每个 <info> 标签开头加入提示 [HINT: YOU HAVE {turns_left} TURNS LEFT],提醒智能体剩余的轮次预算。 在所有实验中,我们把
4.2. MEM1 on Multi-Objective Multi-Hop Tasks
One key advantage of MEM1 agents lies in their efficient management of long-horizon interactions with the environment. To demonstrate this, we train our MEM1 agent with a 2-objective augmentation of the QA dataset, and subsequently test it against other models on held-out multi-objective test sets similarly constructed from the original QA corpus. As elaborated in Section 3.3, these multi-objective tasks require substantially more reasoning turns to complete, thus serving as a more demanding benchmark for memory management. As shown in Table 1, MEM1 consistently outperforms other 7B counterparts: when tested on 16-objective task, it achieves over
MEM1 智能体的一个关键优势是能够高效管理与环境之间的长程交互。 为了证明这一点,我们用 QA 数据集的 2-objective 增强版本训练我们的 MEM1 agent,随后在由原始 QA 语料类似构造的 held-out multi-objective test sets 上将其与其他模型比较。 如第 3.3 节所述,这些 multi-objective tasks 需要显著更多推理轮次才能完成,因此是更具挑战性的 memory management benchmark。 如表1所示,MEM1 始终超过其他 7B 对照模型:在 16-objective task 上测试时,它取得超过
The advantage of MEM1 becomes even more evident in tasks requiring longer-horizon interactive processes. A visualization of the trend in agent performance as the complexity of tasks increases is shown in Figure 2. Figure 2 illustrates the scaling trends of task performance (measured by EM count) and memory efficiency (measured by Peak Token Usage) for MEM1 relative to other models and memory management baselines. As the number of objectives increases, the Peak Token Usage of all other methods and models scales nearly linearly. In contrast, MEM1 maintains an almost constant peak token count with only a slight increase. Notably, while MEM1 initially underperforms Qwen2.5-14B-Instruct, its performance gradually catches up as the number of objectives increases, eventually surpassing the 14B model, which has double the parameter count. As shown in Figure 2, at
在需要更长程交互过程的任务中,MEM1 的优势更加明显。 智能体性能随任务复杂度增加而变化的趋势可视化见图2。 图2展示了随着目标数量增加,MEM1 相对于其他模型和记忆管理基线的任务性能(用 EM count 衡量)和 memory efficiency(用 Peak Token Usage 衡量)的 scaling trends。 随着目标数量增加,所有其他方法和模型的 Peak Token Usage 几乎线性增长。 相比之下,MEM1 的 peak token count 几乎保持常数,只略有增加。 值得注意的是,虽然 MEM1 起初弱于 Qwen2.5-14B-Instruct,但随着目标数量增加,其性能逐渐追上,并最终超过参数量翻倍的 14B 模型。 如图2所示,在

truncate 表示使用 MEM1 的 prompt 和 rollout pipeline;A-MEM 表示在 MEM1 prompt 和 rollout pipeline 下使用 A-Mem 的 external memory module;MEM1-QA 表示在 2-objective QA task 上训练的 MEM1。Dependency scores 因空间限制未展示。| Model | 2-Objective | |||
|---|---|---|---|---|
| EM ↑ | F1 ↑ | Peak (×10²) ↓ | Time (s) ↓ | |
| Qwen2.5-14B-Inst | 0.732 | 0.902 | 15.6 ± 0.19 | 5.49 ± 0.16 |
| Qwen2.5-7B-Inst | 0.268 | 0.366 | 19.6 ± 0.33 | 4.60 ± 0.08 |
| Qwen2.5-7B-Inst (A-MEM) | 0.286 | 0.371 | 14.1 ± 0.10 | 24.6 ± 0.51 |
| Qwen2.5-7B-Inst (truncate) | 0.262 | 0.336 | 8.28 ± 0.06 | 5.89 ± 0.16 |
| Search-R1 (original) | 0.452 | 0.531 | 13.0 ± 0.08 | 4.09 ± 0.23 |
| Search-R1 (trained on 2-obj task) | 0.544 | 0.646 | 13.68 ± 0.23 | 10.60 ± 0.32 |
| Search-R1 (trained on 2-obj task + truncate) | 0.446 | 0.546 | 6.12 ± 0.04 | 17.5 ± 0.22 |
| DeepResearcher | 0.536 | 0.650 | 22.0 ± 0.43 | 4.01 ± 0.07 |
| MEM1-QA | 0.709 | 0.838 | 6.40 ± 0.02 | 6.49 ± 0.07 |
| Model | 8-Objective | |||
|---|---|---|---|---|
| EM ↑ | F1 ↑ | Peak (×10²) ↓ | Time (s) ↓ | |
| Qwen2.5-14B-Inst | 1.55 | 1.87 | 44.7 ± 0.37 | 16.2 ± 0.27 |
| Qwen2.5-7B-Inst | 0.87 | 1.10 | 49.5 ± 0.40 | 13.9 ± 0.18 |
| Qwen2.5-7B-Inst (A-MEM) | 1.13 | 1.43 | 18.6 ± 0.10 | 53.7 ± 1.26 |
| Qwen2.5-7B-Inst (truncate) | 0.97 | 1.23 | 11.8 ± 0.10 | 11.9 ± 0.20 |
| Search-R1 (original) | 0.064 | 0.08 | 24.7 ± 0.19 | 4.25 ± 0.16 |
| Search-R1 (trained on 2-obj task) | 0.471 | 0.575 | 22.48 ± 0.47 | 19.60 ± 0.50 |
| Search-R1 (trained on 2-obj task + truncate) | 0.162 | 0.204 | 4.95 ± 0.02 | 21.5 ± 0.18 |
| DeepResearcher | 0.73 | 0.90 | 51.8 ± 0.35 | 11.3 ± 0.14 |
| MEM1-QA | 1.87 | 2.31 | 8.01 ± 0.06 | 8.68 ± 0.12 |
| Model | 16-Objective | |||
|---|---|---|---|---|
| EM ↑ | F1 ↑ | Peak (×10²) ↓ | Time (s) ↓ | |
| Qwen2.5-14B-Inst | 0.567 | 0.703 | 38.4 ± 0.71 | 29.7 ± 0.75 |
| Qwen2.5-7B-Inst | 0.165 | 0.213 | 43.3 ± 0.62 | 15.5 ± 0.23 |
| Qwen2.5-7B-Inst (A-MEM) | 0.730 | 0.961 | 18.8 ± 0.14 | 91.2 ± 2.44 |
| Qwen2.5-7B-Inst (truncate) | 0.396 | 0.497 | 13.3 ± 0.16 | 22.1 ± 0.60 |
| Search-R1 (original) | 0.009 | 0.011 | 20.9 ± 0.03 | 4.75 ± 0.18 |
| Search-R1 (trained on 2-obj task) | 0.520 | 0.647 | 24.8 ± 0.57 | 23.35 ± 0.77 |
| Search-R1 (trained on 2-obj task + truncate) | 0.091 | 0.107 | 5.28 ± 0.03 | 24.6 ± 0.22 |
| DeepResearcher | 0.071 | 0.106 | 48.9 ± 0.66 | 15.8 ± 0.19 |
| MEM1-QA | 1.97 | 2.39 | 10.4 ± 0.09 | 8.70 ± 0.12 |
4.3. MEM1 on Single-Objective Multi-Hop Tasks
While MEM1 is designed to train agents for very long-horizon tasks, our training method also delivers improved capability with existing multi-hop tasks while achieving much greater efficiency at the same time, all without being explicitly trained on the single-objective versions of these tasks. Note that single-objective tasks also require multiple turns of interaction to produce the desired output. Long-horizon web navigation in WebShop. Beyond QA tasks, we further evaluate the effectiveness of MEM1 in managing long-horizon interactions in the form of web navigation. We show the experimental results in Table 2. Trained in the WebShop environment (see Appendix B.6), MEM1 outperforms other agent training baselines, including Agent-Flan, Agent-R, and AgentLM when utilizing models of similar size. Furthermore, MEM1 achieves remarkable efficiency improvements compared to the best baseline method, AgentLM, featuring a
虽然 MEM1 的目标是训练面向超长程任务的智能体,但我们的训练方法在已有 multi-hop tasks 上也能提升能力,同时显著提高效率,而且并没有在这些任务的 single-objective 版本上显式训练。 注意,single-objective tasks 也需要多轮交互才能产生期望输出。 WebShop 中的长程网页导航。 除了 QA 任务,我们进一步评估 MEM1 以 web navigation 形式管理 long-horizon interactions 的有效性。 实验结果见表2。 在 WebShop 环境中训练后(见附录 B.6),MEM1 在使用相似规模模型时超过了其他 agent training baselines,包括 Agent-Flan、Agent-R 和 AgentLM。 此外,相比最佳基线 AgentLM,MEM1 实现了显著效率提升:Peak Token Usage 提升
| Model | Avg Final Reward ↑ | Peak Token (×10³) ↓ | Dependency (×10⁶) ↓ | Inference Time Per Traj (s) ↓ |
|---|---|---|---|---|
| GPT-4o | 25.48 | 5.30 ± 1.23 | 3.99 ± 1.16 | N/A |
| GPT-4o (truncate) | 13.82 | 0.99 ± 0.99 | 0.81 ± 0.23 | N/A |
| GPT-4o (A-MEM) | 24.50 | 1.84 ± 0.06 | 0.31 ± 0.11 | N/A |
| Qwen2.5-7B-Instruct | 18.42 | 5.64 ± 1.34 | 3.38 ± 0.89 | 12.31 ± 1.82 |
| Qwen2.5-14B-Instruct | 12.34 | 5.44 ± 0.92 | 3.30 ± 0.61 | 18.17 ± 2.32 |
| Agent-FLAN-7B | 40.35 | 3.37 ± 1.12 | 2.18 ± 1.62 | 9.95 ± 6.19 |
| Agent-R-8B | 63.91 | N/A | N/A | N/A |
| AgentLM-7B | 63.60 | 2.24 ± 0.40 | 0.28 ± 0.07 | 3.91 ± 1.07 |
| AgentLM-13B | 70.80 | 2.36 ± 0.46 | 0.30 ± 0.08 | 5.23 ± 1.59 |
| MEM1-WebShop | 70.87 | 0.81 ± 0.10 | 0.15 ± 0.16 | 2.61 ± 0.48 |
For single-objective QA in Wikipedia, Table 3 presents accuracy and efficiency metrics where the agent can make retrieval requests from a Wikipedia datastore via RAG. The MEM1 used in this evaluation is the same as the one detailed in Section 4.2, which is trained solely on a 2-objective task. Overall, MEM1 demonstrates superior efficiency across all three evaluated efficiency metrics, while simultaneously achieving the highest EM score and an F1 score comparable to that of Qwen2.5-14B-Instruct. This improvement in efficiency is attributed to the MEM1 agent's ability to consolidate memory from previous interactions into a compact internal state, which reduces the number of tokens used in the context. We also observe that SFT significantly underperforms RL, highlighting the necessity for RL-based training.
对于 Wikipedia 中的单目标 QA,表3给出了准确性和效率指标;在该环境中,智能体可以通过 RAG 向 Wikipedia 数据库发起检索请求。 本次评估使用的 MEM1 与第 4.2 节详述的模型相同,仅在 2-objective 任务上训练。 总体而言,MEM1 在三个评估的效率指标上都表现更优,同时取得最高 EM 分数,F1 score 也与 Qwen2.5-14B-Instruct 相当。 这种效率提升归因于 MEM1 agent 能够把先前交互中的记忆整合进紧凑内部状态,从而减少上下文中使用的 token 数。 我们还观察到 SFT 明显弱于 RL,这说明基于 RL 的训练是必要的。
Transfer performance to online Web-QA. To validate the transferability and generalizability of the trained MEM1 agent, we test MEM1 trained on RAG-QA in an online web-QA environment, which is unseen by the agent. This environment is similar to the Wiki-QA task in Section 4.3. However, instead of retrieving information from a local Wiki document store, the agent needs to conduct web searches through an API service (e.g., Google Search API) that returns results including titles, snippets, and URLs to answer the QA problems. As shown in Table 3, MEM1 consistently exhibited improved efficiency alongside comparable effectiveness in this unseen setting. The result demonstrates that MEM1 has learned actual reasoning and memory management capability rather than overfitting to the RAG dataset.
迁移到 online Web-QA 的性能。 为了验证已训练 MEM1 agent 的迁移能力和泛化能力,我们在一个智能体未见过的 online web-QA 环境中测试在 RAG-QA 上训练的 MEM1。 该环境类似于第 4.3 节中的 Wiki-QA 任务。 不过,智能体不是从本地 Wiki document store 检索信息,而是需要通过 API 服务(例如 Google Search API)执行网页搜索,该服务会返回标题、摘要片段和 URL,用于回答 QA problems。 如表3所示,MEM1 在这一未见设置中始终展现出更高效率,同时保持相当效果。 该结果表明,MEM1 学到的是真正的 reasoning 和 memory management 能力,而不是过拟合 RAG 数据集。
SFT 表示用 SFT 训练并应用 MEM1 的 prompt 与 rollout。DeepResearcher 专门在 single-objective Online Web-QA task 上以 F1 score 为优化目标训练,Search-R1 专门在 single-objective Wiki-RAG task 上以 EM 为目标训练。| Environment | System | EM ↑ | F1 ↑ | Peak Token (×10²) ↓ | Dependency (×10⁵) ↓ | Inference Time ↓ |
|---|---|---|---|---|---|---|
| Wiki RAG | Qwen2.5-7B-Inst (truncate) | 0.287 | 0.382 | 6.28 ± 0.05 | 1.65 ± 0.04 | 2.26 ± 0.04 |
| Qwen2.5-7B-Inst (A-MEM) | 0.246 | 0.373 | 8.47 ± 0.12 | 0.92 ± 0.03 | 11.2 ± 0.40 | |
| Qwen2.5-7B-Inst | 0.269 | 0.390 | 9.32 ± 0.19 | 1.17 ± 0.04 | 2.31 ± 0.04 | |
| Qwen2.5-14B-Inst | 0.422 | 0.534 | 8.89 ± 0.21 | 2.22 ± 0.10 | 6.73 ± 0.24 | |
| Search-R1 (original) | 0.445 | 0.516 | 11.0 ± 0.25 | 1.50 ± 0.05 | 2.23 ± 0.14 | |
| DeepResearcher | 0.419 | 0.503 | 13.3 ± 0.34 | 7.04 ± 0.33 | 3.86 ± 0.09 | |
| MEM1-QA (SFT) | 0.302 | 0.358 | 6.54 ± 0.05 | 3.30 ± 0.13 | 4.84 ± 0.21 | |
| MEM1-QA | 0.405 | 0.471 | 5.63 ± 0.03 | 0.76 ± 0.02 | 3.79 ± 0.07 | |
| Online Web-QA | Qwen2.5-7B-Inst | 0.334 | 0.451 | 8.37 ± 0.18 | 1.39 ± 0.06 | 2.20 ± 0.04 |
| DeepResearcher | 0.372 | 0.492 | 10.27 ± 0.19 | 2.86 ± 0.14 | 2.87 ± 0.06 | |
| MEM1-QA | 0.397 | 0.485 | 5.79 ± 0.06 | 0.44 ± 0.02 | 1.84 ± 0.03 |
4.4. Analysis on Emergent Agent Behaviors and Failure Cases

Through analyzing MEM1's multi-turn interaction traces trained on 2-objective QA, we observe a range of emergent behaviors that are critical for handling long-horizon, multi-objective tasks, demonstrating capabilities well beyond simple retrieval. Additionally, we provide detailed qualitative and quantitative analysis of cases where MEM1 fails in Appendix G. First, MEM1 learns to manage multiple questions concurrently by maintaining a structured internal state. As shown in Figure 3(a), when faced with two multi-turn questions, the agent stores and updates memory for each question separately, guiding subsequent searches based on the identified information gaps. In (b), MEM1 exhibits the ability to shift focus when progress on one question stalls, recognizing difficulty and prioritizing the more tractable objective. Meanwhile, MEM1 learns to interleave reasoning and memory in its internal state
通过分析在 2-objective QA 上训练得到的 MEM1 多轮交互轨迹,我们观察到一系列对处理长程、多目标任务至关重要的涌现行为,显示出远超简单检索的能力。 此外,我们在附录 G 中提供了 MEM1 失败案例的详细定性和定量分析。 首先,MEM1 学会通过维护结构化内部状态来并行管理多个问题。 如图3(a) 所示,面对两个多轮问题时,智能体会分别存储和更新每个问题的记忆,并基于识别出的信息缺口指导后续搜索。 在 (b) 中,当某个问题进展停滞时,MEM1 展现出转移关注点的能力,能够识别困难并优先处理更容易推进的目标。 与此同时,MEM1 学会在内部状态
Beyond behaviors unique to our multi-objective setup and memory architecture, MEM1 also exhibits several general-purpose search strategies. In (e), the agent performs self-verification, correcting an earlier misconception and issuing a new query for confirmation. In (f), complex queries are decomposed into manageable subgoals before initiating the search. In (g), for questions requiring multi-turn information gathering, MEM1 extracts key information from search results and uses it to inform the next search. In (h), when overly specific queries fail, MEM1 re-scopes its query to improve retrieval. Notably, many of these behaviors, including verification, making a plan, and iterative search, are also reported in recent studies on deep research agents.
除了我们多目标设置和记忆架构特有的行为外,MEM1 还表现出若干通用搜索策略。 在 (e) 中,智能体会进行自我验证,纠正先前误解并发出新的查询进行确认。 在 (f) 中,复杂查询会在开始搜索前被分解为可管理的子目标。 在 (g) 中,对于需要多轮信息收集的问题,MEM1 会从搜索结果中提取关键信息,并用其指导下一次搜索。 在 (h) 中,当过于具体的查询失败时,MEM1 会重新界定查询范围以改善检索。 值得注意的是,这些行为中的许多,包括验证、制定计划和迭代搜索,也出现在近期 deep research 智能体研究中。
5. Conclusion, Limitations, and Future Work
We introduced MEM1, a reinforcement learning framework that enables language agents to perform long-horizon reasoning with consolidated memory. By integrating inference-time reasoning and memory consolidation into a unified internal state, MEM1 addresses the scalability challenges of prompt growth and achieves competitive performance across QA and web navigation benchmarks, with substantially reduced memory usage and inference latency. Despite these advantages, MEM1 assumes access to environments with well-defined and verifiable rewards. However, many open-ended tasks present ambiguous or noisy reward structures. Fully realizing the potential of MEM1 therefore requires advances in modeling such tasks and designing suitable reward mechanisms--challenges that lie beyond the scope of this work. A promising future direction is to explore methods for training MEM1 agents in open-ended settings where reward signals are sparse, delayed, or implicit.
我们提出了 MEM1,这是一个强化学习框架,使语言智能体能够借助整合记忆执行长程推理。 通过把推理时 reasoning 和记忆整合统一到同一个内部状态中,MEM1 解决了提示增长带来的可扩展性挑战,并在 QA 和网页导航 benchmark 上取得有竞争力的性能,同时显著降低记忆使用和推理延迟。 尽管有这些优势,MEM1 假设环境能够提供明确定义且可验证的奖励。 然而,许多开放式任务具有模糊或有噪声的奖励结构。 因此,要充分释放 MEM1 的潜力,还需要进一步研究如何建模这类任务并设计合适的奖励机制,而这些挑战超出了本文范围。 一个有前景的未来方向,是探索如何在奖励信号稀疏、延迟或隐式的开放式设置中训练 MEM1 agents。