ERKG : Error-Repair Knowledge Graph for LLM-Based Code Repair

ACL ARR 2026 January Submission4567 Authors

05 Jan 2026 (modified: 20 Mar 2026)ACL ARR 2026 January SubmissionEveryoneRevisionsBibTeXCC BY 4.0
Keywords: code repair, knowledge graph, retrieval-augmented generation
Abstract: Large language models have demonstrated strong capabilities in automatic code generation tasks, but the programs they generate still often fail in actual execution due to logical errors or missing boundary conditions. To address this issue, we propose a retrieval-augmented code repair framework that explicitly incorporates structured error–repair knowledge to improve the execution reliability of code generated by large language models. Unlike previous methods that mainly relied on unstructured self-reflection or original execution feedback, this paper constructs a hierarchical knowledge graph from error to repair operations. Based on the execution feedback, the framework retrieves relevant knowledge and generates structured repair documents, guiding the model to make minimal and targeted code modifications. Experimental results on BigCodeBench show that the proposed method can absolute improve the PASS@1 index by 5.0-13.5 percentage points on a variety of open-source and closed-source large language models. It is indicated that explicitly introducing error-repair knowledge graph into the code repairing process can significantly enhance the reliability and stability of the repairs.
Paper Type: Long
Research Area: Code Models
Research Area Keywords: retrieval-augmented generation,analysis,inference methods
Contribution Types: Model analysis & interpretability, Data resources
Languages Studied: English
Submission Number: 4567
Loading