Skip to content

Better Understanding, Better Fixes? A Study of Hallucination in LLM-based Automated Program Repair

Xuemeng Cai Jiakun Liu Linhan Yang Wei Ma Lingxiao Jiang
Sep 2026 · 0 citations
Computer Science

Abstract

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.

View source

Similar papers

#software testing Book Open access Aug 2026

Evaluating Inference-Time Defenses against Package Hallucination in LLM-Generated Code

The results recast package hallucination as both a measurement problem and a decoding-time control problem, and they demonstrate that the choice of defense must be matched to the threat model and recommendation utility.

Albérick Euraste Djiré, I. E. Olatunji, Melissa Tessa et al. · 1 citation
#machine learning Preprint Sep 2026

MISHAP-Bench: A Hallucination Benchmark for Large Audio-Language Models

This work introduces MISHAP-Bench, a comprehensive benchmark with 12,000 challenging open-ended question-audio pairs and a rigorous evaluation pipeline covering two hallucination categories, and proposes a groundedness judge that uses reference rubrics and judge prompts guided by human annotations.

Wen-Soi Zhi, Giulio Segalini, Jian-Jia Chen et al. · 0 citations
Open access Sep 2026

Large Language Models Create Hallucinations in Response to Negated Text

Large language models (LLMs) have achieved significant advancements in natural language processing tasks, but they remain prone to generating hallucinations—outputs that are logically inconsistent or factually incorrect. While previous research has primarily focused on hallucinations in affirmative contexts, how negate...

Jaehyung Seo, Hyeonseok Moon, Heu-Jeoung Lim · 0 citations
#artificial intelligence Preprint Sep 2026

Beneath the Scores: Rethinking Hallucination Evaluation for Video Understanding Models

A causal stage-intervention protocol that overwrites individual stages while holding the downstream task fixed is introduced, finding that grounding is the dominant source of downstream error, with roughly four times the causal impact of corrupting visual observations.

Shu-Zhi Gong, F. Sun, Yuansan Liu · 0 citations
#artificial intelligence Preprint Sep 2026

Efficiency Hallucination: Formalizing and Measuring Behavioral Calibration in LLM-Based Code Optimization

The integration of Large Language Models (LLMs) into automated code optimization introduces a critical reliability risk we term the Efficiency Hallucination: an LLM's tendency to issue non-functional mutations with unsubstantiated performance claims on already-optimized code. This is driven by the Evaluation Trap, wher...

Sarah Wilson, Gail E. Kaiser, Patrick Musau · 0 citations
Preprint Aug 2026

Execution-Anchored Hallucination Calibration Reranking for Verilog Code Generation

EAHC is proposed, an Execution-Anchored Hallucination Calibration reranking framework that anchors reasoning judgments to execution behavior so that execution-equivalent candidates receive consistent scores, which implements a dual-channel architecture.

Guang Yang, Xing Hu, Xiang Chen et al. · 0 citations

Related blog posts

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.