EMNLP 2026Findings

From Bugs to Fixes: Self-Evolving Hierarchical Knowledge Graphs for LLM-Based Code Repair

Authors: Haoyue Ran, Junguo Zhu, Hongyu Ge

Abstract

Large Language Models have shown remarkable potential in automated code generation, yet the programs they produce frequently fail due to logical flaws or unhandled edge cases. To address this, we propose RA-CRF, a Retrieval-Augmented Code Repair Framework that explicitly integrates a structured Error-Repair Knowledge Graph (ERKG). Unlike existing methods that rely on unstructured self-reflection or raw execution feedback, our framework constructs a hierarchical taxonomy connecting error types to specific repair strategies. By leveraging execution feedback, the framework retrieves relevant knowledge to generate structured repair documents, effectively decoupling error diagnosis from targeted code editing. Furthermore, we introduce an adaptive self-evolution mechanism that continuously refines the ERKG by persisting verified repair results. Experimental results on single-function benchmarks including BigCodeBench demonstrate that RA-CRF achieves significant performance gains across various open-source and closed-source models. Notably, RA-CRF lifts DeepSeek-V3 to 65.52% Pass@1, a new best on the official BigCodeBench leaderboard. Our findings indicate that integrating explicit and evolvable error-correction knowledge is a robust path to enhancing the reliability and interpretability of code generated by large language models.

PDFOpen original
Find similar papers with AI

Copy this prompt into your assistant

Using Paperlist, find papers similar to "From Bugs to Fixes: Self-Evolving Hierarchical Knowledge Graphs for LLM-Based Code Repair" (id: 242324, EMNLP 2026).
set up https://paperlist.ai/SKILL.md

MCP setupCLI