Conference paper
Hierarchical Knowledge Injection for Improving LLM-based Program Repair
IEEE/ACM International Conference on Automated Software Engineering : [proceedings], pp 1440-1452
16 Nov 2025
Abstract
Prompting LLMs with bug-related context (e.g., error messages, stack traces) improves automated program repair, but many bugs still remain unresolved. In real-world projects, developers often rely on broader repository and project-level context beyond the local code to resolve such bugs. In this paper, we investigate how automatically extracting and providing such knowledge can improve LLM-based program repair. We propose a layered knowledge injection framework that incrementally augments LLMs with structured context. It starts with the Bug Knowledge Layer, which includes information such as the buggy function and failing tests; expands to the Repository Knowledge Layer, which adds structural dependencies, related files, and commit history; and finally injects the Project Knowledge Layer, which incorporates relevant details from documentation and previously fixed bugs. We evaluate this framework on a dataset of 314 bugs from BugsInPy using two LLMs (Llama 3.3 and GPT-4o-mini), and analyze fix rates across six bug types. By progressively injecting knowledge across layers, our approach achieves a fix rate of 79% (250/314) using Llama 3.3, a significant improvement of 23% over previous work. All bug types show improvement with the addition of repository-level context, while only a subset benefit further from project-level knowledge, highlighting that different bug types require different levels of contextual information for effective repair. We also analyze the remaining unresolved bugs and find that more complex and structurally isolated bugs, such as Program Anomaly and GUI bugs, remain difficult even after injecting all available information. Our results show that layered context injection improves program repair and suggest the need for interactive and adaptive APR systems.
Metrics
1 Record Views
Details
- Title
- Hierarchical Knowledge Injection for Improving LLM-based Program Repair
- Creators
- Ramtin Ehsani - Drexel University, College of Computing and InformaticsEsteban Parra - Belmont UniversitySonia Haiduc - Florida State UniversityPreetha Chatterjee - Drexel University, Computer Science
- Publication Details
- IEEE/ACM International Conference on Automated Software Engineering : [proceedings], pp 1440-1452
- Conference
- 2025 40th IEEE/ACM International Conference on Automated Software Engineering (ASE), 40th (Seoul, Korea, Republic of, 16 Nov 2025–20 Nov 2025)
- Publisher
- IEEE
- Number of pages
- 13
- Resource Type
- Conference paper
- Language
- English
- Academic Unit
- Computer Science; College of Computing and Informatics
- Web of Science ID
- WOS:001706323100114
- Scopus ID
- 2-s2.0-105034653925
- Other Identifier
- 9798350357332; 991022172970504721