Skip to main content
QUICK REVIEW

[Paper Review] The Fact Selection Problem in LLM-Based Program Repair

Nikhil Parasaram, Huijie Yan|arXiv (Cornell University)|Apr 8, 2024
Advanced Data Storage TechnologiesComputer Science4 citations
TL;DR

This paper identifies the 'fact selection problem' in LLM-based program repair, where including too many bug-related facts in prompts reduces repair effectiveness. The authors conduct a large-scale study across 19,000 prompts and propose Maniple, a statistical fact selection model that outperforms generic fact sets by selecting bug-specific facts, achieving 88 repaired bugs—17% above the best baseline—on the BugsInPy benchmark.

ABSTRACT

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.

Motivation & Objective

  • To investigate how different bug-related facts affect LLM-based program repair performance.
  • To determine whether increasing the number of facts in prompts improves or degrades repair outcomes.
  • To identify the existence of a non-monotonic relationship between fact count and repair success.
  • To develop a tailored fact selection strategy that improves LLM-based repair beyond generic configurations.
  • To evaluate the effectiveness of a statistical model (Maniple) in selecting optimal facts for individual bugs.

Proposed method

  • Conducted a large-scale empirical study using 19,000 prompts with varying combinations of seven distinct facts on 314 bugs from the BugsInPy benchmark.
  • Incorporated diverse facts including code context, stack traces, GitHub issues, and novel semantic facts like angelic values.
  • Proposed Maniple, a statistical model that selects facts specific to each bug based on their individual repair effectiveness.
  • Trained Maniple using historical repair success rates per fact-bug pair to predict optimal fact sets.
  • Evaluated Maniple against zero-shot, non-conversational LLM-based repair methods on a held-out test set of 157 bugs.
  • Used a non-monotonic performance curve to identify the optimal fact count per bug, avoiding overloading prompts.

Experimental results

Research questions

  • RQ1How do different combinations of bug-related facts affect the success rate of LLM-based program repair?
  • RQ2Is there a non-monotonic relationship between the number of facts in a prompt and repair effectiveness?
  • RQ3Can a data-driven, bug-specific fact selection model outperform generic fact sets in LLM-based repair?
  • RQ4What is the impact of including previously unexplored semantic facts—like angelic values—on repair outcomes?
  • RQ5How does the performance of a tailored fact selection model (Maniple) compare to state-of-the-art zero-shot LLM-based repair methods?

Key findings

  • Each of the seven facts—ranging from syntactic code context to semantic angelic values—improves repair success for some bugs that would otherwise remain unfixed.
  • The effectiveness of prompts is non-monotonic: using too many facts leads to a significant drop in repair performance.
  • No single universal set of facts achieves optimal repair across all bugs, confirming the existence of the fact selection problem.
  • Maniple, a bug-specific fact selection model, repaired 88 out of 157 bugs on the test set, outperforming the best generic configuration by 17 percentage points.
  • The inclusion of angelic values as a fact type significantly improved repair outcomes for certain classes of bugs not previously explored in LLM-based repair.
  • The study demonstrates that prompt engineering in LLM-based APR must be adaptive and context-aware, not just additive.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.