[KongchangAI]
· 1 min read· 816 words

CodeMidas: Turning Existing Code into Training Tasks for Programming Agents

CodeMidas: Turning Existing Code into Training Tasks for Programming Agents

CodeMidas auto-converts existing code repos into executable RL training tasks, tests, and verifiers.

A core challenge in training programming AI agents is the lack of executable, verifiable RL training data — manually annotated benchmarks, issues, and commits are expensive and hard to scale. CodeMidas takes a different approach: extracting behavior directly from existing code repositories to automatically construct programming tasks, test cases, and reward verifiers, with no human labeling required. Its key insight is that code is inherently executable and testable, and that existing functions and test structures in repositories are natural sources of task descriptions and correctness criteria. Unlike benchmarks such as SWE-bench that rely on manual curation, CodeMidas aims for automated batch processing of any qualifying repository, turning programming agent training data from a scarce resource into a scalable pipeline.

Training an AI agent capable of writing code autonomously hits one major bottleneck before anything else — not the model itself, but the training data. High-quality executable tasks, test cases, and verifiers are hard to come by. Relying on manually annotated benchmarks, hand-picked issues, and curated commits is both expensive and slow. CodeMidas proposes a more pragmatic approach: directly transforming the behavior of existing code repositories into executable training tasks.

rss source: CodeMidas Turns Existing Code Into Coding-Agent Training Tasks

Why Reinforcement Learning Needs "Executable Tasks"

The core challenge of applying reinforcement learning (RL) to programming agents is where the reward signal comes from. After a model generates a piece of code, the system must be able to determine whether that code is correct before it can provide feedback. This requires every training task to be executable and verifiable — not only must there be a clear problem description, but there also needs to be runnable tests and a verifier that determines the outcome.

Traditional approaches typically rely on three sources: manually annotated benchmarks, issues from open-source repositories, and historical commit records. But these datasets are either limited in quantity, inconsistent in quality, or require significant human effort to clean and label. Waiting for "the perfect issue, commit, or human label" makes it nearly impossible to scale training.

RL for programming agents typically draws inspiration from successes in game-like tasks (e.g., Go, video games), where rules are clear, outcomes are definitive, and reward signals come almost for free. The difficulty with programming tasks is that "code correctness" is inherently hard to define — a piece of code might be correct for some inputs and crash on others, or it might be functionally correct but stylistically poor. RL training therefore requires upfront definitions of "what counts as done," and that's precisely the verifier's job: it's an independent judgment program that takes the model's generated code and test results, then outputs a deterministic reward score. Without high-quality verifiers, RL training loses its direction — models may learn to "pass tests" rather than "actually solve problems," the phenomenon known as reward hacking.

CodeMidas's Approach: Code Itself as a Task Source

CodeMidas's key insight is that the behavior already present in existing code repositories contains a wealth of extractable tasks. Rather than passively waiting for humans to produce high-quality annotations, the idea is to actively "turn existing code to gold" (which is also the inspiration behind the Midas naming), reverse-engineering existing code functionality into training tasks.

Specifically, it transforms actual repository behavior into three things:

  • Executable tasks: Clear programming objectives extracted from existing functionality
  • Tests: Used to run and verify whether generated code behaves as expected
  • Verifiers: Automatically determine whether a task is complete, providing reward signals for RL

The value of this pipeline lies in bypassing the human annotation bottleneck. Any repository with complete functionality and a test structure can theoretically be batch-converted into training material, making reinforcement learning for programming agents scalable.

Reverse-engineering tasks from code repositories is technically a combination of program synthesis and test-driven development (TDD) thinking. Concretely, a mature repository already contains function signatures, docstrings, unit tests, and integration tests — all of which are natural carriers of task descriptions and verification criteria. CodeMidas's approach is similar to "hiding the implementation while keeping the specification": erase the function body, use the function signature and existing tests as task inputs, ask the model to re-implement it, and then use the original tests to determine correctness. This is conceptually similar to how benchmarks like SWE-bench are constructed, but SWE-bench depends on manually selecting real GitHub issues, limiting its scale. CodeMidas instead pursues automated batch processing of any qualifying repository, transforming data production from a "bottleneck" into a "pipeline."

What This Means for Training Programming Agents

This approach points to a larger trend: replacing human annotation with automated pipelines to address the data scale problem in AI training. It's particularly well-suited for programming, because code is inherently executable and testable — runtime results are the most objective measure of correctness, requiring no subjective scoring.

From another angle, CodeMidas attempts to transform "the massive corpus of existing code" — an underappreciated resource — into training fuel. The billions of lines of code accumulated in the open-source ecosystem, if convertible into structured tasks, tests, and verifiers, would make training data for programming agents no longer a scarce resource.

It's worth noting that current public information primarily describes the overall approach and its value proposition. Specific implementation details, conversion quality, and performance data from real RL training still await further disclosure. But directionally, this is a scalability-oriented path to training programming agents that deserves attention.

Summary

CodeMidas represents a paradigm shift in data acquisition: rather than waiting for perfectly labeled data, it actively constructs executable training tasks from existing code. For teams looking to train programming agents at scale, this "turn code into tasks" approach offers a practical way around the human annotation bottleneck.

#CodeMidas#programming agent training#reinforcement learning for code#executable tasks#reward verifier#code repository#SWE-bench#automated data pipeline#program synthesis#AI coding agent
Share:

Related articles