Gradient-Based Program Repair: Fixing Bugs in Continuous Program Spaces

André Silva, Gustav Thorén, Martin Monperrus
5/23/2025
cs.PLcs.LGcs.SE

No confident code implementation found for this paper.

Abstract

Automatic program repair seeks to generate correct code from buggy programs, with most approaches searching the correct program in a discrete, symbolic space of source code tokens. This symbolic search is fundamentally limited by its inability to directly reason about program behavior.

Show full abstract

We introduce Gradient-Based Program Repair (GBPR), a new approach that recasts program repair as continuous optimization in a differentiable numerical program space. Our core insight is to compile symbolic programs into differentiable numerical representations, enabling search in the numerical program space directly guided by program behavior. To evaluate GBPR, we present RaspBugs, a new benchmark of 1,466 buggy symbolic RASP programs and their respective numerical representations. Our experiments demonstrate that GBPR can effectively repair buggy symbolic programs by gradient-based optimization in the numerical program space, with convincing repair trajectories. To our knowledge, we are the first to state program repair as continuous optimization in a numerical program space. Our work demonstrates the feasibility of this direction for program repair research, bridging continuous optimization and program behavior.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{silva2025gradientbased,
  title  = {Gradient-Based Program Repair: Fixing Bugs in Continuous Program Spaces},
  author = {André Silva and Gustav Thorén and Martin Monperrus},
  year   = {2025},
  eprint = {2505.17703},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.17703v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.17703.svg)](https://codeofpaper.com/paper/2505.17703)

Discussion