HAFix: History-Augmented Large Language Models for Bug Fixing
Yu Shi, Abdul Ali Bangash, Emad Fallahzadeh, Bram Adams, Ahmed E. Hassan

TL;DR
HAFix enhances large language models' bug-fixing abilities by leveraging historical data and heuristics, leading to significant improvements in bug-fixing rates and insights into effective prompt styles for software engineering tasks.
Contribution
This paper introduces HAFix, a novel history-augmented approach that combines multiple heuristics and prompt styles to improve LLM-based bug fixing in software engineering.
Findings
HAFix heuristics significantly outperform non-historical baselines.
HAFix-Agg increases bug-fixing rates by ~45-50%.
Instruction prompt style is most effective.
Abstract
Recent studies have explored the performance of Large Language Models (LLMs) on various Software Engineering (SE) tasks, such as code generation and bug fixing. However, these approaches typically rely on the context data from the current snapshot of the project, overlooking the potential of rich historical data residing in real-world software repositories. Additionally, the impact of prompt styles on LLM performance for SE tasks within a historical context remains underexplored. To address these gaps, we propose HAFix, which stands for History-Augmented LLMs on Bug Fixing, a novel approach that leverages seven individual historical heuristics associated with bugs and aggregates the results of these heuristics (HAFix-Agg) to enhance LLMs' bug-fixing capabilities. To empirically evaluate HAFix, we employ three Code LLMs (i.e., Code Llama, DeepSeek-Coder and DeepSeek-Coder-V2-Lite models)…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNatural Language Processing Techniques · Topic Modeling · Software Engineering Research
