INTERVENOR: Prompting the Coding Ability of Large Language Models with the Interactive Chain of Repair

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Wang, Hanbin, Liu, Zhenghao, Wang, Shuo, Cui, Ganqu, Ding, Ning, Liu, Zhiyuan, Yu, Ge
Format: Preprint
Published: 2023
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910484200947712
author Wang, Hanbin
Liu, Zhenghao
Wang, Shuo
Cui, Ganqu
Ding, Ning
Liu, Zhiyuan
Yu, Ge
author_facet Wang, Hanbin
Liu, Zhenghao
Wang, Shuo
Cui, Ganqu
Ding, Ning
Liu, Zhiyuan
Yu, Ge
contents This paper introduces INTERVENOR (INTERactiVE chaiN Of Repair), a system designed to emulate the interactive code repair processes observed in humans, encompassing both code diagnosis and code repair. INTERVENOR prompts Large Language Models (LLMs) to play distinct roles during the code repair process, functioning as both a Code Learner and a Code Teacher. Specifically, the Code Learner is tasked with adhering to instructions to generate or repair code, while the Code Teacher is responsible for crafting a Chain-of-Repair (CoR) to serve as guidance for the Code Learner. During generating the CoR, the Code Teacher needs to check the generated codes from Code Learner and reassess how to address code bugs based on error feedback received from compilers. Experimental results demonstrate that INTERVENOR surpasses baseline models, exhibiting improvements of approximately 18% and 4.3% over GPT-3.5 in code generation and code translation tasks, respectively. Our further analyses show that CoR is effective to illuminate the reasons behind bugs and outline solution plans in natural language. With the feedback of code compilers, INTERVENOR can accurately identify syntax errors and assertion errors and provide precise instructions to repair codes. All data and codes are available at https://github.com/NEUIR/INTERVENOR
format Preprint
id arxiv_https___arxiv_org_abs_2311_09868
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle INTERVENOR: Prompting the Coding Ability of Large Language Models with the Interactive Chain of Repair
Wang, Hanbin
Liu, Zhenghao
Wang, Shuo
Cui, Ganqu
Ding, Ning
Liu, Zhiyuan
Yu, Ge
Software Engineering
Artificial Intelligence
This paper introduces INTERVENOR (INTERactiVE chaiN Of Repair), a system designed to emulate the interactive code repair processes observed in humans, encompassing both code diagnosis and code repair. INTERVENOR prompts Large Language Models (LLMs) to play distinct roles during the code repair process, functioning as both a Code Learner and a Code Teacher. Specifically, the Code Learner is tasked with adhering to instructions to generate or repair code, while the Code Teacher is responsible for crafting a Chain-of-Repair (CoR) to serve as guidance for the Code Learner. During generating the CoR, the Code Teacher needs to check the generated codes from Code Learner and reassess how to address code bugs based on error feedback received from compilers. Experimental results demonstrate that INTERVENOR surpasses baseline models, exhibiting improvements of approximately 18% and 4.3% over GPT-3.5 in code generation and code translation tasks, respectively. Our further analyses show that CoR is effective to illuminate the reasons behind bugs and outline solution plans in natural language. With the feedback of code compilers, INTERVENOR can accurately identify syntax errors and assertion errors and provide precise instructions to repair codes. All data and codes are available at https://github.com/NEUIR/INTERVENOR
title INTERVENOR: Prompting the Coding Ability of Large Language Models with the Interactive Chain of Repair
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2311.09868