Static Analysis as a Feedback Loop: Enhancing LLM-Generated Code Beyond Correctness
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) have demonstrated impressive capabilities in code generation, achieving high scores on benchmarks such as HumanEval and MBPP. However, these benchmarks primarily assess functional correctness and neglect broader dimensions of code quality, including security, reliability, readability, and maintainability. In this work, we systematically evaluate the ability of LLMs to generate high-quality code across multiple dimensions using the PythonSecurityEval benchmark. We introduce an iterative static analysis-driven prompting algorithm that leverages Bandit and Pylint to identify and resolve code quality issues. Our experiments with GPT-4o show substantial improvements: security issues reduced from >40% to 13%, readability violations from >80% to 11%, and reliability warnings from >50% to 11% within ten iterations. These results demonstrate that LLMs, when guided by static analysis feedback, can significantly enhance code quality beyond functional correctness.
Key facts. Cited by 8 papers in the map (data through 14 Oct 2026). First posted on arXiv 20 Aug 2025.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2026: 8.
8 papers.
- 2026Adaptive Hierarchical Evaluation of LLMs and SAST tools for CWE Prediction in Pythoncited by 1
- 2026Detecting and Correcting Hallucinations in LLM-Generated Code via Deterministic AST Analysiscited by 1
- 2026Themis: Training Robust Multilingual Code Reward Models for Flexible Multi-Criteria Scoringcited by 1
- 2026Enhancing Debugging Skills with AI-Powered Assistance: A Real-Time Tool for Debugging Supportcited by 0
- 2026Enhancing SLMs for Sustainable Code Optimization in Radio-Astronomycited by 0
- 2026Characterizing the Quality Profile of AI-Generated C++ in Productioncited by 0
- 2026What is the Difference Between Me and You? Benchmarking the Quality Gap Between Human-Written and AI-Generated Codecited by 0
- 2026LintEval: Benchmarking LLMs on Linter-Guided File Refactoringcited by 0
- 2026LintEval: Benchmarking LLMs on Linter-Guided File Refactoring14 Oct 2026
- 2026What is the Difference Between Me and You? Benchmarking the Quality Gap Between Human-Written and AI-Generated Code11 Sep 2026
- 2026Characterizing the Quality Profile of AI-Generated C++ in Production6 Aug 2026
- 2026Enhancing SLMs for Sustainable Code Optimization in Radio-Astronomy23 Jul 2026
- 2026Themis: Training Robust Multilingual Code Reward Models for Flexible Multi-Criteria Scoring1 May 2026
- 2026Detecting and Correcting Hallucinations in LLM-Generated Code via Deterministic AST Analysis27 Jan 2026
- 2026Enhancing Debugging Skills with AI-Powered Assistance: A Real-Time Tool for Debugging Support5 Jan 2026
- 2026Adaptive Hierarchical Evaluation of LLMs and SAST tools for CWE Prediction in Python4 Jan 2026