ProgramGym: Scaling Training Environments for Long-Horizon Program Reproduction Agents
1Xiamen University ·
2Washington University in St. Louis
3Institute of Automation, Chinese Academy of Sciences ·
4Unisound
*Equal contributions · †Corresponding authors
Agents need coding like software engineers. So we build the gym
What the gym holds, and what training in it buys
- Go 818 49.64%
- C++ 378 22.94%
- Rust 303 18.39%
- C 149 9.04%
Tests Passed Score on ProgramBench (%)
Figure 1. Overview of ProgramGym. Program-Env contributes 1,648 executable tasks across four systems languages. Training in it carries Qwen3.8-27B from 34.87 to 42.84 (solid), and running either model under Program-Agent carries it to 55.71 and 56.25 (dashed) — closing much of the gap to far larger proprietary models.
| Language | Tasks | Share |
|---|---|---|
| Go | 818 | 49.64% |
| C++ | 378 | 22.94% |
| Rust | 303 | 18.39% |
| C | 149 | 9.04% |
| Model | Group | Score |
|---|---|---|
| Claude Opus 4.8 (xhigh) | Baseline | 70.9 |
| GPT-5.6 Sol (xhigh) | Baseline | 69.9 |
| GLM-5.2 | Baseline | 64.6 |
| Gemini 3.7 Flash | Baseline | 61.2 |
| DeepSeek-V4-Flash-0731 | Baseline | 57.68 |
| Qwen3.8-27B-SFT + Program-Agent | ProgramGym | 56.25 |
| Qwen3.8-27B + Program-Agent | ProgramGym | 55.71 |
| Gemini 3.6 Flash | Baseline | 55.7 |
| Kimi K2.7 Code | Baseline | 53.6 |
| Qwen3.8-27B-SFT + Claude Code | ProgramGym | 42.84 |
| Qwen3.8-27B | Baseline | 34.87 |
Program-Env
How a repository becomes an environment
Program-Agent
How an agent rebuilds a program from its black box
1,648 repositories, eight domains, one contract.
Each environment is a real GitHub project, rebuilt into a sandboxed executable with a black-box suite. Developer tools and system utilities dominate, and almost every subagent targets I/O behaviour.
Distribution of the 1,648 repositories across eight functional categories.
Distribution of the black-box interaction categories over 5,918 subagents from 1,648 repositories.
| Tests Category | # Subagents | % Percentage |
|---|---|---|
| Arguments | 4,901 | 82.82% |
| Configuration | 2,388 | 40.35% |
| Help | 4,070 | 68.77% |
| I/O | 5,873 | 99.24% |
| Subcommands | 1,305 | 22.05% |
| TUI | 716 | 12.10% |
136.77B tokens. 72.99% coverage. 404 tests per repository.
Building the test suites takes almost the whole budget: 130.83B of the 136.77B tokens. Those suites cover 72.99% of the gold executable's lines on average (median 81.63%) and keep 404 tests per repository (median 287).
Small tools and large codebases, the same pipeline.
Code size spans four orders of magnitude; coverage and test counts stay high across all four languages, with C++ carrying the longest tail.
Distributions of code lines, coverage, and test cases in Program-Env (all 1,648 repositories).
Across the 1,648 repositories, test construction accounts for 130.83B of the 136.77B tokens spent; a repository costs 82.99M tokens on average.
| Category | Repositories | Share |
|---|---|---|
| Developer Tools | 441 | 26.76% |
| CLI & System Utilities | 372 | 22.57% |
| Data & Scientific Computing | 243 | 14.75% |
| Security & Forensics | 227 | 13.77% |
| Media & Graphics | 115 | 6.98% |
| Games & Education | 110 | 6.67% |
| Productivity & Communication | 73 | 4.43% |
| Languages & Runtimes | 67 | 4.07% |
| Category | Subagents | Share |
|---|---|---|
| Arguments | 4,901 | 82.82% |
| Configuration | 2,388 | 40.35% |
| Help | 4,070 | 68.77% |
| I/O | 5,873 | 99.24% |
| Subcommands | 1,305 | 22.05% |
| TUI | 716 | 12.10% |
| Language | n | Mean cov. | Mean tests | Med. lines | Med. cov. | Med. tests |
|---|---|---|---|---|---|---|
| Go | 818 | 72.60% | 255.5 | 914 | 81.7 | 210 |
| C++ | 378 | 64.83% | 483.9 | 4,215 | 72.2 | 360 |
| Rust | 303 | 80.92% | 572.2 | 1,159 | 87.3 | 488 |
| C | 149 | 79.66% | 672.7 | 2,110 | 86.0 | 623 |
| Stage | Tokens |
|---|---|
| Executable generation | 4,659,772,234 |
| Dispatcher | 1,285,441,527 |
| Test construction | 130,826,470,528 |
Training lifts the whole curve. Program-Agent lifts it again.
Share of the 200 ProgramBench instances whose rebuilt program passes at least a given fraction of the behavioural tests. Program-Agent lifts the curve for both models, and the fine-tuned one holds the most instances at the high thresholds.
A 27B open model, trained here, lands beside the frontier.
Test pass rate against output tokens per task, for the public ProgramBench leaderboard and our own runs. The mascot marks Program-Agent and the fine-tuned model.
Each implement-review round raises the pass rate; five rounds raise it furthest.
The same fine-tuned model under Program-Agent at K = 1, 3 and 5 implementation rounds, against Claude Code and DeepSeek-V4-Flash. More rounds cost more tokens and keep paying off.
Under Program-Agent the agent works longer, and more of each turn goes to reading and writing code.
One unit of mass per agent turn, split across the tool actions it made and summed over each setting's 200 trajectories. Under Program-Agent the fine-tuned model averages about 1,340 turns per task against 730 under Claude Code.
Claude Code
Program-Agent
Claude Code
Program-Agent
Cite this work
arXiv:2610.13395@misc{yang2026programgym,
title = {{ProgramGym}: Scaling Training Environments for Long-Horizon Program Reproduction Agents},
author = {Chengyi Yang and Renxu Bao and Jue Hou and Zongpei Teng and
Ziheng Wang and Yujie Lin and Chengsong Huang and Junnan Zhu and
Delai Qiu and Yining Wang and Shengping Liu and Fei Long and Jinsong Su},
year = {2026},
eprint = {2610.13395},
archivePrefix = {arXiv},
primaryClass = {cs.SE},
url = {https://arxiv.org/abs/2610.13395}
}