把整个开源代码库变成AI训练场
训练AI写代码,最缺的不是模型,而是“题目”——既多样又能自动判分的任务。过去只能从GitHub的issue和commit里挖,量少且偏。这篇论文换了个思路:直接让AI自己读开源代码,把“已经实现的功能”反推成可执行的训练任务——先让AI探索代码搞清功能,再基于真实运行结果生成测试,最后反复试跑筛掉不合格的。结果从3185个开源仓库、23种语言里挖出5545道题,训练出的模型在修bug、写整个程序、操作终端等五个基准上全面上涨,最高提升17%。它不是你明天能用上的工具,但它指出了一个方向:AI的训练数据可以自己造,而且造得比人快、比人多。
📄 原文摘要(英文)
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.