mlsanityData to 14 Oct 2026

Hallucinations in Code Change to Natural Language Generation: Prevalence and Evaluation of Detection Metrics

arXiv 2508.08661 ↗First posted 12 Aug 2025cs.SE cs.AIcited by 4

Not on the map. Why?

Abstract (arXiv)

Language models have shown strong capabilities across a wide range of tasks in software engineering, such as code generation, yet they suffer from hallucinations. While hallucinations have been studied independently in natural language and code generation, their occurrence in tasks involving code changes which have a structurally complex and context-dependent format of code remains largely unexplored. This paper presents the first comprehensive analysis of hallucinations in two critical tasks involving code change to natural language generation: commit message generation and code review comment generation. We quantify the prevalence of hallucinations in recent language models and explore a range of metric-based approaches to automatically detect them. Our findings reveal that approximately 50% of generated code reviews and 20% of generated commit messages contain hallucinations. Whilst commonly used metrics are weak detectors on their own, combining multiple metrics substantially improves performance. Notably, model confidence and feature attribution metrics effectively contribute to hallucination detection, showing promise for inference-time detection.footnoteAll code and data will be released upon acceptance.

Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 25 of its 48 references that are in the map. First posted on arXiv 12 Aug 2025.

Builds on

25 of 48 references.

References · 25

  1. 2024The Llama 3 Herd of Modelscited by 14,715
  2. 2017Learning Important Features Through Propagating Activation Differencescited by 1,458
  3. 2020Reducing conversational agents' overconfidence through linguistic calibrationcited by 210
  4. 2023Large Language Models for Software Engineering: Survey and Open Problemscited by 181
  5. 2021Jigsaw: Large Language Models meet Program Synthesiscited by 103
  6. 2022Automating Code Review Activities by Large-Scale Pre-trainingcited by 98
  7. 2023Navigating the Grey Area: How Expressions of Uncertainty and Overconfidence Affect Language Modelscited by 91
  8. 2023Inseq: An Interpretability Toolkit for Sequence Generation Modelscited by 78
  9. 2022Detecting and Mitigating Hallucinations in Machine Translation: Model Internal Workings Alone Do Well, Sentence Similarity Even Bettercited by 75
  10. 2023On Early Detection of Hallucinations in Factual Question Answeringcited by 56
  11. 2021Towards Automating Code Review Activitiescited by 54
  12. 2024CodeHalu: Investigating Code Hallucinations in LLMs via Execution-based Verificationcited by 34
13 more
  1. 2022What Makes a Good Commit Message?cited by 20
  2. 2024Cost-Effective Hallucination Detection for LLMscited by 18
  3. 2024Improving Automated Code Reviews: Learning from Experiencecited by 13
  4. 2025Too Noisy To Learn: Enhancing Data Quality for Code Review Comment Generationcited by 12
  5. 2025Rethinking Code Review Workflows with LLM Assistance: An Empirical Studycited by 10
  6. 2024CommitBench: A Benchmark for Commit Message Generationcited by 8
  7. 2024Identifying Inaccurate Descriptions in LLM-generated Code Comments via Test Executioncited by 8
  8. 2022Reducing Hallucinations in Neural Machine Translation with Feature Attributioncited by 5
  9. 2024ETF: An Entity Tracing Framework for Hallucination Detection in Code Summariescited by 5
  10. 2024Deep Learning-based Code Reviews: A Paradigm Shift or a Double-Edged Sword?cited by 5
  11. 2025Emotional Strain and Frustration in LLM Interactions in Software Engineeringcited by 3
  12. 2025Towards Practical Defect-Focused Automated Code Reviewcited by 3
  13. 2022DiffSearch: A Scalable and Precise Search Engine for Code Changescited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 4.

4 papers.