CodeMidas: Scaling Agentic Coding RL Environments from Code Itself

Bowen Ye, Lei Li, Shicheng Li, Zihao Yue, Linghao Zhang, Hanglong Lv, Yuanxin Liu, Wenhan Ma, Hao Tian, Rang Li, Jinhao Dong, Yikai Zhao, Xiangwei Deng, Hailin Zhang, Liang Zhao, Qi Liu, Lingpeng Kong, Tong Yang, Fuli LuoarXiv 2026

TL;DR

CodeMidas introduces an automated, agentic pipeline that transforms raw source code from open-source repositories into high-quality reinforcement learning (RL) environments for coding agents. By eliminating the reliance on human artifacts like GitHub issues or commits, it scales training data to thousands of tasks across dozens of languages, driving substantial performance gains across diverse software engineering benchmarks.

What Problem Does This Paper Address?

Training software engineering agents using Reinforcement Learning (RL) requires two things: a massive variety of diverse tasks and highly reliable verifiers (automated tests to provide rewards). Currently, researchers build these environments using "development artifacts"—things like GitHub issues, pull requests, commits, or documentation.

While useful, this approach severely limits the scale and diversity of training tasks because it depends on historical human records. CodeMidas addresses this bottleneck by asking a fundamental question: Can we skip human artifacts entirely and generate high-quality RL training environments directly from the source code itself?

Methods

CodeMidas uses an agentic pipeline where LLM agents are deployed to handle every stage of environment generation:

  1. Task Design: An agent analyzes a codebase's structure to find public entry points (APIs, CLIs, library functions). It removes a core piece of the implementation to create a "starting point" and writes a clear behavioral specification of what the code should do.
  2. Test Construction: The agent generates test inputs based on the specification, runs them against the original (unmodified) code to capture the correct outputs, and builds execution-grounded test assertions.
  3. Execution Consistency: To ensure the verifier is stable, the task is tested in six fresh containers. It must fail when the implementation is missing (2x) and pass perfectly when the reference solution is re-inserted (4x).
  4. Post-rollout Filtering: CodeMidas uses adversarial rollouts to detect hidden code leakage (like cached build files), audits solutions for false positives/negatives, and filters out tasks that are either too easy or completely impossible for a screening model.
CodeMidas Pipeline Overview

Datasets

  • Training Dataset: CodeMidas generated 5,545 high-quality training tasks extracted from 3,185 open-source codebases. This dataset spans 23 programming languages (led by Python, TypeScript, and Go) and 15 technical domains (such as Systems, Web, and Dev Tools).
  • Evaluation Benchmarks: The authors evaluated their RL-trained model on five external, diverse benchmarks: SWE-bench Pro (issue resolution), DeepSWE (issue repair), ProgramBench (whole-program construction), RepoZero C2Rust (code translation), and Terminal-Bench v2.1 (command-line work). They also used a held-out CodeMidas Val set of 200 tasks.
Language Coverage Top 10

Key Insights and Ideas

  • Source Code is All You Need: You don't need human history (issues/PRs) to teach an agent how to code. Existing codebases contain implicit specifications that can be extracted automatically.
  • Quality Beats Quantity: Rigorous filtering matters more than raw dataset size. An ablation study showed that a high-quality, filtered dataset of 3,000 tasks outperformed a "vanilla" unfiltered dataset of 8,000 tasks across multiple benchmarks.
  • RL Changes Agent Behavior: Trajectory analysis revealed that Group Relative Policy Optimization (GRPO) training fundamentally shifts how agents solve problems. Post-RL agents explore codebases more thoroughly before making edits, draft code internally within their reasoning chains before writing it to disk, and execute more diverse self-verification commands.

Key Results

Training the MiMo-V2.5 model using GRPO on CodeMidas tasks yielded significant absolute performance improvements across all five external benchmarks:

  • DeepSWE: Pass rate jumped from 10.0% to 21.7% (+11.7 percentage points).
  • ProgramBench: "Almost Solved" score increased from 4.5% to 21.5% (+17.0 percentage points).
  • RepoZero C2Rust: Pass rate improved from 40.5% to 51.8% (+11.3 percentage points).
  • Terminal-Bench v2.1: Pass rate rose from 63.7% to 72.2% (+8.5 percentage points).
  • SWE-bench Pro: Pass rate increased from 50.3% to 54.4% (+4.1 percentage points).
Performance Gains Across Benchmarks

Limitations and Future Work

Not discussed in the paper.

Summary updated

BibTeX
@misc{ye2026codemidas,
  author = {Bowen Ye and Lei Li and Shicheng Li and Zihao Yue and Linghao Zhang and Hanglong Lv and Yuanxin Liu and Wenhan Ma and Hao Tian and Rang Li and Jinhao Dong and Yikai Zhao and Xiangwei Deng and Hailin Zhang and Liang Zhao and Qi Liu and Lingpeng Kong and Tong Yang and Fuli Luo},
  title = {{CodeMidas: Scaling Agentic Coding RL Environments from Code Itself}},
  year = {2026},
  eprint = {2609.22068},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.22068},
}
Figure