LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and Mitigation
Sun Yat-sen University · Nanyang Technological University · +1 more institution
Abstract
Code generation aims to automatically generate code from input requirements, significantly enhancing development efficiency. Recent large language models (LLMs) based approaches have shown promising results and revolutionized code generation task. Despite the promising performance, LLMs often generate contents with hallucinations, especially for the code generation scenario requiring the handling of complex contextual dependencies in practical development process. Although previous study has analyzed hallucinations in LLM-powered code generation, the study is limited to standalone function generation. In this paper, we conduct an empirical study to study the phenomena, mechanism, and mitigation of LLM…
Citation impact
- FWCI
- 135.41
- Percentile
- 100%
- References
- 16
Authors
9- ZZZiyao ZhangCorresponding
Sun Yat-sen University
- CWChong Wang
Nanyang Technological University
- YWYanlin Wang
Sun Yat-sen University
- ESEnsheng Shi
Huawei Technologies (China)
- YMYuchi Ma
Huawei Technologies (China)
Topics & keywords
- Code (set theory)
- Code generation
- Computer science
- Mechanism (biology)
- Mainstream
- Process (computing)
- Risk analysis (engineering)
- Computer security