Miami University
Evaluating Iterative Feedback Mechanisms for Secure and Functional LLM Code Generation
Abstract
dc:descriptionThe increasing adoption of Large Language Models (LLMs) as software development assistants has transformed modern programming by enabling developers to generate complete applications from natural language specifications. Despite their impressive capabilities, LLM-generated code frequently contains security vulnerabilities and functional defects that limit its safe deployment in real-world systems. This thesis investigates whether iterative feedback mechanisms can improve the security and functional correctness of LLM-generated backend applications. Two refinement strategies are evaluated: static-analysis-driven refinement using the Bandit security scanner and execution-based refinement using automated functional and security test suites. Experiments were conducted using five frontier language models, Claude Sonnet 4.5, Claude Opus 4.7, GPT-4o, GPT-5, and GPT-5.5, on the BaxBench and SecCodePLT benchmark datasets. Results demonstrate that execution-based unit-test feedback consistently improves both functional correctness (pass@1) and secure functional correctness (sec-pass@1) across all evaluated models, with several models achieving over 90% sec-pass@1 on BaxBench. In contrast, static-analysis-driven refinement generally produced limited improvements and, in several cases, reduced functional correctness despite identifying potential vulnerabilities. These findings demonstrate that execution-based iterative refinement is substantially more effective than static-analysis-driven refinement for improving LLM-generated code and highlight the importance of incorporating automated execution feedback into AI-assisted software development workflows.
Degree
thesis:*- Name thesis:degree_name
- Master of Science in Computer Science
- Level thesis:degree_level
- masters
- Discipline thesis:degree_discipline
- Computer Science
- Grantor dc:publisher
- Miami University
- Year dc:date
- 2026
Author and committee
dc:creator, dc:contributor.*- Author dc:creator
-
- Acharya, Prashant
- Advisor dc:contributor.advisor
-
- Walden, James
Subjects
dc:subject × 4- Computer Science
- Engineering
- Artificial Intelligence
- Large Language Models, LLMs, Secure Code Generation, Iterative Refinement, Automated Feedback, Test-Driven Refinement, Static Analysis, Software Security, Cybersecurity, Prompt Engineering, Code Generation, Artificial Intelligence, Machine Learning, Bandit, Secure Software Engineering, Large Language Model Security, Automated Program Repair
Rights
dc:rights- Statement dc:rights
-
- restricted--full text unavailable until 2028-07-28
- This thesis or dissertation is protected by copyright: all rights reserved. It may not be copied or redistributed beyond the terms of applicable copyright laws.
- Language dc:language
- English
Identifiers
dc:identifier.*- Repository record dc:identifier
- http://rave.ohiolink.edu/etdc/view?acc_num=miami1784763275584884