TL;DR
Researchers have introduced Shepherd, an execution-free "LLM-as-a-judge" framework that identifies why coding agents fail and uses those insights to pick the best results from multiple attempts. By filtering out specific behavioral glitches like "planning without acting" or "hallucinating success," Shepherd boosts the performance of models like o1-low from 21% to 31% on the SWE-bench Verified benchmark—outperforming the much more expensive o1-high model at nearly half the cost.
What Problem Does This Paper Address?
Autonomous coding agents (like those that browse GitHub, edit files, and run tests) have seen massive improvements, yet they still fail to solve about half of the tasks in real-world benchmarks like SWE-bench.
The challenge isn't just about "intelligence"; it's about agency. Even the most powerful models often get "lost" during long-horizon tasks. Until now, we lacked a systematic understanding of these failure modes. Most current improvements rely on scaling up models or using expensive execution-based verifiers (which require a full sandbox environment to run tests for every attempt). The authors sought to identify human-interpretable failure patterns and create a lightweight way to steer agents toward success at test time.
Methods
The authors conducted a massive post-mortem analysis of 3,908 execution trajectories across 18 different state-of-the-art models. From this, they distilled three primary failure patterns:
- FAILURE-TO-ACT (FA): The agent gets stuck in a "planning loop," describing what it should do in text but never actually issuing the environment commands (edits, tests).
- OUT-OF-ORDER-ACTIONS (OOA): The agent tries to do too much at once, issuing interdependent commands (like editing a file it hasn't opened yet) simultaneously rather than sequentially.
- FALSE-TERMINATION (FT): The agent assumes the job is done and calls
finish()without actually running the tests to verify the fix.
Using these patterns, they built Shepherd, a prompt-based judge. Shepherd looks at the textual log (the "trajectory") of an agent's attempt and assigns a score from 0–10 based on the prevalence of these bad behaviors. At test time, they use a Best-of-K strategy: run the agent a few times, let Shepherd score the logs, and select the one with the fewest failure patterns.
Datasets
- SWE-bench Verified: The primary benchmark used for evaluation, consisting of real-world GitHub issues that have been human-verified for correctness.
- New Trajectory Dataset: The authors open-sourced a comprehensive dataset of 3,908 trajectories from 18 models (including o1, Claude 3.5 Sonnet, DeepSeek-V3, and Qwen 2.5) to help the community study agent behavior.
Key Insights and Ideas
- The Reasoning Paradox: Surprisingly, "reasoning-enhanced" models (like the o1 or QwQ families) are actually more prone to False Termination. Because they have strong internal world models, they often "hallucinate" the verification step internally and convince themselves they've succeeded without ever actually interacting with the environment.
- Planning is a Trap: Failure-to-Act is the most prevalent issue across all models. Agents essentially "abandon their agency," acting more like a consultant giving advice than an engineer doing the work.
- Selection > Scaling: The results suggest that for agentic tasks, selecting the best "path" from a smaller model is often more effective and cheaper than simply using a larger, more expensive model for a single attempt.
- Execution-Free works: You don't necessarily need to run the code to know an agent failed. The structure of the conversation (the trajectory) contains enough signals for an LLM judge to rank attempts effectively.
Key Results
- Performance Boost: Applying Shepherd to o1-low increased its success rate on SWE-bench Verified from 21% to 31%.
- Cost Efficiency: Shepherd@2 (two runs of o1-low) outperformed a single run of o1-high (29%) while costing only 57% as much ($800 vs $1400 for the benchmark run).
- Model Agnostic: The benefits were seen across various models, including Qwen3-235B (43% $\rightarrow$ 48.5%) and OpenHands-LM-32B (27% $\rightarrow$ 34%).
- Human Alignment: The Shepherd judge showed a strong monotonic correlation (Spearman $\rho \approx 0.39$) with expert human annotations, proving that LLMs can reliably spot these specific agentic failures.
Limitations and Future Work
- Post-hoc Nature: Shepherd is a selection mechanism, not a training method. It doesn't "fix" the underlying model; it just helps us pick the best output. Future work could involve using these patterns for fine-tuning (DPO/RLHF).
- Domain Specificity: The study is currently limited to software engineering. While the authors suspect these patterns (like over-planning) exist in other agentic domains (e.g., web browsing), this hasn't been tested yet.
- Inference Cost: While cheaper than moving to a larger model, Best-of-K selection still requires generating multiple trajectories, which increases the baseline inference cost compared to a single-shot attempt.
Summary updated