AutoEnvScaling: Automating the Data Flywheel with Terminal Agents
Organizations: Northeastern University · Microsoft · Stanford University · University of Washington ·
Abstract
Terminal agents solve tasks in software engineering and scientific research by executing commands in a terminal. Training them via reinforcement learning (RL) requires diverse and verifiable environments, but these environments are still mostly designed by human researchers, so their supply grows only as fast as researchers can work. We introduce AutoEnvScaling, which treats environment design as a terminal task and uses agents to automate the data flywheel. A proposer agent builds new RL environments from the rollouts of the solver being trained, and the solver's new rollouts guide the next round. By turning environment generation into a terminal task, AutoEnvScaling increases the valid-environment rate by up to 25 times compared to prompt-only generation, at up to 75% lower cost per valid environment. We show that training Qwen3.5-35B-A3B on AutoEnvScaling environments from GPT-5.6-sol improves its Terminal-Bench 2.1 score by 4.3 points over the matched Tmax baseline. The broader goal of AutoEnvScaling is to enable recursive self-improvement (RSI): by making both environment generation and solving terminal tasks, it lets one model co-evolve in both roles. We show that Qwen3.6-35B-A3B, acting in both roles, gains 12.2 points on Terminal-Bench 2.1 and raises its Terminal-Bench 4.0 score from 1.6 to 3.2. The pipeline also generalizes across agentic domains, generating environments for software engineering, computer use, professional work, and GPU kernel programming. Overall, these results show a path toward agents building their own training environments, reducing human reliance and taking a core step toward RSI.
Figures & tables
| Proposer Source | Proposer Optimization | |||||
| Method | Strategy | Data Sources | External | Self | Harness | Weights |
| Endless Term. [ 8 ] | Prompt + feedback | Human-defined | ||||
| TermiGen [ 67 ] | Prompt + feedback | Human-defined | ||||
| Valid-env. rate (%) | Cost per valid env. (USD) | |||||
|---|---|---|---|---|---|---|
| Proposer | Prompt | Prompt + Env Feedback | AutoEnvScaling | Prompt | Prompt + Env Feedback | AutoEnvScaling |
| Claude Opus 5 | 74.6 [70.0, 78.7] | 89.5 [86.0, 92.2] | 94.0 [91.2, 95.9] | 0.72 | 0.70 | 1.18 {}_{{\color[rgb]{0.6914,0.1406,0.0938}1.6\times\,\uparrow}} |
| GPT-6-astra | 67.0 [61.2, 72.4] | 83.0 [78.0, 87.1] | 94.0 [88.9, 96.8] | 1.79 | 1.76 | 2.75 {}_{{\color[rgb]{0.6914,0.1406,0.0938}1.5\times\,\uparrow}} |
| GPT-5.6-sol | 41.1 [36.4, 46.0] | 65.5 [60.7, 70.1] | 86.3 [82.5, 89.3] | 0.90 | 0.80 | 0.59 {}_{{\color[rgb]{0.1055,0.4961,0.293}0.7\times\,\downarrow}} |
| GPT-5.6-terra | 40.0 [35.3, 44.9] | 53.2 [48.2, 58.1] | 92.5 [88.0, 95.4] | 0.13 | 0.15 | 0.09 {}_{{\color[rgb]{0.1055,0.4961,0.293}0.7\times\,\downarrow}} |
| Gemini-3.8-Flash | 26.2 [22.1, 30.8] | 59.6 [54.5, 64.4] | 64.8 [57.2, 71.7] | 0.28 | 0.20 | 0.16 {}_{{\color[rgb]{0.1055,0.4961,0.293}0.6\times\,\downarrow}} |
| Proposer | ||
| Model / Settings | GPT-5.6-sol | Claude Opus 5 |
| Qwen3.5-9B | 19.1 2.3 | |
| + Tmax | 27.2 1.4 | 29.2 2.1 |
| + AutoEnvScaling | 33.5 1.9 | 36.6 1.7 |
| Qwen3.5-35B-A3B | 26.7 2.2 | |
| + Tmax | 34.6 1.9 | 35.5 1.6 |
| Text-to-SQL | Software engineering | |||||
|---|---|---|---|---|---|---|
| Model | full_info | ask_human | Ask-F1 | full_info | ask_human | Ask-F1 |
| Qwen3.5-9B | 13.6 | 0.3 | 0.1 | 21.1 | 0.0 | 0.0 |
| Qwen3.6-35B-A3B | 34.2 | 0.3 | 0.7 | 35.0 | 0.0 | 0.0 |
| GPT-5.6-sol | 51.2 | 0.7 | 1.9 | 42.7 | 2.7 | 0.0 |
| Claude Opus 5 | 36.5 | 2.1 | 8.3 | 52.5 | 7.5 | 14.4 |
| Setting | Instances | Task success | Ask-F1 | Ask rate |
|---|---|---|---|---|
| Qwen3.6-35B-A3B | – | 0.0 | 0.0 | 1.8 |
| + Cold start | 75 | 1.2 | 10.1 | 71.4 |
| + Cold start + official training set RL | 100 | 6.8 | 29.6 | 84.2 |
| + Cold start + AutoEnvScaling | 500 | 33.9 | 55.3 | 89.8 |
Appendix figures & tables21 assets
Supplementary material from the paper’s appendix.
Appendix
| Blocker | Type | Withheld answer |
|---|---|---|
| amount_agreement_tolerance | Missing parameters | Amounts agree when the difference between the ledger amount and the billing total, rounded to two decimals, is at most in either direction, inclusive. |
| invoice_status_scope | Business information | Only ISSUED and PAID invoices are in scope, compared case-insensitively. VOID and DRAFT invoices are dropped entirely, and ledger rows that point at them are not counted as ledger-only. |
| duplicate_invoice_row_precedence | Ambiguous requirements | For a repeated invoice_id , keep the last occurrence in file order and ignore earlier rows; do not sum them. |
| discrepancy_report_ordering | Question | Sort discrepancies.csv by the absolute difference, largest first, breaking ties by invoice_id ascending. |
| total_variance_definition | Schema | total_variance is the sum of absolute per-row differences over the rows in discrepancies.csv only, rounded to two decimals. |
| Domain | Generated example | Environment | Verification |
|---|---|---|---|
| Terminal | Reconcile warehouse revenue | Files, manifests, and CLI tools | Parsed outputs, deduplication, corrections, and exact monetary totals |
| Software engineering | Repair telemetry time windows | Repository, issue, and terminal | Regression tests and private boundary cases |
| Tool calling | Apply cold-chain disposition rules | Seeded service and typed MCP calls | Service state, decision policy, and unaffected records |
| Browser use | Resolve an incident using a runbook | Local web application; clicks and text entry | Saved case fields, draft-to-resolve transition, and unaffected cases |
| Computer use | Complete a stock-audit workbook | LibreOffice desktop; mouse and keyboard | Saved formulas, cell values, formatting, and preserved inputs |
| GPU kernels | Fuse ragged residual RMSNorm | PyTorch/Triton on one T4 | Numerical correctness and timed execution against an eager baseline |
| Domain | Proposer | Acceptance (%) | Rounds |
|---|---|---|---|
| Terminal | GPT-6-astra | 100.0 | 1.77 |
| GPT-5.6-sol | 100.0 | 1.30 | |
| Claude Opus 5 | 93.8 | 2.25 | |
| Software engineering | GPT-6-astra | 100.0 | 1.41 |
| GPT-5.6-sol | 100.0 | 1.33 | |
| Claude Opus 5 | 91.2 | 2.35 |
| Task | Shape / dtype | Eager (ms) | Kernel (ms) | Ratio |
|---|---|---|---|---|
| Ragged RMSNorm | / f32 | 1.6622 | 0.3274 | 0.1970 |
| / f16 | 1.8906 | 0.2065 | 0.1092 | |
| / f32 | 0.7781 | 0.1558 | 0.2002 | |
| Gated RMSNorm | / f16 | 0.1492 | 0.0503 | 0.3369 |
| / f16 | 0.1901 | 0.0535 | 0.2817 | |
| / f16 | 0.6586 | 0.1094 | 0.1661 |
| Proposer | Solver | |
|---|---|---|
| CPUs | 16 | 4 |
| Memory | 32 GiB | 8 GiB |
| Time budget per episode | 2 hours | – |
| Turn limit | none | – |
| Coding agent | Claude Code, Codex, or Pi | Pi |
| Proposer | Self-check disabled | Self-check enabled |
|---|---|---|
| Claude Opus 5 | 52.0 | 94.0 |
| GPT-5.6-sol | 19.5 | 84.8 |
| GPT-5.6-terra | 45.2 | 93.5 |
| GPT-5.6-luna | 40.1 | 85.3 |
| DeepSeek-V4-Flash | 19.4 | 73.0 |
| Setting | Value |
|---|---|
| Learning rate | |
| Solver rollout batch | 16 environments 16 trajectories |
| Proposer rollout group | 128 proposer trajectories |
| Proposer generation interval ( ) | 16 solver updates |
| Active environment pool | 256 tasks |
| Pool review interval | 16 solver updates |
| Model | Environment acceptance | TB2.1 avg@5 | TB2.1 pass@5 |
|---|---|---|---|
| Base | 33.3 | 40.0 | 59.6 |
| Cold-Start | 76.7 | 41.1 | 66.3 |
LLM Agent Training
Large language model agent training teaches models to plan, use tools, and learn from multi-step interaction with environments.
See all 586 papers