The Fact Selection Problem in LLM-Based Program Repair
Not on the map. Why?
Abstract (arXiv)
Recent research has shown that incorporating bug-related facts, such as stack traces and GitHub issues, into prompts enhances the bug-fixing capabilities of large language models (LLMs). Considering the ever-increasing context window of these models, a critical question arises: what and how many facts should be included in prompts to maximise the chance of correctly fixing bugs? To answer this question, we conducted a large-scale study, employing over 19K prompts featuring various combinations of seven diverse facts to rectify 314 bugs from open-source Python projects within the BugsInPy benchmark. Our findings revealed that each fact, ranging from simple syntactic details like code context to semantic information previously unexplored in the context of LLMs such as angelic values, is beneficial. Specifically, each fact aids in fixing some bugs that would remain unresolved or only be fixed with a low success rate without it. Importantly, we discovered that the effectiveness of program repair prompts is non-monotonic over the number of used facts; using too many facts leads to subpar outcomes. These insights led us to define the fact selection problem: determining the optimal set of facts for inclusion in a prompt to maximise LLM's performance on a given task instance. We found that there is no one-size-fits-all set of facts for bug repair. Therefore, we developed a basic statistical model, named Maniple, which selects facts specific to a given bug to include in the prompt. This model significantly surpasses the performance of the best generic fact set. To underscore the significance of the fact selection problem, we benchmarked Maniple against the state-of-the-art zero-shot, non-conversational LLM-based bug repair methods. On our testing dataset of 157 bugs, Maniple repairs 88 bugs, 17% above the best configuration.
Key facts. Cited by 12 papers in the map (data through 7 Oct 2026). First posted on arXiv 8 Apr 2024.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2024: 5; 2025: 1; 2026: 6.
12 papers.
- 2024A Survey on Large Language Models for Code Generationcited by 646
- 2024Statically Contextualizing Large Language Models with Typed Holescited by 9
- 2024RepairBench: Leaderboard of Frontier Models for Program Repaircited by 9
- 2025DocMEdit: Towards Document-Level Model Editingcited by 5
- 2024Integrating Various Software Artifacts for Better LLM-based Bug Localization and Program Repaircited by 4
- 2024Renaissance of Literate Programming in the Era of LLMs: Enhancing LLM-Based Code Generation in Large-Scale Projectscited by 3
- 2026CONCUR: Benchmarking LLMs for Concurrent Code Generationcited by 2
- 2026Design-Specification Tiling for ICL-based CAD Code Generationcited by 0
- 2026How Do LLMs Read Bug Reports? An Empirical Study of Attention in LLMs for Automated Program Repaircited by 0
- 2026When Specifications Conflict: A Symmetry-Based Framework for Measuring LLM Preferencescited by 0
- 2026Recompilation Is Not Enough: Test-Guided Decompiled-C Repaircited by 0
- 2026CIT-CAD: Constraint Intent Tree-based CAD Code Generation and Verificationcited by 0
- 2026CIT-CAD: Constraint Intent Tree-based CAD Code Generation and Verification7 Sep 2026
- 2026Recompilation Is Not Enough: Test-Guided Decompiled-C Repair7 Sep 2026
- 2026When Specifications Conflict: A Symmetry-Based Framework for Measuring LLM Preferences30 Jul 2026
- 2026How Do LLMs Read Bug Reports? An Empirical Study of Attention in LLMs for Automated Program Repair28 Jul 2026
- 2026Design-Specification Tiling for ICL-based CAD Code Generation13 Mar 2026
- 2026CONCUR: Benchmarking LLMs for Concurrent Code Generation4 Mar 2026
- 2025DocMEdit: Towards Document-Level Model Editing26 May 2025
- 2024Renaissance of Literate Programming in the Era of LLMs: Enhancing LLM-Based Code Generation in Large-Scale Projects25 Dec 2024
- 2024Integrating Various Software Artifacts for Better LLM-based Bug Localization and Program Repair5 Dec 2024
- 2024RepairBench: Leaderboard of Frontier Models for Program Repair27 Sep 2024
- 2024Statically Contextualizing Large Language Models with Typed Holes2 Sep 2024
- 2024A Survey on Large Language Models for Code Generation1 Jun 2024