Counterexample Guided Program Repair Using Zero-Shot Learning and MaxSAT-based Fault Localization
Not on the map. Why?
Abstract (arXiv)
Automated Program Repair (APR) for introductory programming assignments (IPAs) is motivated by the large number of student enrollments in programming courses each year. Since providing feedback on IPAs requires substantial time and effort from faculty, personalized feedback often involves suggesting fixes to students' programs. Formal Methods (FM)-based semantic repair approaches, check a program's execution against a test suite or reference solution, are effective but limited. These tools excel at identifying buggy parts but can only fix programs if the correct implementation and the faulty one share the same control flow graph. Conversely, Large Language Models (LLMs) are used for APR but often make extensive instead of minimal rewrites. This leads to more invasive fixes, making it harder for students to learn from their mistakes. In summary, LLMs excel at completing strings, while FM-based fault localization excel at identifying buggy parts of a program. In this paper, we propose a novel approach that combines the strengths of both FM-based fault localization and LLMs, via zero-shot learning, to enhance APR for IPAs. Our method uses MaxSAT-based fault localization to identify buggy parts of a program, then presents the LLM with a program sketch devoid of these buggy statements. This hybrid approach follows a CEGIS loop to iteratively refine the program. We ask the LLM to synthesize the missing parts, which are then checked against a test suite. If the suggested program is incorrect, a counterexample from the test suite is fed back to the LLM. Our experiments show that our counterexample guided approach, using MaxSAT-based bug-free program sketches, significantly improves the repair capabilities of all six evaluated LLMs. This method allows LLMs to repair more programs with smaller fixes, outperforming other configurations and state-of-the-art symbolic program repair tools.
Key facts. Cited by 8 papers in the map (data through 7 Oct 2026). Builds on 14 of its 42 references that are in the map. First posted on arXiv 19 Dec 2024.
Builds on
14 of 42 references.
References · 14
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2024CodeGemma: Open Code Models Based on Gemmacited by 145
- 2020Graph-based, Self-Supervised Program Repair from Diagnostic Feedbackcited by 93
- 2023CodeHelp: Using Large Language Models with Guardrails for Scalable Support in Programming Classescited by 71
- 2022Repair Is Nearly Generation: Multilingual Program Repair with LLMscited by 68
- 2016Automated Clustering and Program Repair for Introductory Programming Assignmentscited by 21
- 2016Learning Syntactic Program Transformations from Examplescited by 17
- 2016sk_p: a neural program corrector for MOOCscited by 10
- 2017Data-Driven Feedback Generation for Introductory Programming Exercisescited by 9
- 2021Verifix: Verified Repair of Programming Assignmentscited by 7
- 2022C-Pack of IPAs: A C90 Program Benchmark of Introductory Programming Assignmentscited by 5
Built on by
Citing papers per year: 2025: 2; 2026: 6.
8 papers.
- 2025Are Large Language Models Robust in Understanding Code Against Semantics-Preserving Mutations?cited by 7
- 2026Procedural Refinement by LLM-driven Algorithmic Debugging for ARC-AGI-2cited by 2
- 2026MaxSAT-Based Feedback for Guiding Vision-Language Models in Sudokucited by 1
- 2025Model-Based Diagnosis with Multiple Observations: A Unified Approach for C Software and Boolean Circuitscited by 0
- 2026Property-Guided LLM Program Synthesis for Planningcited by 0
- 2026Bulkhead: Automated Semantic Detection and Remediation of Container Escape Vulnerabilitiescited by 0
- 2026Natural-Language to SysMLv2 Translation via Conformance-Driven Iterative Refinementcited by 0
- 2026SkillEvoReg: Regularizing Agent Skill Evolution Against Overfittingcited by 0
- 2026SkillEvoReg: Regularizing Agent Skill Evolution Against Overfitting25 Sep 2026
- 2026Natural-Language to SysMLv2 Translation via Conformance-Driven Iterative Refinement14 Jul 2026
- 2026Bulkhead: Automated Semantic Detection and Remediation of Container Escape Vulnerabilities14 Jul 2026
- 2026MaxSAT-Based Feedback for Guiding Vision-Language Models in Sudoku14 Jul 2026
- 2026Property-Guided LLM Program Synthesis for Planning15 May 2026
- 2026Procedural Refinement by LLM-driven Algorithmic Debugging for ARC-AGI-220 Mar 2026
- 2025Model-Based Diagnosis with Multiple Observations: A Unified Approach for C Software and Boolean Circuits2 Dec 2025
- 2025Are Large Language Models Robust in Understanding Code Against Semantics-Preserving Mutations?15 May 2025