TL;DR
Traditional self-improvement loops for computer-use agents focus entirely on successful attempts, completely discarding failed trajectories. This paper introduces a complementary "failure-case loop" that uses an LLM to diagnose agent failures at inference time and generate targeted code patches to fix them. Without any additional training or weight updates, this approach boosts the state-of-the-art OpenCUA-72B agent's success rate on the OSWorld benchmark by 6.6 percentage points.
What Problem Does This Paper Address?
Building multimodal large language model (MLLM) agents capable of operating computers—like navigating graphical user interfaces (GUIs), typing, and clicking—requires massive amounts of high-quality trajectory data.
Currently, the standard way to improve these agents is through a successful-case loop: the agent executes a task in a verifiable environment, an automatic verifier checks if it succeeded, and the successful trajectories are saved to fine-tune the model.
The glaring flaw? All failed trajectories are thrown away. This is incredibly wasteful because building verifiable environments requires immense human engineering, and failures contain rich, structured information about an agent's exact blind spots (e.g., misclicking a tiny button or getting stuck in an infinite loop). The authors set out to answer a fundamental question: Can we extract actionable value from an agent's failures instead of wasting them?
Methods
The authors introduce a data-centric, inference-time framework called the failure-case loop. Instead of retraining the underlying model, they use an advanced LLM (Claude 4.5 Sonnet) as a "meta-controller" to analyze failed trajectories, diagnose the root cause of the error, and generate Python code patches or prompt modifications to immediately upgrade the agent's behavior.
Through four iterative rounds of this rollout-and-diagnosis loop, the framework automatically converged on four core plug-and-play strategies to mitigate the most common failure modes:
- Visual Search (for Grounding Errors): If the agent misclicks, the system crops a $400 \times 400$ pixel patch around the target, zooms in by $2\times$, marks the original click location with a red circle, and prompts the agent to verify or adjust its coordinates.
- Terminal Execution (for Competency Gaps): Instead of forcing the agent to perform tedious, error-prone GUI actions for system-level tasks (like finding a file path), it teaches the agent to open a terminal (
Ctrl + Alt + T) and execute precise command-line instructions. - Knowledge Support (for Knowledge Deficiencies): The agent is equipped with a curated hotkey cheat sheet (software manual) and a controlled search-engine interface (powered by GPT-5-mini) to look up unfamiliar application syntax on the fly.
- Repetition Warnings (for Redundant Loops): The system monitors a sliding window of the last 5 steps. If it detects repeated thoughts, actions, or identical screen states (tracked via accessibility tree hashes), it triggers a "recovery mode" to force an alternative strategy.
Importantly, this process is mostly automated; human involvement is limited to a lightweight safety check, modifying less than 3% of the LLM-generated code lines.
Datasets
- OSWorld: The primary benchmark used for evaluation. It is a comprehensive, real-world desktop environment covering open-ended tasks like file management and document editing. The authors used an "OSWorld small set" for rapid iteration/ablations and the full set for main results.
- Cross-Benchmark Generalization: To prove the patches weren't overfitted to OSWorld, they evaluated them on OmniACT (desktop tasks), AndroidControl (mobile environments), ScreenSpotPro (GUI grounding), and WebVoyager (web interaction).
Key Insights and Ideas
- Failures are structured supervision: Discarding failures leaves massive performance on the table. By systematically addressing low-level execution bugs (like click precision and repetition), the distribution of remaining failures shifts toward higher-level cognitive challenges like task comprehension.
- Inference-time patching beats retraining: Fine-tuning a 72B parameter model is computationally heavy and slow. Code-level interventions at inference time provide immediate behavioral updates without altering a single model weight.
- Constructive Compositionality: Stacking distinct strategies sequentially yielded a cumulative performance boost, proving that targeted code patches compose constructively rather than interfering with one another.
Key Results
- Substantial Performance Gains: Applying the full framework to OpenCUA-72B on the full OSWorld benchmark increased the task success rate from 42.3% to 48.9% (+6.6 absolute percentage points).
- High Efficiency: This improvement cost zero additional training, introduced a modest 8% runtime overhead, and actually reduced total interaction steps by ~15% by cutting out redundant loops.
- Strong Generalization: The same patches transferred seamlessly to other model architectures (e.g., GUI-Owl-32B) and completely different operating systems, yielding a massive +7.86 point boost on AndroidControl and +4.10 on WebVoyager.
Limitations and Future Work
While human intervention is minimal (<3% of code lines changed), the loop is still semi-automatic because it relies on a human to verify and select the best patch candidates.
To achieve a fully autonomous self-evolving agent, the authors note that future work should focus on replacing the human verifier with a learned reward model trained on historical interaction data to automatically filter and deploy valid code patches.
Summary updated