ETF: An Entity Tracing Framework for Hallucination Detection in Code Summaries
Not on the map. Why?
Abstract (arXiv)
Recent advancements in large language models (LLMs) have significantly enhanced their ability to understand both natural language and code, driving their use in tasks like natural language-to-code (NL2Code) and code summarisation. However, LLMs are prone to hallucination, outputs that stray from intended meanings. Detecting hallucinations in code summarisation is especially difficult due to the complex interplay between programming and natural languages. We introduce a first-of-its-kind dataset, CodeSumEval, with ~10K samples, curated specifically for hallucination detection in code summarisation. We further propose a novel Entity Tracing Framework (ETF) that a) utilises static program analysis to identify code entities from the program and b) uses LLMs to map and verify these entities and their intents within generated code summaries. Our experimental analysis demonstrates the framework's effectiveness, leading to a 73% F1 score. The proposed approach provides a method for detecting hallucinations by tracing entities from the summary to the code, allowing us to evaluate summary accuracy and localise the error within the summary.
Key facts. Cited by 5 papers in the map (data through 7 Oct 2026). Builds on 18 of its 35 references that are in the map. First posted on arXiv 17 Oct 2024.
Builds on
18 of 35 references.
References · 18
- 2023GPT-4 Technical Reportcited by 18,132
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2024A Survey on Large Language Models for Code Generationcited by 646
- 2023NeMo Guardrails: A Toolkit for Controllable and Safe LLM Applications with Programmable Railscited by 347
- 2023Adaptive Chameleon or Stubborn Sloth: Revealing the Behavior of Large Language Models in Knowledge Conflictscited by 333
- 2024Don't Hallucinate, Abstain: Identifying LLM Knowledge Gaps via Multi-LLM Collaborationcited by 176
- 2022Ask Me Anything: A simple strategy for prompting language modelscited by 155
- 2024Granite Code Models: A Family of Open Foundation Models for Code Intelligencecited by 116
- 2023Do Language Models Know When They're Hallucinating References?cited by 115
- 2024Beyond Functional Correctness: Exploring Hallucinations in LLM-Generated Codecited by 106
6 more
- 2024We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMscited by 61
- 2020Code and Named Entity Recognition in StackOverflowcited by 39
- 2022Improving the Faithfulness of Abstractive Summarization via Entity Coverage Controlcited by 21
- 2024Cost-Effective Hallucination Detection for LLMscited by 16
- 2022Entity-based SpanCopy for Abstractive Summarization to Improve the Factual Consistencycited by 11
- 2024Identifying Inaccurate Descriptions in LLM-generated Code Comments via Test Executioncited by 7
Built on by
Citing papers per year: 2025: 1; 2026: 4.
5 papers.
- 2026HalluJudge: A Reference-Free Hallucination Detection for Context Misalignment in Code Review Automationcited by 5
- 2025Hallucinations in Code Change to Natural Language Generation: Prevalence and Evaluation of Detection Metricscited by 4
- 2026ReFEree: Reference-Free and Fine-Grained Method for Evaluating Factual Consistency in Real-World Code Summarizationcited by 1
- 2026AttnCompress: Dynamic Attention-Guided Trajectory Compression for Software Engineering Agentscited by 1
- 2026Empirical Analysis and Detection of Hallucinations in LLM-Generated Bug Report Summariescited by 0
- 2026AttnCompress: Dynamic Attention-Guided Trajectory Compression for Software Engineering Agents8 Sep 2026
- 2026Empirical Analysis and Detection of Hallucinations in LLM-Generated Bug Report Summaries22 May 2026
- 2026ReFEree: Reference-Free and Fine-Grained Method for Evaluating Factual Consistency in Real-World Code Summarization12 Apr 2026
- 2026HalluJudge: A Reference-Free Hallucination Detection for Context Misalignment in Code Review Automation27 Jan 2026
- 2025Hallucinations in Code Change to Natural Language Generation: Prevalence and Evaluation of Detection Metrics12 Aug 2025