Recursive Synthesis for Long-Horizon Terminal Tasks
Zhongzhi Li, Yucheng Shi, Zongxia Li, Ruhan Wang, Anhao Li, Zixun Huang, Junyao Yang, Lei Ke, Ninghao Liu, Haitao Mi, Leowei Liang
cs.AI, cs.LG
Submitted: 2026-08-12
Updated: 2026-08-14
Code: https://github.com/abundant-ai/swe-marathon
License: http://creativecommons.org/licenses/by/4.0/
The gist: High-quality long-horizon training data for terminal agents is expensive to produce, often costing hundreds to thousands of dollars per task, because each task must keep the instruction, environment,
Terminology
Abstract
High-quality long-horizon training data for terminal agents is expensive to produce, often costing hundreds to thousands of dollars per task, because each task must keep the instruction, environment, reference solution, and verifier mutually consistent. Human authoring does not scale, and direct generation with large language models (LLMs) often breaks these dependencies. We present Recursive Synthetic Terminal Tasks (RST), a recursive verified synthesis framework for constructing long-horizon terminal-agent tasks at scale. Starting from verified seed tasks, RST extends the reference solution, realigns the verifier and instruction to the new workflow, validates the result in a fresh sandbox, and reuses accepted tasks as seeds for subsequent rounds. Across fifteen recursive rounds, RST produces 37,484 synthesized terminal-agent tasks at roughly 0.05 per task. Task difficulty increases substantially over rounds: the median reference solution grows from 67 to 374 lines, the median number of executed commands grows from 40 to 244, and DeepSeek-V4-Pro pass@4 drops from 90% at R1 to 2.5% at R15. To demonstrate training utility, we collect rejection-sampled Qwen3.5 trajectories on the synthesized tasks and use them for supervised fine-tuning. Fine-tuning on these trajectories improves Qwen3.5-27B and Qwen3.5-122B-A10B by up to 10 points on Terminal-Bench 2, Terminal-Bench Hard, and Long-Horizon Terminal Bench, while agentic PPO lifts Qwen3.5-27B to 49.44%, 32.00%, and 22.07% on the three benchmarks, corresponding to relative gains of 20.0%, 41.2%, and 21.9% over the base model. Moreover, after 15 rounds, the recursion shows no ceiling: synthesis yield and validation rates remain stable as difficulty keeps climbing, indicating that the process can continue well beyond the scale reported here.
Sources
- Self-Play Fine-Tuning Converts Weak Language Models to Strong Language Models
- TerminalWorld: Benchmarking Agents on Real-World Terminal Tasks
- DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligence
- SWE-Marathon: Can Agents Autonomously Complete Ultra-Long-Horizon Software Work?
- Endless Terminals: Scaling RL Environments for Terminal Agents
- Towards Self-Evolving Benchmarks: Synthesizing Agent Trajectories via Test-Time Exploration under Validate-by-Reproduce Paradigm
- VisPlay: Self-Evolving Vision-Language Models from Images
- V-STaR: Training Verifiers for Self-Taught Reasoners
- CLI-Universe: Towards Verifiable Task Synthesis Engine for Terminal Agents
- R-Zero: Self-Evolving Reasoning LLM from Zero Data
- Tmax: A simple recipe for terminal agents
- Autodata: An agentic data scientist to create high quality synthetic data
- Measuring AI Ability to Complete Long Software Tasks
- Less is Enough: Synthesizing Diverse Data in LLM Feature Space with Sparse Autoencoders
- Self-Rewarding Vision-Language Model via Reasoning Decomposition
- MM-Zero: Self-Evolving Multi-Model Vision Language Models From Zero Data
- Long-Horizon-Terminal-Bench: Testing the Limits of Agents on Long-Horizon Terminal Tasks with Dense Reward-Based Grading
- AgentBench: Evaluating LLMs as Agents
- Terminal-Bench: Benchmarking Agents on Hard, Realistic Tasks in Command Line Interfaces
- GAIA: a benchmark for General AI Assistants
Related papers
- MAVEN-T: Reinforced Heterogeneous Distillation for Real-Time Multi-Agent Trajectory Prediction
- Model Discovery Agent: LLM-assisted Bayesian experiment design for data-efficient discovery of mechanistic world models
- The Clinician's Veto: Navigating Trust, Liability, and Uncertainty in Autonomous AI Prescribing
- MindHelper: Closed-Loop Embodied Mental-State Reasoning for Precision Intervention
- Incumbent Advantage: Brand Bias and Cognitive Manipulation Dynamics in LLM Recommendation Systems
- VSAL: A Vision Solver with Adaptive Layouts for Graph Property Detection