A Taxonomy of Inefficiencies in LLM-Generated Python Code
Authors:
- 7 September 2025
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 393-404
Abstract
Large Language Models (LLMs) are widely adopted for automated code generation with promising results. Although prior research has assessed LLM-generated code and identified various quality issues- such as redundancy, poor maintainability, and sub-optimal performance- a systematic understanding and categorization of these inefficiencies remain unexplored. Therefore, we empirically investigate inefficiencies in LLM-generated Python code by state-of-the-art models, i.e., CodeLlama, DeepSeek-Coder, and CodeGemma. To do so, we manually analyze 492 generated Python code snippets in the HumanEval+ dataset. We then construct a taxonomy of inefficiencies in LLM-generated Python code that includes 5 categories (General Logic, Performance, Readability, Maintainability, and Errors) and 19 subcategories of inefficiencies. We validate the obtained taxonomy through an online survey with 58 LLM practitioners and researchers. The surveyed participants affirmed the completeness of the proposed taxonomy, and the relevance and the popularity of the identified code inefficiency patterns. Our qualitative findings indicate that inefficiencies are diverse and interconnected, affecting multiple aspects of code quality, with logic and performance-related inefficiencies being the most frequent and often co-occurring while impacting overall code quality. Our taxonomy provides a structured basis for evaluating the quality of LLM-generated code and guiding future research to improve code generation efficiency.Keywords
All Related Versions
This publication has 32 references indexed in Scilit:
- Bugs in large language models generated code: an empirical studyEmpirical Software Engineering, 2025
- Towards an understanding of large language models in software engineering tasksEmpirical Software Engineering, 2024
- Fine-Tuning CodeLlama to Fix Bugs2024
- User Centric Evaluation of Code Generation Tools (Invited Paper)2024
- GitHub Copilot AI pair programmer: Asset or Liability?Journal of Systems and Software, 2023
- Faults in deep reinforcement learning programs: a taxonomy and a detection approachAutomated Software Engineering, 2021
- Recommending Code Understandability Improvements Based on Code Reviews2021
- Code smells and refactoring: A tertiary systematic review of challenges and observationsJournal of Systems and Software, 2020
- A Systematic Review on Code Clone DetectionIEEE Access, 2019
- Qualitative methods in empirical studies of software engineeringIEEE Transactions on Software Engineering, 1999