Software-in-the-Loop Reconstruction for Verified Terminal-Agent Training
Abstract
Existing training datasets for terminal agents concentrate on software engineering, leaving scientific and other specialized domains comparatively underrepresented. Constructing tasks in these domains requires both reference solutions and verifiers that distinguish correct behavior from superficially valid outputs. Developing these components separately for each task limits the expansion of training data. We introduce software-in-the-loop reconstruction, which addresses both requirements by reusing executable software workflows. Each workflow serves as a reference solution and generates input-output examples under different configurations. An agent receives selected examples and reconstructs an editable program, whose outputs are compared with the workflow's outputs on hidden inputs. The same workflow therefore supports multiple tasks and supplies their verification targets, reducing the need to author solutions and expected outputs separately for each task. A hierarchical verifier combines domain-specific semantic comparisons with structural and predefined anti-shortcut checks, while public feedback supports iterative repair. We instantiate this method as SWR3000, comprising 3,000 tasks derived from 500 workflows across 46 software families and six domains. Across three attempts per task, Qwen3.8-Max solves 838 tasks and generates 1,422 verified trajectories, which we oversample to obtain 3,000 reconstruction-only training examples. Supervised fine-tuning of Qwen3.8-27B improves mean Terminal-Bench 2 performance from 47.94% to 53.56% across three seeds and achieves the highest mean performance among four matched-token corpus controls on all four reported evaluations. These results support workflow reconstruction as a means of expanding terminal-agent training across domains by reusing executable reference solutions and their outputs for verification. Code and evaluation data are available at https://anonymous.4open.science/r/ICLR2027-Anonymous-Code-EE00.
Then back it, or bet against it.
Related papers
Open the market on this paper to see 7 more related papers.