Zhongzhi Li, Yucheng Shi, Zongxia Li, Ruhan Wang, Anhao Li, Zixun Huang, Junyao Yang, Lei Ke, Ninghao Liu, Haitao Mi, Leowei Liang
5 min
How can researchers generate high-quality, long-horizon terminal-agent training data at scale without the prohibitive costs of human authoring? The authors address the challenge of maintaining consistency between instructions, environments, reference solutions, and verifiers as task complexity increases.
The authors introduce Recursive Synthetic Terminal Tasks (RST), a framework that treats task synthesis as a recursive process. Starting from a set of 639 verified seed tasks, the system iteratively selects a task, extends its reference solution, updates the corresponding verifier and instruction to match the new workflow, and validates the result in a fresh sandbox. Only tasks that pass both oracle validity (the solution works) and contract validity (the instruction matches the verifier) are accepted. These accepted tasks are then used as seeds for subsequent rounds, creating a self-improving pipeline that avoids human intervention.
Over fifteen rounds of recursion, RST generated 37,484 verified tasks at a cost of approximately $0.05 per task. The difficulty of these tasks increased substantially: the median reference solution length grew from 67 to 374 lines, and the median number of executed commands increased from 40 to 244. Despite this increase in complexity, the synthesis process showed no signs of a performance ceiling, with yield and validation rates remaining stable. When used for supervised fine-tuning and agentic PPO, this synthetic data improved Qwen3.5 model performance by up to 10 points on several terminal-based benchmarks, demonstrating that recursive synthesis is an effective strategy for scaling agent training data.
This work provides a scalable solution to the data bottleneck in training autonomous software agents. By automating the creation of complex, verifiable terminal tasks, the RST framework allows researchers to generate massive datasets that teach agents to handle long-horizon workflows, persistent state, and complex tool use, which are critical for real-world software engineering and automation tasks.
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 $R_1$ to 2.5\% at $R_{15}$. 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.
Sam: Does the system ever hit a ceiling where it just can't come up with anything new?
Alex: Surprisingly, no. Even after fifteen rounds of this process, the variety of tasks remained stable — no signs of running out of ideas. Through that process, the system generated over 37,000 verified tasks, none of which required a human to write from scratch.
Sam: And did all of that actually translate into better performance? More data doesn't always mean a smarter model.
Alex: That's a fair point, and it's where the design choice matters. The key isn't just volume — it's that every task in the dataset is provably solvable and progressively harder. When models trained on these synthetic tasks were tested against standard benchmarks, they showed clear, measurable improvements over the base versions. The gains were consistent, not a one-off result.
Sam: So what's the mechanism? Why does training on these tasks specifically make the model better?
Alex: It comes down to something the researchers call "long-horizon planning." Most AI tasks are fairly short — answer a question, translate a sentence. But real software engineering work requires holding a goal in mind across dozens of sequential steps. By training on tasks that keep getting longer and more complex, the model is forced to practice exactly that skill. It learns not just what to do, but how to stay on track when the path to the answer is long.
Sam: Like the difference between answering a single math problem and working through a proof that takes a full page.
Alex: That's a good way to put it. And the training method reinforces this. They use something called Supervised Fine-Tuning — think of it like a student reviewing fully worked-out homework solutions. The model sees the task, the complete solution path, and the verification steps that confirm it worked. It learns the pattern of how to reach a goal, not just the answer itself. So it's less like memorizing facts and more like learning a method.
Sam: The part that stands out to me is the self-sufficiency of it. Once you have a small set of seed tasks, the system can grow its own curriculum, verify it, and use it to train — without needing a human at every step.
Alex: That's the central contribution. It shifts the bottleneck away from human labor and toward computational verification. Whether that scales further — to even more complex domains, or to different training methods beyond supervised learning — is an open question the field will need to work through. But as a proof of concept, the results suggest the approach is worth serious attention.
Sam: It makes you think differently about what "training data" even means. It doesn't have to come from humans. It just has to be trustworthy.
Alex: And that distinction — trustworthy over human-authored — may be one of the more useful ideas to come out of this work. Thanks for listening to ResearchPod.