TFix: Learning to Fix Coding Errors with a Text-to-Text Transformer
Berkay Berabi, Jingxuan He, Veselin Raychev, Martin T. Vechev
Abstract
The problem of fixing errors in programs has attracted substantial interest over the years. The key challenge for building an effective code fixing tool is to capture a wide range of errors and meanwhile maintain high accuracy. In this paper, we address this challenge and present a new learning-based system, called TFix. TFix works directly on program text and phrases the problem of code fixing as a text-to-text task. In turn, this enables it to leverage a powerful Transformer based model pre-trained on natural language and fine-tuned to generate code fixes (via a large, highquality dataset obtained from GitHub commits). TFix is not specific to a particular programming language or class of defects and, in fact, improved its precision by simultaneously fine-tuning on 52 different error types reported by a popular static analyzer. Our evaluation on a massive dataset of JavaScript programs shows that TFix is practically effective: it is able to synthesize code that fixes the error in ∼67 percent of cases and significantly outperforms existing learning-based approaches.
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.
30 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
- Bugs in Quantum computing platforms: an empirical study cites Global Relational Models of Source Code
- Bugs in Quantum computing platforms: an empirical study cites Learning and Evaluating Contextual Embedding of Source Code
- Repair Is Nearly Generation: Multilingual Program Repair with LLMs cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Repair Is Nearly Generation: Multilingual Program Repair with LLMs cites Graph-based, Self-Supervised Program Repair from Diagnostic Feedback
- CodeBERT: A Pre-Trained Model for Programming and Natural Languages cites Learning and Evaluating Contextual Embedding of Source Code
- Learning and Evaluating Contextual Embedding of Source Code cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Retrieval-Based Prompt Selection for Code-Related Few-Shot Learning cites CoCoNuT: combining context-aware neural translation models using ensemble for program repair
- Retrieval-Based Prompt Selection for Code-Related Few-Shot Learning cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Retrieval-Based Prompt Selection for Code-Related Few-Shot Learning cites Graph-based, Self-Supervised Program Repair from Diagnostic Feedback
- Graph-based, Self-Supervised Program Repair from Diagnostic Feedback cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Learning and Evaluating Contextual Embedding of Source Code cites Global Relational Models of Source Code
- An Empirical Study on Fine-Tuning Large Language Models of Code for Automated Program Repair cites CoCoNuT: combining context-aware neural translation models using ensemble for program repair
- An Empirical Study on Fine-Tuning Large Language Models of Code for Automated Program Repair cites Repair Is Nearly Generation: Multilingual Program Repair with LLMs
- An Empirical Study on Fine-Tuning Large Language Models of Code for Automated Program Repair cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- An Empirical Study on Fine-Tuning Large Language Models of Code for Automated Program Repair cites Graph-based, Self-Supervised Program Repair from Diagnostic Feedback
- RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repair cites CoCoNuT: combining context-aware neural translation models using ensemble for program repair
- RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repair cites Repair Is Nearly Generation: Multilingual Program Repair with LLMs
- RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repair cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
Cited by top-tier papers30
- 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
- Retrieval-Based Prompt Selection for Code-Related Few-Shot LearningNoor Nashid, Mifta Sintaha, Ali MesbahICSE 2023 · 156 citations
- An Empirical Study on Fine-Tuning Large Language Models of Code for Automated Program RepairKai Huang, Xiangxin Meng, Jian Zhang, Yang Liu et al.ASE 2023 · 91 citations
- RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program RepairWeishi Wang, Yue Wang, Shafiq Joty, Steven C. H. HoiFSE 2023 · 84 citations
- Bugs in Quantum computing platforms: an empirical studyMatteo Paltenghi, Michael PradelOOPSLA 2022 · 70 citations
Builds on13
- CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
- Learning and Evaluating Contextual Embedding of Source CodeAditya Kanade, Petros Maniatis, Gogul Balakrishnan, Kensen ShiICML 2020 · 438 citations
- CoCoNuT: combining context-aware neural translation models using ensemble for program repairThibaud Lutellier, Hung Viet Pham, Lawrence Pang, Yitong Li et al.ISSTA 2020 · 325 citations
- Global Relational Models of Source CodeVincent J. Hellendoorn, Charles Sutton, Rishabh Singh, Petros Maniatis et al.ICLR 2020 · 252 citations
- Graph-based, Self-Supervised Program Repair from Diagnostic FeedbackMichihiro Yasunaga, Percy LiangICML 2020 · 198 citations
Related papers
- Domain Knowledge Matters: Improving Prompts with Fix Templates for Repairing Python Type ErrorsYun Peng, Shuzheng Gao, Cuiyun Gao, Yintong Huo et al.ICSE 2024 · 39 citations
- Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related TasksAntonio Mastropaolo, Simone Scalabrino, Nathan Cooper, David Nader-Palacio et al.ICSE 2021 · 9 citations
- TransRepair: Context-aware Program Repair for Compilation ErrorsXueyang Li, Shangqing Liu, Ruitao Feng, Guozhu Meng et al.ASE 2022 · 31 citations
- Hoppity: Learning Graph Transformations to Detect and Fix Bugs in ProgramsElizabeth Dinella, Hanjun Dai, Ziyang Li, Mayur Naik et al.ICLR 2020 · 212 citations
- Learning to Reduce False Positives in Analytic Bug DetectorsAnant Kharkar, Roshanak Zilouchian Moghaddam, Matthew Jin, Xiaoyu Liu et al.ICSE 2022 · 33 citations
