StopLoss: Teaching Agents to Predict Failure and Stop Early
Jiarong Liang, Xueguang Ma, Dongfu Jiang, Yuxuan Zhang, Ping Nie, Wenhu Chen
Abstract
Coding agents keep working on runs that will fail verification, and asking a frontier model to watch for this is expensive in its own right. We introduce StopLoss, a small external monitor that learns failure recognition from completed trajectories and their verifier outcomes. The name is inspired by the stop-loss order in finance: StopLoss ends a run early when the run is likely to fail, which saves resources. Final outcomes label earlier local windows, so a fine-tuned language model can score the most recent tool steps in a single forward pass, and a threshold calibrated on successful runs turns that score into an abort decision without changing the executor. Trained on GPT-family SWE-rebench trajectories and evaluated on SWE-bench Verified and a SWE-bench Pro subset with GPT and Claude executors, StopLoss is compared against six general-purpose judges reading identical windows. Outcome supervision lifts failure prediction from near chance to a useful signal at the first check, at one to two orders of magnitude lower cost per check than any tested judge. This translates into savings: relative to completing every task, StopLoss lowers cost per retained solve by 4.5\% on Verified while preserving 99\% of successful runs, and by up to 31\% on the costlier Pro subset, reaching 48\% with a Qwen3-8B backbone, and in all four settings its cost per retained solve is below that of every judge policy. Outcome-trained small monitors can make failure recognition cheap enough for early stopping to pay for itself.
Create a lesson
Related papers
When Tools Fail, Agents Fabricate: Silent Failure and Verification-First Oversight in Tool-Using LLM Agents
Shared title terminologycs.AIGün Kaynar, Boshen Yan, Carl Kingsford
Teaching AI Agent to Play Poker Strategically Through Preference Optimization
Shared title terminologycs.AIPhurinat Polasa, Thanapon Thanadunpremdet, Phatthanasak Kraiduang et al.
Physiology-Aware Graph Attention for Early Ventricular Reentry Prediction
Shared title terminologycs.AIMa{ë}lis Morier, Jairo Rodr{í}guez Padilla, Mihaela Pop et al.
MASIF: Implicit Failures for Process Observability in Multi-Agent Systems
Shared title terminologycs.AIYanwei Huang, Arpit Narechania, Atanu Sinha
Editing as Language: Teaching LLM Agents a Grammar for Native Context Editing
Shared title terminologycs.AIYunlong Deng, Yan Li, Xing Hu et al.
Bridging Concepts: Multi-Agent Reasoning over Scientific Concept Graphs for High-Impact Research Prediction
Shared title terminologycs.AIDonggyu Yoon, Minsung Hwang, Juneha Baek et al.