Skip to content
Preprint

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

Sep 2026 · 0 citations
Computer Science

TL;DR

This work examines 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, showing that both repair and understanding hallucinations remain prevalent.

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

Preprint Oct 2026

Fix What's Wrong, Keep What's Right: Hallucination Repair for LLM-Based Optimization Modeling

Large language models (LLMs) are increasingly being explored to automate operations research modeling, reduce modeling time and lower the expertise barrier to optimization based decision support. However, this process often introduces inconsistencies between generated artifacts and the original problem, which we refer...

Jia-Geng Wu, Chao Shen, Zi-Han Guo et al. · 1 citation
#artificial intelligence Preprint Oct 2026

PHRBench: A Behavioral Evaluation of Post-Hallucination Reasoning in LLMs

PHRBench is introduced, a controlled benchmark for behaviorally structured PHR across four domains and 18 large language models, and it is found that properties of the hallucinated prompt contain substantial predictive signal for successful recovery, with a lightweight predictor achieving an AUROC of 0.847.

Ling-Hao Meng, Feng He, Xuan Yang et al. · 0 citations

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

It is demonstrated that LLMs struggle to handle negation effectively, applying affirmative knowledge inappropriately, leading to hallucinations that contradict the negated input, compromising the logical consistency and factual accuracy of LLM outputs.

Jaehyung Seo, Hyeonseok Moon, Heu-Jeoung Lim · 0 citations

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 Oct 2026

Target-Aware Curation of Hallucination Stress Tests for Large Language Models

Hallucination stress tests can yield similar average scores across language models even when different prompts elicit hallucinations in each model. We develop a procedure that iteratively edits source-grounded seed prompts to expose hallucinations in a target model. An LLM editor revises each prompt in response to the...

Ji-Ho Lee, Bing-Quan Zhang, Lin Liang et al. · 0 citations

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