Large Language Models for Programming: Actually Fixing or Reimplementing Incorrect Code?
Alexandru Stefan Stoica, Traian Rebedea, Marian Cristian Mihaescu
Key points
From the paper's conclusion- Focused on determining how much LLMs deviate from a buggy solution to fix the bug compared to a human-written patch, and if there is a bias towards generating entirely new solutions using a dataset with submissions from Codeforces users.
- LLMs tend to modify more lines than necessary compared to human fixes and, in some cases, generate entirely new solutions, with LLMs solving more problems correctly when allowed to generate solutions from scratch.
- LLMs show a bias towards generating entirely new solutions rather than incremental fixes, with better performance when generating from scratch compared to patching buggy submissions.
Abstract
Recent studies have shown that Large Language Models can effectively solve problems and fix bugs in diverse programming environments, including competitive programming. Existing approaches primarily evaluate LLM performance in problem solving or bug fixing independently, but do not explore the relationship between these two capabilities. This work focuses on determining how much the LLM deviates from a buggy solution to fix the bug compared to a human-written patch, and if there is a bias towards generating entirely new solutions. We construct a dataset with all the submissions ($\sim$ 3000) from a couple of users from Codeforces, and we match each buggy submission with its corresponding human fix. By using the similarity between the buggy solution and the human fix as a baseline, we evaluate the quality of LLM-generated bug fixes on 3 OpenAI GPT models (gpt-5-nano, gpt-5-mini, gpt-5.1). We check if the generated solutions solve the problem by using the Codeforces-R1 dataset, an openly available dataset that has tests generated with the DeepSeek-R1 model. Our findings suggest that LLMs tend to modify more lines than necessary compared to human fixes and, in some cases, generate entirely new solutions. We also observe that LLMs solve more problems correctly when allowed to generate solutions from scratch rather than patch buggy submissions, even when those submissions are close to the human patch. This has important implications for the design of AI-assisted programming tools, particularly in supporting user debugging processes and promoting incremental problem-solving strategies rather than solution replacement.
Read the paper
Discussion · 1
Science Skim's AI key points, plus readers' public thoughts
- Focused on determining how much LLMs deviate from a buggy solution to fix the bug compared to a human-written patch, and if there is a bias towards generating entirely new solutions using a dataset with submissions from Codeforces users.
- LLMs tend to modify more lines than necessary compared to human fixes and, in some cases, generate entirely new solutions, with LLMs solving more problems correctly when allowed to generate solutions from scratch.
- LLMs show a bias towards generating entirely new solutions rather than incremental fixes, with better performance when generating from scratch compared to patching buggy submissions.
Readers' thoughts
No reader thoughts yet.
Related papers
- Large Language Model Powered Symbolic ExecutionProceedings of the ACM on Programming Languages · 2025
- Practical LLM-Based Function-Level Automated Program Repair: How Far Are We?ACM Transactions on Software Engineering and Methodology · 2026
- CONCUR: Benchmarking LLMs for Concurrent Code GenerationProceedings of the ACM on Software Engineering · 2026
- A Study on the Impact of Natural Language Differences in Prompts on Automatic Code Generation Using LLMsarXiv · 2026
- Helping LLMs improve code generation using feedback from testing and static analysisDiscover Artificial Intelligence · 2026
- Better Understanding, Better Fixes? A Study of Hallucination in LLM-based Automated Program RepairarXiv · 2026