TL;DR
The strongest AI models aren't always the best teachers. This paper uncovers a "pedagogical paradox" in training terminal agents, demonstrating that a model's standalone performance matters less than its tendency to explicitly inspect and verify the environment. By prioritizing these environment-grounded trajectories, the authors achieve state-of-the-art training efficiency, matching top-tier performance using up to 30× less data.
What Problem Does This Paper Address?
AI code agents are shifting from static code generation to autonomous, closed-loop interaction with terminal environments (e.g., installing dependencies, editing files, and debugging via test execution). To train smaller open-source models to perform these complex tasks, researchers typically use knowledge distillation—fine-tuning student models on interaction trajectories generated by a powerful "teacher" model like Claude or GPT-4.
The underlying assumption has always been "stronger is better": the higher a teacher model scores on a benchmark, the better its trajectories must be for training students. This paper challenges that assumption. The authors investigate whether a teacher's raw problem-solving efficiency actually translates to good pedagogy, or if highly capable models take cognitive "shortcuts" that leave student models under-supervised.
Methods
To rigorously isolate what makes a trajectory "teachable," the authors introduced several novel methodologies:
- Matched-Task Teacher Distillation: They held the evaluation benchmark, agent harness (Terminus-2), student backbones (Qwen3-8B and 32B), and training recipes completely fixed. They then curated a dataset where four different teacher models (Claude Opus 4.6, DeepSeek-V3.2, Qwen3.5-Plus, and GLM-5) successfully solved the exact same tasks, isolating trajectory quality from task difficulty.
- Targeted Observation Ratio (TOR): A new metric designed to quantify Environment-Grounded Supervision (EGS). TOR measures the fraction of an agent's actions that are explicitly preceded by a path-aligned observation command (for example, running
cat src/utils.pybefore executing an edit on that exact file).
Datasets
The authors introduced TERMINAL-LEGO, a scalable data generation pipeline that extracts real-world technical questions from StackOverflow across 90+ domains and converts them into Docker-verified terminal tasks.
Unlike purely synthetic datasets, TERMINAL-LEGO tasks incorporate real failure modes like dependency conflicts, networking misconfigurations, and library-specific bugs. The pipeline filters tasks through a strict "generate-then-review" loop and a final Docker round-trip verification to ensure every task is executable and automatically checkable.
The final evaluation was conducted on Terminal-Bench 2.0, a canonical testbed for terminal-based agentic reasoning.
Key Insights and Ideas
- The Pedagogical Paradox: Standalone mastery does not guarantee teaching success. Claude Opus 4.6 achieved the highest standalone score on Terminal-Bench 2.0 (69.4%) but produced the weakest student models. Conversely, DeepSeek-V3.2 scored the lowest standalone (39.3%) but emerged as a vastly superior teacher.
- The Danger of "Shortcuts": Highly capable models like Claude Opus often solve tasks in very few turns without explicitly inspecting the environment. While efficient, these trajectories lack visibility into why an action was taken. Students trained on them simply memorize fragile action sequences rather than robust problem-solving routines.
- Structured Failures Still Teach: In a striking experiment, students trained on failed DeepSeek-V3.2 trajectories outperformed students trained on successful Claude Opus trajectories. This proves that the procedural "inspect-act-verify" loop (EGS) is far more valuable to a student than merely seeing a successful final outcome.
- Prompting for Better Pedagogy: By simply modifying Claude Opus's system prompt to force it to inspect files before editing them, its TOR increased from 2.5% to 6.6%, which subsequently boosted its student's downstream performance from 15.4% to 19.5%.
Key Results
When evaluating the matched-task setup (8.1k trajectories), students trained on DeepSeek-V3.2 consistently outperformed all others. For instance, a Qwen3-32B student trained on DeepSeek data achieved a 20.6% pass rate on Terminal-Bench 2.0, compared to just 15.5% when trained on Claude Opus data.
When scaling up to the full TERMINAL-LEGO dataset (15.3k trajectories), data efficiency gains were massive:
- Qwen3-32B achieved a 24.3% score on Terminal-Bench 2.0—a 7× improvement over its base performance.
- This performance rivals previous state-of-the-art methods while using over 30× less data volume than competing post-training corpora like Nemotron-Terminal.
Limitations and Future Work
While the findings are compelling, the authors note a few limitations:
- The study focused primarily on 8B and 32B student models. How these pedagogical dynamics scale to much larger or much smaller student architectures remains an open question.
- The TOR metric acts as a practical proxy for trajectory grounding, but it does not formally validate whether a specific observation was logically sufficient or strictly necessary to justify the subsequent action.
The authors suggest that the future of agent post-training will rely heavily on "Harness Engineering"—systematically designing interaction environments that force models to expose their internal reasoning loops.
Summary updated