Better Understanding, Better Fixes? A Study of Hallucination in LLM-based Automated Program Repair
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) have significantly advanced automated program repair (APR), yet existing evaluations remain largely result-centric and provide limited insight into hallucination during repair. In APR, hallucination may arise not only in final patches but also in the intermediate artifacts that guide patch generation. To address this gap, we perform a multi-layered analysis of hallucination throughout the APR process. Specifically, we characterize hallucination as the production of patches or intermediate artifacts that are not faithfully grounded in the available repair evidence. We examine repair hallucination in final patches and understanding hallucination in intermediate artifacts through three tasks, namely triggering testcase identification, line coverage prediction, and additional testcase generation. We then evaluate three representative LLMs on 832 Defects4J bugs through automatic evaluation and manual analysis. Our results show that both repair and understanding hallucinations remain prevalent. Across models and settings, only 21.0%-55.9% of generated patches pass the developer-written test suite. Moreover, although more accurate intermediate artifacts are generally associated with successful repairs, this relationship does not always hold. Manual analysis of 812 sampled repairs identifies repair hallucinations in 72.7% of cases, including patches that pass all available tests; incorrect causal localization and incorrect repair strategies account for 45.9% and 18.5% of these hallucinations, respectively. Meanwhile, models frequently misidentify triggering testcases, mispredict line coverage involving branching control flow, and generate additional testcases with missing bug-triggering conditions or incorrect expected behavior.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 14 of its 61 references that are in the map. First posted on arXiv 4 Sep 2026.
Builds on
14 of 61 references.
References · 14
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
- 2023A Multitask, Multilingual, Multimodal Evaluation of ChatGPT on Reasoning, Hallucination, and Interactivitycited by 894
- 2023Hallucinations in Large Multilingual Translation Modelscited by 129
- 2025Understanding Software Engineering Agents: A Study of Thought-Action-Result Trajectoriescited by 81
- 2025When Agents go Astray: Course-Correcting SWE Agents with PRMscited by 28
- 2025Agentic Bug Reproduction for Effective Automated Program Repair at Googlecited by 22
- 2024De-Hallucinator: Mitigating LLM Hallucinations in Code Generation Tasks via Iterative Groundingcited by 15
- 2025Hallucination by Code Generation LLMs: Taxonomy, Benchmarks, Mitigation, and Challengescited by 11
- 2026RepoRepair: Leveraging Code Documentation for Repository-Level Automated Program Repaircited by 6
- 2026From Guessing to Seeing: Enhancing LLM-Based Program Repair via Trace-Guided Multi-strategy Debatecited by 6
- 2025Red Teaming Program Repair Agents: When Correct Patches can Hide Vulnerabilitiescited by 5
Built on by
Not cited yet.