Multi-Task Program Error Repair and Explanatory Diagnosis
Zhenyu Xu, Victor S. Sheng
TL;DR
This work targets automated repair of software defects and the generation of explainable diagnostics to aid developers. It introduces mPRED, a multi-task framework that encodes source code with a pre-trained language model, repairs errors with a specialized downstream model, generates edge- and extreme-condition test cases, and supplies intermediate chain-of-thought explanations, complemented by graph-based program-structure visualization. The approach combines automated repair, test generation, and diagnostic feedback, leveraging RLHF, chain-of-thought prompting, and LLMCs to produce interpretable corrections. The anticipated impact is faster, more reliable debugging across languages, with clearer rationale that helps developers understand root causes and fixes.
Abstract
Program errors can occur in any type of programming, and can manifest in a variety of ways, such as unexpected output, crashes, or performance issues. And program error diagnosis can often be too abstract or technical for developers to understand, especially for beginners. The goal of this paper is to present a novel machine-learning approach for Multi-task Program Error Repair and Explanatory Diagnosis (mPRED). A pre-trained language model is used to encode the source code, and a downstream model is specifically designed to identify and repair errors. Programs and test cases will be augmented and optimized from several perspectives. Additionally, our approach incorporates a "chain of thoughts" method, which enables the models to produce intermediate reasoning explanations before providing the final correction. To aid in visualizing and analyzing the program structure, we use a graph neural network for program structure visualization. Overall, our approach offers a promising approach for repairing program errors across different programming languages and providing helpful explanations to programmers.
