A Systematic Literature Review of Code Hallucinations in LLMs: Characterization, Mitigation Methods, Challenges, and Future Directions for Reliable AI
Not on the map. Why?
Abstract (arXiv)
Model hallucination is one of the most critical challenges faced by Large Language Models (LLMs), especially in high-stakes code intelligence tasks. As LLMs become increasingly integrated into software engineering tasks, understanding and mitigating hallucination in code becomes essential. In this survey, we provide a systematic review of hallucination phenomena in code-oriented LLMs from four key perspectives. First, we begin by surveying 60 papers to define hallucination in the context of code and summarize its primary causes, such as data noise, exposure bias, and insufficient semantic grounding, while also tracing recent trends in literature across natural language processing (NLP) and software engineering communities. Second, we review model hallucination surveys in a broader span and summarize representative hallucination mitigation strategies, such as knowledge-enhanced generation, constrained decoding, and post-editing. Third, we review approaches targeted for code intelligence and highlight code-specific challenges that aggravate hallucination, including syntax sensitivity, strict type systems, and dependence on external libraries. Meanwhile, we analyze how emerging code intelligence tasks, e.g., program analysis, symbolic execution, and unit testing, are utilized to detect and mitigate hallucinations. Fourth, we summarize current evaluation benchmarks, ranging from static metrics to dynamic checks, e.g., compilation and execution correctness, and emphasize the need for hallucination-oriented benchmarks.
Key facts. Cited by 6 papers in the map (data through 13 Oct 2026). First posted on arXiv 2 Nov 2025.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2026: 6.
6 papers.
- 2026ContextCov: Deriving and Enforcing Executable Constraints from Agent Instruction Filescited by 6
- 2026Delulu: A Verified Multi-Lingual Benchmark for Code Hallucination Detection in Fill-in-the-Middle Taskscited by 3
- 2026Functional Entropy: Predicting Functional Correctness in LLM-Generated Code with Uncertainty Quantificationcited by 3
- 2026ConceptRM: The Quest to Mitigate Alert Fatigue through Consensus-Based Purity-Driven Data Cleaning for Reflection Modellingcited by 0
- 2026Empirical Analysis and Detection of Hallucinations in LLM-Generated Bug Report Summariescited by 0
- 2026Large Language Models at the Intersection of Software Engineering and Software Security:An Evidence-Centered Structured Survey and Research Agendacited by 0
- 2026Large Language Models at the Intersection of Software Engineering and Software Security:An Evidence-Centered Structured Survey and Research Agenda21 Aug 2026
- 2026Functional Entropy: Predicting Functional Correctness in LLM-Generated Code with Uncertainty Quantification27 May 2026
- 2026Empirical Analysis and Detection of Hallucinations in LLM-Generated Bug Report Summaries22 May 2026
- 2026Delulu: A Verified Multi-Lingual Benchmark for Code Hallucination Detection in Fill-in-the-Middle Tasks7 May 2026
- 2026ContextCov: Deriving and Enforcing Executable Constraints from Agent Instruction Files28 Feb 2026
- 2026ConceptRM: The Quest to Mitigate Alert Fatigue through Consensus-Based Purity-Driven Data Cleaning for Reflection Modelling9 Feb 2026