Lune

ACL Findings2026

Efficient Hallucination Detection in Automatic Code Generation

Georgii Andriushchenko, Roman Garaev, Lyudmila Rvanova, Artem Shelmanov, Vladimir V. Ivanov

摘要

Large language models (LLMs) frequently produce source code that seems correct and wellformed, yet includes hallucinated elements that cause downstream test failures.In this study, we benchmark state-of-the-art uncertainty quantification methods and existing baselines for the task of hallucination detection in source code and introduce a diff-based pipeline to construct a code dataset annotated with line-level hallucinations.Building on this, we train a lightweight Transformer-based detector that uses LLM internal representations to identify hallucinations, substantially outperforming existing methods across several code generation domains.The detector also shows particular promise for enabling self-correction in LLM-based coding agents.We release the first publicly available dataset of line-level code hallucinations, along with the corresponding source code and trained hallucination detectors https://github.com/ datapaf/CodeHallucinationDetection Generated Code (Collu-Bench) Correct Code (Collu-Bench) Line Splitting Diff Utility Lines of Correct Code

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

可以从这些问题问起

Lune 可以查阅

全文 · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • LLM-Check: Investigating Detection of Hallucinations in Large Language Models 引用了 The Internal State of an LLM Knows When It's Lying
  • LLM-Check: Investigating Detection of Hallucinations in Large Language Models 引用了 Uncertainty Estimation in Autoregressive Structured Prediction
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

它引用的 Paper14

  1. CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan 等EMNLP Findings 2020 · 2,828 次引用
  2. SWE-bench: Can Language Models Resolve Real-world Github Issues?Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao 等ICLR 2024 · 2,082 次引用
  3. Uncertainty Estimation in Autoregressive Structured PredictionAndrey Malinin, Mark J. F. GalesICLR 2021 · 439 次引用
  4. The Internal State of an LLM Knows When It's LyingAmos Azaria, Tom M. MitchellEMNLP Findings 2023 · 177 次引用
  5. LLM-Check: Investigating Detection of Hallucinations in Large Language ModelsGaurang Sriramanan, Siddhant Bharti, Vinu Sankar Sadasivan, Shoumik Saha 等NeurIPS 2024 · 170 次引用

相关 Paper

  1. CodeHalu: Investigating Code Hallucinations in LLMs via Execution-based VerificationYuchen Tian, Weixiang Yan, Qian Yang, Xuandong Zhao 等AAAI 2025 · 41 次引用
  2. Hallucinations in LLM-Based Code Summarization: Unveiling, Detection, and MitigationGuanghua Wan, Yuanning Feng, Yao Wan, Zhaoyang Chu 等FSE 2026
  3. LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and MitigationZiyao Zhang, Chong Wang, Yanlin Wang, Ensheng Shi 等ISSTA 2025 · 53 次引用
  4. The Dawn After the Dark: An Empirical Study on Factuality Hallucination in Large Language ModelsJunyi Li, Jie Chen, Ruiyang Ren, Xiaoxue Cheng 等ACL 2024 · 49 次引用
  5. ETF: An Entity Tracing Framework for Hallucination Detection in Code SummariesKishan Maharaj, Vitobha Munigala, Srikanth G. Tamilselvam, Prince Kumar 等ACL 2025 · 4 次引用
黄昏的海面,两侧是细线勾勒的悬崖