[Paper Review] Graph-based, Self-Supervised Program Repair from Diagnostic Feedback
DrRepair uses a program-feedback graph and self-supervised pre-training to repair programs from diagnostic feedback, achieving state-of-the-art repair rates on DeepFix and SPoC.
We consider the problem of learning to repair programs from diagnostic feedback (e.g., compiler error messages). Program repair is challenging for two reasons: First, it requires reasoning and tracking symbols across source code and diagnostic feedback. Second, labeled datasets available for program repair are relatively small. In this work, we propose novel solutions to these two challenges. First, we introduce a program-feedback graph, which connects symbols relevant to program repair in source code and diagnostic feedback, and then apply a graph neural network on top to model the reasoning process. Second, we present a self-supervised learning paradigm for program repair that leverages unlabeled programs available online to create a large amount of extra program repair examples, which we use to pre-train our models. We evaluate our proposed approach on two applications: correcting introductory programming assignments (DeepFix dataset) and correcting the outputs of program synthesis (SPoC dataset). Our final system, DrRepair, significantly outperforms prior work, achieving 68.2% full repair rate on DeepFix (+22.9% over the prior best), and 48.4% synthesis success rate on SPoC (+3.7% over the prior best).
Motivation & Objective
- Motivate learning to repair broken programs from compiler/diagnostic feedback.
- Address two challenges: cross-symbol reasoning across code and feedback, and limited labeled repair data.
- Propose a graph-based representation and a self-supervised training paradigm to improve repair accuracy.
Proposed method
- Introduce the program-feedback graph that connects identifiers and diagnostic tokens across code and messages.
- Apply a graph attention network on the program-feedback graph to propagate symbolic information.
- Use a self-supervised pre-training regime by corrupting large sets of unlabeled working programs to create broken/fixed pairs.
- Train a repair model (DrRepair) with an encoder–decoder architecture that localizes the erroneous line and generates a repaired line.
- Evaluate on DeepFix (full repair rate) and SPoC (synthesis repair rate), using iterative repair for multi-error programs.
Experimental results
Research questions
- RQ1Can a program-feedback graph improve information flow and symbol tracking for program repair beyond sequence/AST-based methods?
- RQ2Does self-supervised pre-training on unlabeled code improve repair performance in data-scarce settings?
- RQ3How does the combination of graph reasoning and pre-training affect repair accuracy on beginner programming tasks and program synthesis outputs?
- RQ4Is the method robust to multiple concurrent errors and to errors requiring cross-line reasoning?
Key findings
- DrRepair achieves 68.2% full repair rate on DeepFix, improving the prior best by 22.9 percentage points.
- DrRepair achieves 48.4% synthesis success rate on SPoC, improving the prior best by 3.7 points.
- Self-supervised pre-training and the program-feedback graph provide complementary gains over a strong baseline.
- Graph edges that connect code-only and code–feedback tokens are both beneficial, with the final program-feedback graph yielding the best results.
- Compiler messages are crucial for repair performance; removing them drops accuracy substantially on real test data.
- Graph-based reasoning particularly helps errors requiring cross-line analysis and symbol tracking.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.