Skip to main content
Back

Xiaomi's CodeMidas Turns Open-Source Code Into AI Training Tasks

A new research pipeline called CodeMidas builds reinforcement learning environments straight from source code, boosting coding agent scores on five benchmarks.

  • Researchers introduce CodeMidas, a pipeline that builds coding RL environments using only source code as input.
  • Agents handle task design, test synthesis, environment prep, and post-rollout filtering across four stages.
  • Dataset: 5,545 tasks from 3,185 repos across 23 languages and 15 technical domains.
  • Training MiMo-V2.5 with GRPO lifts DeepSWE by 11.7 points and ProgramBench by 17 points.
  • A cleaned 3k subset beats an unfiltered 8k pool, showing quality trumps raw scale.
  • Trained agents explore codebases more and write their own verification checks more often.

Researchers from Peking University, the University of Hong Kong, Renmin University, and Xiaomi’s LLM Core group have introduced CodeMidas, a pipeline that converts open-source repositories into verifiable training environments for coding agents. According to the CodeMidas paper, the method works directly from executable source code, without requiring issue trackers, commit histories, documentation, or existing tests. Training on the resulting tasks improved Xiaomi’s MiMo-V2.5 model across five software-engineering benchmarks.

Source code becomes the task generator

Reinforcement learning can improve coding agents when each task includes a dependable verifier that scores a proposed solution. Building those environments is difficult because the task must be realistic, reproducible, challenging, and paired with tests that reject incorrect implementations without penalizing valid alternatives.

Existing data pipelines often derive tasks from issues, pull requests, commits, or test suites. Those requirements restrict training data to repositories with detailed development records and favor bug-fix tasks that resemble historical patches.

CodeMidas treats an implemented public interface as the starting specification. The original implementation acts as an oracle: agents execute it to collect expected behavior, remove its core logic, and preserve the surrounding repository as a realistic scaffold with dependencies, configuration, and related modules intact.

Four gates from repository to reward

Large language model agents handle most of CodeMidas’s environment construction, including repository exploration, specification writing, test generation, execution checks, and adversarial review. The workflow has four stages: