mlsanityData to 7 Oct 2026

Investigating The Smells of LLM Generated Code

arXiv 2510.03029 ↗First posted 3 Oct 2025cs.SE cs.AIcited by 9

Not on the map. Why?

Abstract (arXiv)

Context: Large Language Models (LLMs) are increasingly being used to generate program code. Much research has been reported on the functional correctness of generated code, but there is far less on code quality. Objectives: In this study, we propose a scenario-based method of evaluating the quality of LLM-generated code to identify the weakest scenarios, for which the quality of LLM-generated code should be improved. Methods: The method measures code smells, an important indicator of code quality, and compares them with a baseline formed from reference solutions of professionally written code. The test dataset is divided into various subsets according to the topics of the code and complexity of the coding tasks to represent different scenarios of using LLMs for code generation. We will also present an automated test system for this purpose and report experiments with the Java programs generated in response to prompts given to four state-of-the-art LLMs: Gemini Pro, ChatGPT, Codex, and Falcon. Results: We find that LLM-generated code has a higher incidence of code smells compared to reference solutions. Falcon performed the least badly, with a smell increase of 42.28%, followed by Gemini Pro (62.07%), ChatGPT (65.05%) and finally Codex (84.97%). The average smell increase across all LLMs was 63.34%, comprising 73.35% for implementation smells and 21.42% for design smells. We also found that the increase in code smells is greater for more complex coding tasks and for more advanced topics, such as those involving object-orientated concepts. Conclusion: In terms of code smells, LLMs' performances on various coding task complexities and topics are highly correlated to the quality of human-written code in the corresponding scenarios. However, the quality of LLM-generated code is noticeably poorer than human-written code.

Key facts. Cited by 9 papers in the map (data through 7 Oct 2026). Builds on 14 of its 62 references that are in the map. First posted on arXiv 3 Oct 2025.

Builds on

14 of 62 references.

References · 14

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  2. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  3. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  4. 2021Measuring Coding Challenge Competence With APPScited by 879
  5. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  6. 2024Beyond Functional Correctness: Exploring Hallucinations in LLM-Generated Codecited by 106
  7. 2023Refining ChatGPT-Generated Code: Characterizing and Mitigating Code Quality Issuescited by 78
  8. 2022Automated Repair of Programs from Large Language Modelscited by 71
  9. 2024Benchmarks and Metrics for Evaluations of Code Generation: A Critical Reviewcited by 19
  10. 2020Code Smells and Refactoring: A Tertiary Systematic Review of Challenges and Observationscited by 18
  11. 2024How Propense Are Large Language Models at Producing Code Smells? A Benchmarking Studycited by 6
  12. 2024User Centric Evaluation of Code Generation Toolscited by 4
2 more
  1. 2025Clean Code, Better Models: Enhancing LLM Performance with Smell-Cleaned Datasetcited by 3
  2. 2024ScenEval: A Benchmark for Scenario-Based Evaluation of Code Generationcited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 9.

9 papers.