Towards Understanding the Characteristics of Code Generation Errors Made by Large Language Models
Large Language Models (LLMs) have demonstrated unprecedented capabilities in code generation. However, there remains a limited understanding of code generation errors that LLMs can produce. To bridge the gap, we conducted an in-depth analysis of code generation errors across six representative LLMs on the HumanEval dataset. Specifically, we first employed open coding and thematic analysis to distill a comprehensive taxonomy of code generation errors. We analyzed two dimensions of error characteristics-semantic characteristics and syntactic characteristics. Our analysis revealed that LLMs often made non-trivial, multi-line code generation errors in various locations and with various root causes. We further analyzed the correlation between these errors and task complexity as well as test pass rate. Our findings highlighted several challenges in locating and fixing code generation errors made by LLMs. In the end, we discussed several future directions to address these challenges.
Authors
- Da Song (ORCID: https://orcid.org/0000-0001-9267-4229)
- Zhijie Wang (ORCID: https://orcid.org/0000-0003-4559-5426)
- Tianyi Zhang (ORCID: https://orcid.org/0000-0002-9266-6082)
- Lei Ma (ORCID: https://orcid.org/0000-0002-8298-3703)
- Zijie Zhou (ORCID: https://orcid.org/0009-0001-4410-339X)
- Yuheng Huang (ORCID: https://orcid.org/0000-0003-3666-4020)
- Shengmai Chen
Institutions
- University of Alberta (CA)
- University of Illinois Urbana-Champaign (US)
- Purdue University West Lafayette (US)
- The University of Tokyo (JP)
Publication Details
- Published
- 2025-04-26
- DOI
- https://doi.org/10.1109/icse55347.2025.00180
- Citations
- 7
- Primary Topic
- Software Testing and Debugging Techniques
- Type
- article
- Field-Weighted Citation Impact
- 16.16