← Latest papers
💻 computer science

EXPEREPAIR: Dual-Memory Enhanced LLM-based Repository-Level Program Repair

ExpeRepair is a novel LLM-based framework that leverages a dual-memory system—comprising episodic memory for concrete repair demonstrations and semantic memory for abstract insights—to dynamically compose context-aware prompts, achieving state-of-the-art open-source performance on SWE-Bench Lite and Verified benchmarks by effectively reusing historical repair knowledge.

Original authors: Fangwen Mu, Junjie Wang, Lin Shi, Song Wang, Shoubin Li, Qing Wang

Published 2026-05-12
📖 4 min read☕ Coffee break read

Original authors: Fangwen Mu, Junjie Wang, Lin Shi, Song Wang, Shoubin Li, Qing Wang

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 trying to fix a complex, vintage car engine. In the past, every time a new problem popped up, you had to start from scratch: read the manual, guess what's wrong, try a fix, and hope it works. If you failed, you'd just try again, forgetting what you learned from the last mistake.

ExpeRepair is like giving that mechanic a super-powered, two-part memory system inspired by how human brains work. Instead of starting from zero every time, this system helps the AI "remember" past repairs and learn from them, making it much better at fixing software bugs.

Here is how it works, broken down into simple concepts:

The Two Types of Memory

The paper explains that human memory isn't just one big bucket; it has two distinct parts. ExpeRepair copies this design:

  1. Episodic Memory (The "Photo Album"):

    • What it is: This is a collection of specific, concrete examples. Think of it as a scrapbook of past repairs. It contains the exact "before and after" photos: the specific error message, the exact code that was broken, and the specific patch that fixed it.
    • How it helps: When a new bug appears, the system flips through this scrapbook to find a similar past case. "Hey, we fixed a similar broken light switch last week; let's try that same trick." This provides a concrete recipe to follow.
  2. Semantic Memory (The "Rulebook"):

    • What it is: This is the abstract wisdom gained from all those past repairs. It's not about specific photos, but about general principles. Think of it as a list of "Best Practices" or "Rules of Thumb" written in plain English.
    • How it helps: It teaches the AI general lessons, like "When fixing security issues, always check for edge cases" or "If a function handles multiple inputs, make sure you fix them all, not just the one mentioned." This helps the AI adapt to new situations it hasn't seen before.

How It Fixes Bugs (The Workflow)

The system uses two "agents" (AI workers) to do the repair: one to write a test script (to prove the bug exists) and one to write the actual fix.

  • The Old Way: The AI gets a bug report, tries to guess a fix based on its general training, and hopes for the best. If it fails, it tries again with the same static instructions.
  • The ExpeRepair Way:
    1. Look Back: Before trying to fix the new bug, the system checks its Photo Album (Episodic Memory) for similar past failures and successes.
    2. Read the Rules: It also checks its Rulebook (Semantic Memory) for high-level advice relevant to this type of problem.
    3. Dynamic Instructions: Instead of using a rigid, pre-written instruction manual, the system creates a custom, "dynamic" prompt for the AI worker. It says, "Here is the new bug. Here is a similar bug we fixed last month (from the Photo Album). And remember this rule about handling edge cases (from the Rulebook)."
    4. Learn and Update: Once the fix is done (or even if it fails), the system saves the experience. It adds the specific details to the Photo Album and summarizes the lesson learned into the Rulebook for next time.

The Results

The researchers tested this system on two famous sets of real-world software bugs (called SWE-Bench Lite and SWE-Bench Verified).

  • The Score: Using a powerful AI model (Claude 4 Sonnet), ExpeRepair successfully fixed 74.6% of the bugs on the harder test set and 60.3% on the lighter set.
  • The Comparison: This was the best performance among all the open-source methods they tested. It beat other top tools like SWE-agent, Aider, and AutoCodeRover.
  • The Cost: It achieved these high scores without needing expensive, time-consuming retraining of the AI model. It just learned by "reading" its own past work.

Why It Matters

The paper argues that current AI repair tools are like students who take a test, get a grade, and then immediately forget everything before the next test. ExpeRepair is like a student who keeps a study guide, reviews their mistakes, and gets smarter with every single problem they solve.

By combining specific examples (Episodic) with general wisdom (Semantic), the system creates a feedback loop where the AI gets better at fixing software the more it works, mimicking how human developers actually learn and improve over time.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →