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

📅 2025-06-12
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Existing repository-level LLM-based program repair methods suffer from two key limitations: (1) isolated problem processing without leveraging historical repair experience, and (2) reliance on static prompts, resulting in poor generalization. To address these, we propose the first human-inspired dual-memory mechanism: an episodic memory that stores concrete repair instances and a semantic memory that distills generalized repair patterns—dynamically fused to generate context-aware prompts. Integrated with retrieval augmentation, memory encoding, and dynamic prompt synthesis, our approach achieves 49.3% pass@1 on SWE-bench Lite using Claude 3.7 Sonnet, significantly outperforming all open-source state-of-the-art methods. Our core contributions are: (1) an evolvable, memory-driven program repair paradigm; (2) a code-specific semantic-episodic collaborative memory architecture; and (3) a fine-tuning-free framework for dynamic, context-sensitive prompt generation.

Technology Category

Application Category

📝 Abstract
Automatically repairing software issues remains a fundamental challenge at the intersection of software engineering and AI. Although recent advancements in Large Language Models (LLMs) have demonstrated potential for repository-level repair tasks, current methodologies exhibit two notable limitations: (1) they often address issues in isolation, neglecting to incorporate insights from previously resolved issues, and (2) they rely on static and rigid prompting strategies, which constrain their ability to generalize across diverse and evolving issue scenarios. Inspired by the dual memory systems of human cognition, where episodic and semantic memories work synergistically to support human reasoning and decision-making, we propose ExpeRepair, a novel LLM-based approach that continuously learns from historical repair experiences through dual-channel knowledge accumulation. ExpeRepair organizes historical repair experiences into two complementary memories: an episodic memory that stores concrete repair demonstrations, and a semantic memory that encodes abstract reflective insights. At inference time, ExpeRepair activates both memory systems by retrieving relevant demonstrations from episodic memory and recalling high-level repair insights from semantic memory. It further enhances adaptability through dynamic prompt composition, synergistically integrating both memory types to replace static prompts with context-aware, experience-driven prompts. Experiments on the SWE-bench Lite benchmark demonstrate that ExpeRepair achieves a pass@1 score of 49.3% with Claude 3.7 Sonnet, outperforming all state-of-the-art open-source methods.
Problem

Research questions and friction points this paper is trying to address.

Addresses limitations in LLM-based repository-level software repair
Enhances repair accuracy by leveraging dual-memory learning from historical fixes
Improves adaptability with dynamic prompts over static strategies
Innovation

Methods, ideas, or system contributions that make the work stand out.

Dual-memory system for continuous learning
Dynamic prompt composition for adaptability
Repository-level repair with contextual insights
F
Fangwen Mu
State Key Laboratory of Intelligent Game, Institute of Software, Chinese Academy of Sciences; University of Chinese Academy of Sciences
J
Junjie Wang
State Key Laboratory of Intelligent Game, Institute of Software, Chinese Academy of Sciences; University of Chinese Academy of Sciences
Lin Shi
Lin Shi
Beihang University
Software Engineering
S
Song Wang
Lassonde School of Engineering, York University
Shoubin Li
Shoubin Li
Institute of Software, Chinese Academy of Sciences
Knowledge Graph
Q
Qing Wang
State Key Laboratory of Intelligent Game, Institute of Software, Chinese Academy of Sciences; University of Chinese Academy of Sciences