Back to results

Ohio University

Enabling Self-Debugging in Large Language Models: Towards Autonomous ErrorDetection and Correction in Code Generation

Abstract

dc:description

The rapid growth of Large Language Models (LLMs) has greatly improved the ability ofArtificial Intelligence systems to generate code from natural language. However, thesemodels can still produce code with logical errors, miss edge cases, or fail to fully meet theproblem requirements. This creates a reliability problem in automated code generation,where correct results are important but not always guaranteed. Because of this, there is aneed for methods that can improve the accuracy of generated code without requiring extramodel training. In code generation, this can be done by allowing models to check andimprove their outputs during inference. This thesis introduces a self-debugging frameworkdesigned to improve the reliability of code generated by large language models. Theapproach combines test-based validation with an iterative refinement process, where themodel first generates a solution, tests it using test cases, and then improves the code stepby step using structured feedback. Unlike traditional single-pass methods, where themodel generates a solution in one step and returns it as the final answer, this frameworkallows the model to find and fix its own mistakes through repeated improvement. To testthe effectiveness of the framework, experiments were carried out on several programmingbenchmarks, including HumanEval, MBPP, and SWE-bench Lite, using different largelanguage models. The evaluation compares baseline single-pass generation with theself-debugging method. Performance is measured using metrics such as accuracy, passrates, and improvement over baseline, giving a full view of the framework’s impact. The4results show that the proposed framework improves the correctness and reliability ofgenerated code. The iterative process helps the model fix errors step by step, leading tobetter success rates across different benchmarks and models. These findings show thatadding validation and refinement to the generation process is an effective way to improveLLM performance in coding tasks. This approach can support AI-assisted softwaredevelopment and provide a base for future work in automated code generation andself-correcting systems.

Degree

thesis:*
Name thesis:degree_name
Master of Science (MS)
Level thesis:degree_level
masters
Discipline thesis:degree_discipline
Computer Science (Engineering and Technology)
Grantor dc:publisher
Ohio University
Year dc:date
2026

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Koranteng, Osborn Djabaku
Advisor dc:contributor.advisor
  • Liu, Chang

Subjects

dc:subject × 7

Rights

dc:rights
Statement dc:rights
  • unrestricted
  • 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

Koranteng, Osborn Djabaku. Enabling Self-Debugging in Large Language Models: Towards Autonomous ErrorDetection and Correction in Code Generation. masters thesis, Ohio University, 2026. http://rave.ohiolink.edu/etdc/view?acc_num=ohiou1786009478916416