PatchRecall: Patch-Driven Retrieval for Automated Program Repair
PatchRecall is a hybrid retrieval approach that combines codebase matching with history-based analysis to balance high recall and conciseness in selecting relevant files for Automated Program Repair, thereby improving effectiveness on benchmarks like SWE-Bench without significantly increasing the number of retrieved files.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are a master mechanic (an AI) hired to fix a specific problem in a massive, sprawling city of buildings (a software codebase). The city has thousands of buildings, and the problem description you received is vague: "The traffic light at the main intersection is blinking red when it should be green."
Your job is to find the exact blueprints for the specific building that needs fixing, read them, and make the repair.
The Problem: The "Needle in a Haystack" Dilemma
In the past, when mechanics tried to fix these cities, they used a simple search engine. They would type "traffic light" into a giant library of blueprints.
- The Issue: The search engine would pull out 50 blueprints. Maybe 2 of them were actually about the traffic light, but the other 48 were about street signs, bus stops, or power lines.
- The Consequence: The mechanic gets overwhelmed by all that extra noise. They might fix the wrong building, or get so confused by the irrelevant papers that they give up.
- The Reality: In 8 out of 10 cases, the fix only requires changing one single file (one single blueprint). But the old search methods kept handing them a whole stack of useless papers.
The Solution: PatchRecall (The "Smart Detective")
The authors of this paper, PatchRecall, built a new kind of detective to help the mechanic. Instead of just searching the library, this detective uses two different strategies at the same time and combines the results.
Strategy 1: The "Direct Search" (Looking at the City)
This is the old method, but improved. The detective looks at the current problem description and searches the city's blueprints for keywords.
- Analogy: If the problem is "leaky faucet," this strategy finds all blueprints that mention "plumbing" or "water."
- Weakness: It's good at finding words, but bad at understanding the meaning. It might grab a blueprint for a "water fountain" when you needed a "kitchen sink."
Strategy 2: The "History Book" (Looking at Past Cases)
This is the new, clever part. The detective has a massive notebook of past repairs from similar cities.
- Analogy: The detective thinks, "Wait, three years ago, someone had a 'blinking traffic light' problem. They fixed it by changing the code in the 'Admin Panel' building. Let's look at what they did."
- How it works: The system finds the 10 most similar past problems, looks at which files were changed to fix them, and suggests those same files for the current problem.
- Strength: It learns from experience. Even if the words are slightly different, the pattern of the fix is often the same.
The Magic Mix: "Fusion"
Now, the detective has two lists of suspects:
- List A: Files found by searching the current city (Direct Search).
- List B: Files found by looking at past repair logs (History Book).
The detective doesn't just pick one list. They merge them.
- If a file appears on both lists, it's a top suspect.
- If a file is only on one list, it gets a lower score.
- They create a final, short list of the top 5 most likely files to fix.
Why This Matters
The paper tested this on a famous benchmark called SWE-bench (a giant test of real-world software bugs).
- Before: The AI would grab too many files, get confused, and fail to fix the bug.
- With PatchRecall: The AI gets a shorter, smarter list of files. It finds the right file more often (higher "recall") without getting bogged down by junk data.
The Bottom Line
Think of PatchRecall as upgrading from a generic search engine to a seasoned detective.
- The search engine just matches words.
- The detective matches words AND remembers how similar problems were solved in the past.
By combining these two approaches, the AI can pinpoint the exact file that needs fixing much faster and more accurately, making automated software repair actually work in the real world.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.