Break-It-Fix-It: Unsupervised Learning for Program Repair
Michihiro Yasunaga, Percy Liang
Abstract
We consider repair tasks: given a critic (e.g., compiler) that assesses the quality of an input, the goal is to train a fixer that converts a bad example (e.g., code with syntax errors) into a good one (e.g., code with no syntax errors). Existing works create training data consisting of (bad, good) pairs by corrupting good examples using heuristics (e.g., dropping tokens). However, fixers trained on this synthetically-generated data do not extrapolate well to the real distribution of bad inputs. To bridge this gap, we propose a new training approach, Break-It-Fix-It (BIFI), which has two key ideas: (i) we use the critic to check a fixer's output on real bad inputs and add good (fixed) outputs to the training data, and (ii) we train a breaker to generate realistic bad code from good code. Based on these ideas, we iteratively update the breaker and the fixer while using them in conjunction to generate more paired data. We evaluate BIFI on two code repair datasets: GitHub-Python, a new dataset we introduce where the goal is to repair Python code with AST parse errors; and DeepFix, where the goal is to repair C code with compiler errors. BIFI outperforms state-of-the-art methods, obtaining 90.5% repair accuracy on GitHub-Python (+28.5%) and 71.7% on DeepFix (+5.6%). Notably, BIFI does not require any labeled data; we hope it will be a strong starting point for unsupervised learning of various repair tasks.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
34 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- OctoPack: Instruction Tuning Code Large Language Models cites Teaching Large Language Models to Self-Debug
- Is Self-Repair a Silver Bullet for Code Generation? cites Teaching Large Language Models to Self-Debug
- Teaching Large Language Models to Self-Debug cites Unsupervised Translation of Programming Languages
- Understanding Self-Training for Gradual Domain Adaptation cites Moment Matching for Multi-Source Domain Adaptation
- Large Language Models as Analogical Reasoners cites Teaching Large Language Models to Self-Debug
- WILDS: A Benchmark of in-the-Wild Distribution Shifts cites Understanding Self-Training for Gradual Domain Adaptation
- WILDS: A Benchmark of in-the-Wild Distribution Shifts cites Moment Matching for Multi-Source Domain Adaptation
Cited by top-tier papers34
- Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 citations
- OctoPack: Instruction Tuning Code Large Language ModelsNiklas Muennighoff, Qian Liu, Armel Randy Zebaze, Qinkai Zheng et al.ICLR 2024 · 203 citations
- Is Self-Repair a Silver Bullet for Code Generation?Theo X. Olausson, Jeevana Priya Inala, Chenglong Wang, Jianfeng Gao et al.ICLR 2024 · 195 citations
- Repair Is Nearly Generation: Multilingual Program Repair with LLMsHarshit Joshi, José Pablo Cambronero Sánchez, Sumit Gulwani, Vu Le et al.AAAI 2023 · 182 citations
- Large Language Models as Analogical ReasonersMichihiro Yasunaga, Xinyun Chen, Yujia Li, Panupong Pasupat et al.ICLR 2024 · 155 citations
Builds on13
- Unsupervised Data Augmentation for Consistency TrainingQizhe Xie, Zihang Dai, Eduard H. Hovy, Thang Luong et al.NeurIPS 2020 · 2,774 citations
- Moment Matching for Multi-Source Domain AdaptationXingchao Peng, Qinxun Bai, Xide Xia, Zijun Huang et al.ICCV 2019 · 2,239 citations
- WILDS: A Benchmark of in-the-Wild Distribution ShiftsPang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie et al.ICML 2021 · 1,773 citations
- Unsupervised Translation of Programming LanguagesBaptiste Rozière, Marie-Anne Lachaux, Lowik Chanussot, Guillaume LampleNeurIPS 2020 · 606 citations
- Understanding Self-Training for Gradual Domain AdaptationAnanya Kumar, Tengyu Ma, Percy LiangICML 2020 · 266 citations
Related papers
- LM-Critic: Language Models for Unsupervised Grammatical Error CorrectionMichihiro Yasunaga, Jure Leskovec, Percy LiangEMNLP 2021 · 29 citations
- Unsupervised Grammatical Error Correction Rivaling Supervised MethodsHannan Cao, Liping Yuan, Yuchen Zhang, Hwee Tou NgEMNLP 2023 · 4 citations
- Graph-based, Self-Supervised Program Repair from Diagnostic FeedbackMichihiro Yasunaga, Percy LiangICML 2020 · 198 citations
- MultiFix: Learning to Repair Multiple Errors by Optimal Alignment LearningHyeonTae Seo, Yo-Sub Han, Sang-Ki KoEMNLP Findings 2021 · 4 citations
- TransRepair: Context-aware Program Repair for Compilation ErrorsXueyang Li, Shangqing Liu, Ruitao Feng, Guozhu Meng et al.ASE 2022 · 31 citations
