mlsanityData to 7 Oct 2026

Code Hallucination

arXiv 2407.04831 ↗First posted 5 Jul 2024cs.AI cs.SEcited by 5

Not on the map. Why?

Abstract (arXiv)

Generative models such as large language models are extensively used as code copilots and for whole program generation. However, the programs they generate often have questionable correctness, authenticity and reliability in terms of integration as they might not follow the user requirements, provide incorrect and/or nonsensical outputs, or even contain semantic/syntactic errors - overall known as LLM hallucination. In this work, we present several types of code hallucination. We have generated such hallucinated code manually using large language models. We also present a technique - HallTrigger, in order to demonstrate efficient ways of generating arbitrary code hallucination. Our method leverages 3 different dynamic attributes of LLMs to craft prompts that can successfully trigger hallucinations from models without the need to access model architecture or parameters. Results from popular blackbox models suggest that HallTrigger is indeed effective and the pervasive LLM hallucination have sheer impact on software development.

Key facts. Cited by 5 papers in the map (data through 7 Oct 2026). Builds on 17 of its 32 references that are in the map. First posted on arXiv 5 Jul 2024.

Builds on

17 of 32 references.

References · 17

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  2. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
  3. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
  4. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  5. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
  6. 2022A Systematic Evaluation of Large Language Models of Codecited by 360
  7. 2024INSIDE: LLMs' Internal States Retain the Power of Hallucination Detectioncited by 317
  8. 2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-Xcited by 294
  9. 2022Factuality Enhanced Language Models for Open-Ended Text Generationcited by 200
  10. 2023Planning with Large Language Models for Code Generationcited by 179
  11. 2023ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generationcited by 166
  12. 2024Beyond Functional Correctness: Exploring Hallucinations in LLM-Generated Codecited by 106
5 more
  1. 2023How Secure is Code Generated by ChatGPT?cited by 77
  2. 2023ICE-Score: Instructing Large Language Models to Evaluate Codecited by 50
  3. 2023SALLM: Security Assessment of Generated Codecited by 35
  4. 2024CodeHalu: Investigating Code Hallucinations in LLMs via Execution-based Verificationcited by 32
  5. 2024Unsupervised Evaluation of Code LLMs with Round-Trip Correctnesscited by 23

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 2; 2025: 2; 2026: 1.

5 papers.