Code Hallucination

Mirza Masfiqur Rahman, Ashish Kundu
7/5/2024
cs.AIcs.SE

No confident code implementation found for this paper. 5 possible matches can be shown below.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 5 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{rahman2024code,
  title  = {Code Hallucination},
  author = {Mirza Masfiqur Rahman and Ashish Kundu},
  year   = {2024},
  eprint = {2407.04831},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.04831v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2407.04831.svg)](https://codeofpaper.com/paper/2407.04831)

Discussion