arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2404.11595cs.SE
收藏

深入探究用于自动化缺陷定位与修复的大型语言模型

A Deep Dive into Large Language Models for Automated Bug Localization and Repair

Soneya Binta Hossain, Nan Jiang, Qiang Zhou, Xiaopeng Li, Wen-Hao Chiang, Yingjun Lyu, Hoan Nguyen, Omer Tripp

AI总结:

本文提出 Toggle 框架,利用不同 LLM 分阶段实现 token 级缺陷定位与程序修复,并通过提示优化在 CodeXGLUE 上达到 SOTA。

摘要:

大型语言模型(LLM)已在包括自动化程序修复(APR)在内的多种软件工程任务中展现出令人瞩目的有效性。在本研究中,我们深入探究了利用 LLM 进行自动化缺陷修复。与许多假设缺陷位置已知、依赖行级定位工具,或通过单一步骤处理缺陷预测与修复的基于深度学习的 APR 方法不同,我们的方法独特地采用 LLM 在 token 级别预测缺陷位置,随后再利用 LLM 进行缺陷修复。这种使用不同 LLM 将缺陷定位与修复进行方法学分离的做法,能够有效整合多样化的上下文信息,并更好地融入归纳偏置。我们提出了 Toggle:Token-Granulated Bug Localization and Repair(token 粒度缺陷定位与修复),这是一个综合程序修复框架,集成了缺陷定位模型、调整单元和缺陷修复模型。Toggle 以存在缺陷的函数为输入,并生成完整的已修正函数。我们研究了面向缺陷修复模型的多种提示风格,以找出最有效、能更好利用归纳偏置且显著优于其他提示的提示。Toggle 在 CodeXGLUE 代码精炼基准上取得了新的最先进(SOTA)性能,并在包括 Defects4J 在内的其他多个广泛使用的 APR 数据集上表现出更优或具有可比性的性能。

英文摘要:

Large language models (LLMs) have shown impressive effectiveness in various software engineering tasks, including automated program repair (APR). In this study, we take a deep dive into automated bug fixing utilizing LLMs. In contrast to many deep learning-based APR methods that assume known bug locations, rely on line-level localization tools, or address bug prediction and fixing in one step, our approach uniquely employs LLMs to predict bug location at the token level and subsequently utilizes them for bug fixing. This methodological separation of bug localization and fixing using different LLMs enables effective integration of diverse contextual information and improved incorporation of inductive biases. We introduce Toggle: Token-Granulated Bug Localization and Repair, a comprehensive program repair framework that integrates a bug localization model, an adjustment unit, and a bug-fixing model. Toggle takes a buggy function as input and generates a complete corrected function. We investigate various styles of prompting to the bug fixing model to identify the most effective prompts that better utilize the inductive bias and significantly outperform others. Toggle achieves the new state-of-the-art (SOTA) performance on the CodeXGLUE code refinement benchmark, and exhibits better and comparable performance on several other widely-used APR datasets, including Defects4J.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑