ReTerm: Recovery Training for Self-Improving Terminal AgentsReTerm: Recovery Training for Self-Improving Terminal Agents
Translation in progress — untranslated text is omitted.
ReTerm is a self-improving terminal agent trained by learning to recover from its own failed tasks. Its 9B version achieves 34.8% Pass@1 on Terminal-Bench 2.0, a 14.6 percentage point improvement over the base model Qwen3.5-9B. To address the problem that terminal agents struggle to recover from errors such as command mistakes and implementation defects during long executions, ultimately leading to task failure, the authors build a custom data pipeline and produce the ReTerm-10K dataset, providing recovery demonstrations for SFT cold start. Their proposed ReTerm-GRPO online reinforcement learning algorithm branches multiple independent self-recovery attempts from the agent's own failed states and learns based on whether these attempts complete the task. Compared with standard GRPO training, this method achieves higher recovery rates across multiple error categories. Code, data, and models have been released on GitHub.
- Terminal agents doing long-horizon programming often encounter command errors or incorrect implementations, yet struggle to recover from the environment state they have left behind, causing tasks to fail. The authors believe that manually injected errors may not match the distribution of the agent's own errors, and existing recovery training only performs SFT.
- ReTerm first uses the base model to collect failure snapshots, has DeepSeek-V4-Pro continue them, applies a four-step filter to obtain ReTerm-10K, and performs SFT. ReTerm-GRPO then splits multiple recovery attempts from the current policy's failure states and performs group-relative updates based on task verifier results.
- ReTerm-9B achieves a Pass@1 of 34.8% on Terminal-Bench 2.0 and 58.4% on SWE-bench Verified; the authors state this is 14.6 and 13.2 points higher than the base model under the same harness. Except for tool use errors, recovery rates are 32% or below.
- The paper does not specifically discuss limitations. The experiments cover self-run Qwen3.5-9B and ReTerm-9B, three main benchmarks and four out-of-domain benchmarks, four harnesses, and four training ablations on Terminal-Bench 2.0. The queue capacity K and the number of evaluation repetitions are not reported.
Related events and news
1 events · 1 news mentions
News that mentions this paper
ReTerm用自身失败驱动Code Agent自我改进
- 公众号 机器之心cites the paper's id or link让 Code Agent 从自己的错误中进化:ReTerm 探索失败驱动的 RSI
论文链接:https://arxiv.org/abs/2610.18484