# LLM Code Smells: A Taxonomy and Detection Approach

arXiv: https://arxiv.org/abs/2605.22976 · HTML: https://mlsanity.com/paper/2605.22976/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 22 of its 251 references that are in the map.
- First posted on arXiv 21 May 2026.

## Builds on (most cited first, 22 of 22)

- [A Survey of Large Language Models](https://mlsanity.com/paper/2303.18223/) (2023)
- [A Survey of Frontiers in LLM Reasoning: Inference Scaling, Learning to Reason, and Agentic Systems](https://mlsanity.com/paper/2504.09037/) (2025)
- [FastVLM: Efficient Vision Encoding for Vision Language Models](https://mlsanity.com/paper/2412.13303/) (2024)
- [BudgetThinker: Empowering Budget-aware LLM Reasoning with Control Tokens](https://mlsanity.com/paper/2508.17196/) (2025)
- [Defining and Detecting the Defects of the Large Language Model-based Autonomous Agents](https://mlsanity.com/paper/2412.18371/) (2024)
- [Are LLMs Correctly Integrated into Software Systems?](https://mlsanity.com/paper/2407.05138/) (2024)
- [Adaptively Robust LLM Inference Optimization under Prediction Uncertainty](https://mlsanity.com/paper/2508.14544/) (2025)
- [A Functional Software Reference Architecture for LLM-Integrated Systems](https://mlsanity.com/paper/2501.12904/) (2025)
- [Code Smells for Machine Learning Applications](https://mlsanity.com/paper/2203.13746/) (2022)
- [A Taxonomy of Prompt Defects in LLM Systems](https://mlsanity.com/paper/2509.14404/) (2025)
- [Zoomer: Adaptive Image Focus Optimization for Black-box MLLM](https://mlsanity.com/paper/2505.00742/) (2025)
- [BUMP: A Benchmark of Reproducible Breaking Dependency Updates](https://mlsanity.com/paper/2401.09906/) (2024)
- [Prompt Smells: An Omen for Undesirable Generative AI Outputs](https://mlsanity.com/paper/2401.12611/) (2024)
- [Understanding Defects in Generated Codes by Language Models](https://mlsanity.com/paper/2408.13372/) (2024)
- [I depended on you and you broke me: An empirical study of manifesting breaking changes in client packages](https://mlsanity.com/paper/2301.04563/) (2023)
- [Analyzing 16,193 LLM Papers for Fun and Profits](https://mlsanity.com/paper/2504.08619/) (2025)
- [ERGO: Efficient High-Resolution Visual Understanding for Vision-Language Models](https://mlsanity.com/paper/2509.21991/) (2025)
- [Ensuring Reproducibility in Generative AI Systems for General Use Cases: A Framework for Regression Testing and Open Datasets](https://mlsanity.com/paper/2505.02854/) (2025)
- [Unboxing Default Argument Breaking Changes in 1 + 2 Data Science Libraries](https://mlsanity.com/paper/2408.05129/) (2024)
- [System Message Generation for User Preferences using Open-Source Models](https://mlsanity.com/paper/2502.11330/) (2025)
- [SpecDetect4ML: Detecting Non-Local ML Code Smells with Code Property Graphs](https://mlsanity.com/paper/2509.20491/) (2025)
- [GLiSE: A Prompt-Driven and ML-Powered Tool for Automated Grey Literature Extraction in Software Engineering](https://mlsanity.com/paper/2512.23066/) (2025)

## Abstract (arXiv)

Large Language Models (LLMs) are increasingly integrated into software systems for diverse purposes, due to their versatility, flexibility, and ability to simulate human reasoning to some extent. However, poor integration of LLM inference in source code can undermine software system quality. Therefore, inadequate LLM integration coding practices must be documented to help developers mitigate such issues. Following our earlier work on LLM code smells, this paper consolidates and refines the concept by presenting a self-contained taxonomy and a catalog of nine LLM code smells. We also create SpecDetect4LLM, a static source code analysis tool for their detection, and conduct extensive empirical evaluations of its detection effectiveness (precision and recall) as well as the prevalence of LLM code smells across 692 open-source software projects (171,194 source files). Our results show that LLM code smells affect 73.5% of the analyzed systems, with a detection precision of 91.3% and a recall of 71.8%.
