arXiv:2609.22068 · 中英对照阅读
CodeMidas:基于代码本身扩展智能体式编程强化学习环境
CodeMidas: Scaling Agentic Coding RL Environments from Code Itself
中文速览
把开源代码变成可训练编码智能体的任务,难点在于既要任务够丰富,又要有可靠测试判定对错。CodeMidas 让多个智能体直接阅读代码、拆出已有功能并写成任务,再根据原程序实际运行结果生成测试,经过反复检查和解题筛选,留下可用环境。研究团队由此构建了覆盖 23 种编程语言的 5,545 个任务,用它训练模型后,修复问题、从头写程序和终端操作等五类测试都有提升,其中部分指标增幅明显。结果说明,不必只依赖代码仓库里的问题单、提交记录或文档,现成源代码本身也能大规模转化为可靠训练材料,帮助编码智能体适应不同软件工作。
摘要
通过强化学习(RL)训练能力出色的编程智能体,需要多样化的任务和可靠的验证器。开源代码库提供了丰富的此类任务来源,而现有方法通常依赖问题和提交等开发产物,因此限制了可提取任务的范围。为更好地扩展强化学习环境,我们提出了 CodeMidas,这是一种智能体流水线,仅以源代码作为任务专属输入,将现有代码库中的已实现功能转化为可执行的强化学习环境。CodeMidas 在环境构建的每个阶段都投入智能体计算:智能体探索已实现功能以制定行为规范,构建基于原始代码执行的测试,并通过执行检查和反复生成解题轨迹来验证和筛选候选任务。最终的数据集包含 5,545 个训练任务,来自 3,185 个开源代码库,涵盖 23 种编程语言和 15 个技术领域。使用 GRPO 在这些任务上训练 MiMo-V2.5,可提升其在五个多样化基准上的表现,涉及问题修复(DeepSWE 提升 11.7%)、完整程序构建(ProgramBench 提升 17%)和终端操作(Terminal-Bench v2.1 提升 8.5%)。消融实验表明,增加高质量训练任务的数量能够提升性能。轨迹分析显示,经过强化学习训练的智能体展现出更优行为,例如更深入地探索代码库,以及进行更多样化的自我验证。这些结果确立了源代码作为可扩展基础的作用,可用于构建强化学习环境,从而提升编程智能体处理多样化软件任务的能力。
Training capable coding agents via reinforcement learning (RL) requires diverse tasks with reliable verifiers. Open-source codebases offer a rich source of such tasks, while existing methods typically rely on development artifacts such as issues and commits, limiting the range of tasks that can be extracted. To better scale RL environments, we present CodeMidas, an agentic pipeline that turns implemented functionality in existing codebases into executable RL environments using source code as its only task-specific input. CodeMidas allocates agentic compute to every stage of environment construction: agents explore implemented functionality to formulate behavioral specifications, construct tests grounded in execution of the original code, and validate and filter candidate tasks through execution checks and repeated solution rollouts. The resulting dataset has 5,545 training tasks from 3,185 open-source codebases spanning 23 programming languages and 15 technical domains. Training MiMo-V2.5 on these tasks with GRPO improves performance on all five diverse benchmarks, covering issue repair (DeepSWE + 11.7%), whole-program construction (ProgramBench +17%), and terminal work (Terminal-Bench v2.1 +8.5%). Ablations show that increasing the number of high-quality training tasks improves performance. Trajectory analysis shows the RL-trained agent demonstrates better behaviors like increasing codebase exploration and more diverse self-verification. These results establish source code as a scalable foundation for constructing RL environments that improve coding agents across diverse software tasks.
术语表
- reinforcement learning (RL)
- 强化学习(RL)
- coding agent
- 编程智能体
- agentic coding
- 智能体式编程
- CodeMidas
- CodeMidas
- agentic pipeline
- 智能体流水线
- RL environment
- 强化学习环境
- source code
- 源代码
- open-source codebase
- 开源代码库
- implemented functionality
- 已实现功能
- behavioral specification
- 行为规范
- execution-grounded test
- 基于执行的测试
- executable verifier
- 可执行验证器
- post-rollout filtering
- 轨迹生成后筛选
- adversarial rollout
- 对抗性轨迹生成
- self-verification
- 自我验证
- generalization
- 泛化
- GRPO
- GRPO
- MiMo-V2.5
- MiMo-V2.5
- SWE-bench
- SWE-bench
- SWE-bench Pro
- SWE-bench Pro
- DeepSWE
- DeepSWE
- ProgramBench
- ProgramBench
- Terminal-Bench v2.1
- Terminal-Bench v2.1
- CodeMidas Val
- CodeMidas Val
- issue repair
- 问题修复
- whole-program construction
- 完整程序构建
- execution consistency
- 执行一致性
- task-specific input
- 任务专属输入