Coding Agent Memory Post-training: Unlocking the Memory Potential of Pre-trained File Operations for Long-Horizon Tasks via Reinforcement Learning

📄 arXiv: 2609.34422v1 📥 PDF

作者: Lirui Luo, Kelong Mao, Heming Xia, Rongqing Li, Xinwei Yang, Luyu Chen, Kieran Wong, Yudong Guo, Xinrui Wang, Jiayin Zhu, Simiu Gu, Sulong Xu, Cong Fang

分类: cs.LG, cs.AI, cs.CL

发布日期: 2026-09-28


💡 一句话要点

提出CAMG以解决长时间任务中的记忆使用问题

🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture)

关键词: 长时间任务 记忆管理 强化学习 文件操作 智能代理

📋 核心要点

  1. 现有方法在长时间任务中难以有效利用记忆,导致代理在复杂任务中的表现受限。
  2. 本文提出CAMG环境,允许代理在长时间任务中创建和管理文件,以增强记忆能力。
  3. 实验结果显示,CAMG-RL-4B和CAMG-RL-9B在多个基准上与更大模型的性能相当,展示了显著的提升。

📝 摘要(中文)

语言模型代理在处理长时间任务时,其交互历史往往超出模型的活动上下文。近期研究开始使用强化学习将记忆控制纳入策略中,但通常依赖于特定领域的预定义记忆工具,这限制了记忆行为的学习。为此,本文提出了编码代理记忆健身房(CAMG),提供了一系列长时间代理强化学习环境,允许代理在任务中创建、修改、搜索和重用文件作为记忆。我们还引入了CAMG-RL,通过完全异步的PPO训练单一策略,直接从下游任务奖励中学习文件基础的记忆行为。实验结果表明,CAMG-RL-4B和CAMG-RL-9B在多个基准测试中表现出色,具有竞争力。

🔬 方法详解

问题定义:本文旨在解决现有强化学习方法在长时间任务中记忆使用不足的问题。现有方法通常依赖于特定环境的接口,导致代理在新任务中难以迁移记忆能力。

核心思路:论文提出的CAMG环境允许代理在任务中使用文件作为记忆,通过提供可执行的shell访问和持久工作区,增强了代理的记忆管理能力。

技术框架:CAMG包含多个环境(如Shop、Coding等),每个环境提供原生任务接口,代理可以在这些环境中进行文件操作。CAMG-RL则使用完全异步的PPO算法训练策略,跨环境共享学习。

关键创新:CAMG的设计使得代理能够在长时间任务中有效利用文件作为记忆,与传统方法相比,显著提高了记忆的灵活性和适应性。

关键设计:在训练过程中,使用了特定的奖励机制来引导代理学习文件操作的记忆行为,网络结构基于Qwen3.5模型进行调整,以适应不同规模的任务需求。

🖼️ 关键图片

img_0
img_1
img_2

📊 实验亮点

实验结果表明,CAMG-RL-4B和CAMG-RL-9B在SWE-bench Verified和MLE-bench Lite上表现出色,分别与Qwen3.5-35B-A3B和Qwen3.5-122B-A10B模型的性能相当,展示了在长时间任务中的有效性和竞争力。

🎯 应用场景

该研究的潜在应用领域包括自动化编程、深度研究和智能助手等,能够显著提升代理在复杂任务中的表现。通过增强记忆管理能力,未来可在更多长时间任务中实现更高效的智能决策和操作。

📄 摘要(原文)

Language-model agents increasingly tackle long-horizon tasks whose interaction histories exceed the model's active context. Recent work has begun to use reinforcement learning to make memory control part of the policy, often relying on predefined memory tools within domain-specific training environments of relatively short horizons. This setup ties learned memory behavior to environment-specific interfaces that lie outside the base model's pre-training and must be learned from scratch, so even after post-training, agents struggle to use memory in long-horizon tasks. To address these limitations, we introduce Coding Agent Memory Gym (CAMG), a suite of long-horizon agentic-RL environments spanning Shop, Coding, DeepResearch, and AutoResearch. Alongside each environment's native task interface, CAMG provides executable shell access and an episode-persistent workspace, enabling agents to create, revise, search, and reuse files as memory throughout an episode. We also introduce CAMG-RL, which trains a single policy jointly across all four environments with fully asynchronous PPO, learning this file-based memory behavior directly from downstream task reward, and we train CAMG-RL-4B and CAMG-RL-9B from Qwen3.5 models of matching size. On SWE-bench Verified and MLE-bench Lite, CAMG-RL-4B and CAMG-RL-9B are competitive with Qwen3.5-35B-A3B and Qwen3.5-122B-A10B, respectively.