TL;DR
When AI coding agents try to fix software bugs, they often jump straight into editing code based on fragmented clues, burning through compute budgets on flawed assumptions. BRIEF introduces a universal "quality-checked blueprint" layer that synthesizes project evidence into an explicit, verified Repair Plan before any patch is written. By plugging this assessed plan into existing repair tools—without changing how those tools work—correct bug fixes jump by up to 334% while actually lowering average compute costs.
What Problem Does This Paper Address?
Imagine trying to fix a bug in an unfamiliar codebase late at night. The clues you need are scattered: an inline comment hints at a rule, a failing unit test shows a crash, and the code itself shows the mechanics.
Modern LLM-based Automated Program Repair (APR) agents have access to all these clues. They can read files, run tests, and iterate. Yet, they frequently get lost. Why? Because having access to raw evidence isn't the same as forming a coherent repair intent—understanding what the code is supposed to do and how it violates that expectation.
Usually, an agent's reasoning stays trapped implicitly inside its sprawling chat history, or within a rigid, custom-built workflow. Worse, if an LLM hallucinates a requirement or misreads a test early on, that bad assumption poisons every patch attempt that follows. What’s missing is a way to extract repair intent as a standalone, reusable artifact—and to fact-check that intent against the raw evidence before letting a coding agent act on it.
Methods
The authors introduce BRIEF, an evidence-guided harness that sits in front of an existing repair backend (like an autonomous coding agent), leaving the backend's native tools and loops completely untouched.
BRIEF operates in three main stages:
- Evidence Collector: Gathers natural-language documentation (like Javadocs and inline comments), failing test code/stack traces, and surrounding code context into a neat Evidence Bundle.
- Repair Plan Synthesizer: An LLM translates this bundle into a structured, 7-part Candidate Repair Plan. It explicitly defines the method's intended purpose, doc constraints, code violations, test expectations, rules to satisfy, fix targets, and fix direction (e.g.,
ADD_CODEvs. delete, which helps counter LLMs' known bias toward always adding code). - Plan Assessor & Refinement Loop (The Novel Gatekeeper): Before the backend ever sees the plan, a separate LLM invocation—blinded to the synthesizer's reasoning trace—checks the plan against the raw Evidence Bundle across four dimensions: grounding (no hallucinated code/types), target consistency, coverage (all failing tests accounted for), and concreteness.
If rejected, the synthesizer gets structured feedback and up to 3 rounds to revise it. Only an Accepted Repair Plan is handed to the repair backend. Crucially, if no plan passes muster within 3 rounds, BRIEF throws its hands up, withholds the shaky plan, and lets the backend run its original unguided procedure.
Datasets
BRIEF is evaluated on two benchmarks (no new datasets are introduced, nor are models trained):
- Defects4J (v2.0): A standard benchmark of 835 real-world bugs across 17 Java projects, complete with triggering tests and human developer patches.
- SWE-bench-Live/MultiLang: 41 Java bugs from 11 projects created after December 1, 2025 (the release date of DeepSeek-V3.2), used to verify that gains aren't simply due to the LLM memorizing old bugs from its training data.
Key Insights and Ideas
- Structure beats raw context dumping: Simply feeding all collected documentation, tests, and code directly to an agent helps, increasing fixes from 59 to 127 in ablations. However, structuring that exact same evidence into a Repair Plan jumps fixes to 216 (+70.1%), and assessing it pushes the count to 256 (+18.5%).
- Planning upfront makes agents cheaper, not pricier: Adding a multi-round LLM planning and critique phase sounds expensive. Yet, armed with a crisp, verified plan, downstream agents wander less, process fewer raw context tokens, and converge in fewer iterations—cutting overall per-bug API costs in three out of four setups.
- Guidance should be selective, not mandatory: Under DeepSeek-V3.2, the assessor is strict, rejecting ~70% of plans. Because BRIEF falls back to the baseline rather than forcing bad advice on the backend, it preserves 45 baseline fixes that might otherwise have been derailed.
Key Results
BRIEF was tested across two distinct repair backends (RepairAgent and ReinFix) paired with two LLMs (DeepSeek-V3.2 and GPT-6-Luna):
- Massive jumps in correct fixes: Across all four combinations on Defects4J, BRIEF adds 117 to 197 semantically correct bug fixes—relative gains of 60.9% to 333.9%. (For RepairAgent + GPT-6-Luna, correct fixes leap from 59 to 256).
- Cracking hard bugs: Gains hold across both single-hunk and complex multi-hunk bugs. BRIEF also rescues 86 to 206 bugs per setup where the baseline couldn't even produce a compiling, test-passing ("plausible") patch.
- Contamination-resistant: On the post-cutoff SWE-bench-Live Java bugs with DeepSeek-V3.2, BRIEF boosts correct repairs from 5 to 8 (RepairAgent) and 13 to 16 (ReinFix).
- Lower cost & faster convergence: Repair iterations drop across all four setups. Average per-bug cost drops by 60.1% ($0.143 to $0.057) for RepairAgent and 47.5% ($0.080 to $0.042) for ReinFix under GPT-6-Luna, while remaining roughly cost-neutral under DeepSeek-V3.2.
Limitations and Future Work
- Shared blind spots: Because the Plan Synthesizer and Plan Assessor use the same underlying LLM, they can share biases and misinterpret evidence the same way. An "accepted" plan means it passed evidence checks, not that it's guaranteed to be right (e.g., GPT-6-Luna accepted 97.4% of plans, yielding a 31.5% correct repair rate).
- Fallback overhead & evidence quality: When an LLM frequently fails assessment (like DeepSeek-V3.2), running 3 rounds of planning before falling back to the baseline eats into cost savings. Furthermore, sparse or outdated project docs/tests will naturally limit plan quality, and tests so far are limited to Java.
- Future directions: The authors point toward calibrating assessors to specific LLMs, using heterogeneous or independently trained models as assessors, adaptive refinement budgets, and stronger evidence-aware verification.
Summary updated