arrow
返回

Bugs in large language models generated code: an empirical study

大型语言模型生成代码中的错误: 一项实证研究

delete2025-02-13
delete0
delete
OA
AI
F
Florian Tambon
A
Arghavan Moradidakhel *
A
Amin Nikanjam
F
Foutse Khomh
M
Michel C. Desmarais
G
Giuliano Antoniol
DOI:10.1007/s10664-025-10614-4delete
delete原文链接
delete分享
delete收藏
摘要

摘要

En 中文
Large Language Models (LLMs) for code have gained significant attention recently. They can generate code in different programming languages based on provided prompts, fulfilling a long-lasting dream in Software Engineering (SE), i.e., automatic code generation. Similar to human-written code, LLM-generated code is prone to bugs, and these bugs have not yet been thoroughly examined by the community. Given the increasing adoption of LLM-based code generation tools (e.g., GitHub Copilot) in SE activities, it is critical to understand the characteristics of bugs contained in code generated by LLMs. This paper examines samples of 333 bugs collected from code generated using three leading LLMs (i.e., CodeGen, PanGu-Coder, and Codex) and identifies the following 10 distinctive bug patterns: Misinterpretations, Syntax Error, Silly Mistake, Prompt-biased code, Missing Corner Case, Wrong Input Type, Hallucinated Object, Wrong Attribute, Incomplete Generation, and Non-Prompted Consideration. The bug patterns are presented in the form of a taxonomy. The identified bug patterns are validated using online surveys with over 50 LLM practitioners and researchers. The surveyed participants generally asserted the significance and prevalence of the bug patterns. Researchers and practitioners can leverage these findings to develop effective quality assurance techniques for LLM-generated code. This study sheds light on the distinctive characteristics of LLM-generated code.
Keyword:
Large language models
Bugs
Software testing
Empirical study
err分享
err收藏
Isolating Compiler Bugs by Generating Effective Witness Programs With Large Language Models
err2024-07-01
err0
errOAAI
errTu, Haoxin; Zhou, Zhide; Jiang, He; Yusuf, Imam Nur Bani; Li, Yuxian; Jiang, Lingxiao
err分享
err收藏
err分享
err收藏
err分享
err收藏
err分享
err收藏
An Empirical Study of Bugs in the rustc Compiler对rustc编译器中错误的实证研究
err2025-10-01
err0
PREAI
errLiu, Zixi; Feng, Yang; Ni, Yunbo; Li, Shaohua; Yin, Xizhe; Shi, Qingkai; Xu, Baowen; Su, Zhendong
err分享
err收藏

期刊

Empirical Software Engineering 封面图
Empirical Software Engineering
IF:
3.6
论文数:
2.0K
被引数:
6.4K

机构

U
université de montréal
学者数:
1.0K
论文数: 435
被引数: 2.3W
引用论文

引用论文

Serum lipid abnormalities in heart transplant recipients: predominance of HDL2-like particles in the HDL pattern心脏移植受者的血脂异常: HDL模式中HDL2-like颗粒的优势
err1990-03-01
err0
PREAI
errVéronique Atger; Michèle Cambillau; Romain Guillemain; Dominique Farge; Gilles Dreyfus; Sylvie Hamon; Anik Girard; Alain Carpentier; Nicole Moatti
err分享
err收藏
err分享
err收藏
Plasmonic porous ceramics based on zirconia-toughened alumina functionalized with silver nanoparticles for surface-enhanced Raman scattering
err2022-03-01
err0
errOAAI
errTongwei Guo; Md Nurul Karim; Kowsik Ghosh; M. Mangir Murshed; Kurosch Rezwan; Michael Maas
err分享
err收藏
err分享
err收藏
The inflammation-based modified Glasgow Prognostic Score in patients with vulvar cancer
err2010-03-01
err0
PREAI
errKatrin Hefler-Frischmuth; Veronika Seebacher; Stephan Polterauer; Clemens Tempfer; Alexander Reinthaller; Lukas Hefler
err分享
err收藏
Nonsurgical management of benign prostatic hyperplasia in men with bladder calculi
err2002-08-01
err0
PREAI
errR.Corey O’Connor; Brett A Laven; Gregory T Bales; Glenn S Gerber
err分享
err收藏
err分享
err收藏
Electrochemical Impedance Spectroscopy and Determination of the Internal Resistance as a Way to Estimate Lead-Acid Batteries Condition
err2018-12-12
err0
errOAAI
errWłodzimierz Majchrzycki; Ewa Jankowska; Marek Baraniak; Piotr Handzlik; Robert Samborski
err分享
err收藏
学者 查看更多内容