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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Silva, André, Thorén, Gustav, Monperrus, Martin
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912982439559168
author Silva, André
Thorén, Gustav
Monperrus, Martin
author_facet Silva, André
Thorén, Gustav
Monperrus, Martin
contents 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. 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.
format Preprint
id arxiv_https___arxiv_org_abs_2505_17703
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Gradient-Based Program Repair: Fixing Bugs in Continuous Program Spaces
Silva, André
Thorén, Gustav
Monperrus, Martin
Programming Languages
Machine Learning
Software Engineering
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. 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.
title Gradient-Based Program Repair: Fixing Bugs in Continuous Program Spaces
topic Programming Languages
Machine Learning
Software Engineering
url https://arxiv.org/abs/2505.17703