arXiv:2608.03222cs.SEcs.AI2026-08

通过提前预测失败并智能重启,显著减少软件工程代理的无效计算。

Fail-Fast, Restart-Smart: Early Failure Prediction and Restart for SWE Agentic Tasks

  • 轻量级监控器基于轨迹前缀预测失败,无需模型内部状态。
  • 在目标误报率5%下节省14.6%~20.4%执行令牌,提升成功率至71.8%。
  • 支持失败后保留修改内容并重启同一策略,适合长流程推理任务。

软件工程代理解决仓库级问题需经历长轨迹,随着上下文积累成本上升。失败运行通常更长且存在冗余探索或循环,表明部分失败可提前识别。早期终止可能中断本可成功的轨迹,而失败轨迹仍可能包含有用代码修改。本文提出双阶段控制器FailFast-RestartSmart:FailFast为0.6B轻量监控器,通过终端与密集失败-通过监督训练,仅凭可观测轨迹前缀预测失败,无需策略输出或隐藏状态;触发警报后,RestartSmart启动同策略新轨迹,不带历史提示,并可选择性引入中断时的代码差异供检查、应用或丢弃。在SWE-bench Verified上,仅用Qwen3.6-27B轨迹训练的监控器可迁移至三种其他策略(含闭源模型),在5%误报率下节省14.6%~20.4%执行令牌;在Qwen3.6-27B上,20.4%节省超过12.5%的逐步停止方法。在25%误报率下,重启策略将成功率从66.6%提升至71.8%,冷重启仅达66.8%。结果支持早期终止结合同策略连续恢复。

原文摘要 · Abstract (English)

Software engineering (SWE) agents resolve repository-level issues through long trajectories that grow increasingly expensive as context accumulates. Failed runs tend to be longer and exhibit redundant exploration or looping, suggesting that some failures may be detectable before completion. Early termination, however, risks interrupting trajectories that would otherwise succeed; conversely, an unsuccessful trajectory may still contain useful repository edits. We present FailFast-RestartSmart, a two-stage controller for a single active trajectory. FailFast is a lightweight 0.6B monitor trained with terminal and dense fail-to-pass supervision to predict failure from observable prefixes without policy logits or hidden states. Upon an alarm, RestartSmart launches a fresh same-policy rollout without prior prompt history and offers the interrupted repository diff as an optional overlay that the agent may inspect, apply, or discard. On SWE-bench Verified, a monitor trained solely on Qwen3.6-27B trajectories transfers to three other policies, including a closed-API model, and saves 14.6%-20.4% of execution tokens at a target 5% false-positive rate; on Qwen3.6-27B, its 20.4% saving exceeds the 12.5% achieved by our per-step AgentStop adaptation. At a target 25% false-positive rate, RestartSmart raises Qwen3.6-27B resolution from 66.6% to 71.8%, whereas cold restart reaches only 66.8%. Together, these results support early termination with sequential same-policy recovery.

软件工程智能体早停机制

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。