Code Hallucination

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Rahman, Mirza Masfiqur, Kundu, Ashish
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866911981537067008
author Rahman, Mirza Masfiqur
Kundu, Ashish
author_facet Rahman, Mirza Masfiqur
Kundu, Ashish
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2407_04831
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Code Hallucination
Rahman, Mirza Masfiqur
Kundu, Ashish
Artificial Intelligence
Software Engineering
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.
title Code Hallucination
topic Artificial Intelligence
Software Engineering
url https://arxiv.org/abs/2407.04831