mlsanityData to 7 Oct 2026

Counterexample Guided Program Repair Using Zero-Shot Learning and MaxSAT-based Fault Localization

arXiv 2502.07786 ↗First posted 19 Dec 2024cs.SE cs.AIcited by 8

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

  1. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  2. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  3. 2024CodeGemma: Open Code Models Based on Gemmacited by 145
  4. 2020Graph-based, Self-Supervised Program Repair from Diagnostic Feedbackcited by 93
  5. 2023CodeHelp: Using Large Language Models with Guardrails for Scalable Support in Programming Classescited by 71
  6. 2022Repair Is Nearly Generation: Multilingual Program Repair with LLMscited by 68
  7. 2016Automated Clustering and Program Repair for Introductory Programming Assignmentscited by 21
  8. 2016Learning Syntactic Program Transformations from Examplescited by 17
  9. 2016sk_p: a neural program corrector for MOOCscited by 10
  10. 2017Data-Driven Feedback Generation for Introductory Programming Exercisescited by 9
  11. 2021Verifix: Verified Repair of Programming Assignmentscited by 7
  12. 2022C-Pack of IPAs: A C90 Program Benchmark of Introductory Programming Assignmentscited by 5
2 more
  1. 2022InvAASTCluster: On Applying Invariant-Based Program Clustering to Introductory Programming Assignmentscited by 4
  2. 2024Combining Logic with Large Language Models for Automatic Debugging and Repair of ASP Programscited by 1

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 2; 2026: 6.

8 papers.