Back to search

Miami University

Evaluating Iterative Feedback Mechanisms for Secure and Functional LLM Code Generation

Abstract

dc:description

The 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

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.*

Chain of custody

source
Harvested from
OhioLINK
Base URL
etd.ohiolink.edu/acprod/odb_etd/ws/oai/oai
Last updated
2026-11-27
Source record
OAI-PMH GetRecord
citation

Acharya, Prashant. Evaluating Iterative Feedback Mechanisms for Secure and Functional LLM Code Generation. masters thesis, Miami University, 2026. http://rave.ohiolink.edu/etdc/view?acc_num=miami1784763275584884