DebugBench: Evaluating Debugging Capability of Large Language Models
作者: Runchu Tian, Yining Ye, Yujia Qin, Xin Cong, Yankai Lin, Yinxu Pan, Yesai Wu, Haotian Hui, Weichuan Liu, Zhiyuan Liu, Maosong Sun
分类: cs.SE, cs.AI, cs.CL
发布日期: 2024-01-09 (更新: 2024-06-06)
备注: Accepted as Findings of ACL 2024
💡 一句话要点
提出DebugBench以评估大型语言模型的调试能力
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 调试能力 DebugBench 代码评估 机器学习 软件开发 自动化测试
📋 核心要点
- 现有方法在评估大型语言模型的调试能力时存在数据泄露风险和数据集规模不足等问题。
- 本文提出DebugBench基准,系统收集并植入错误,确保调试能力的全面评估。
- 实验结果显示闭源模型调试性能低于人类,开源模型通过率较低,且调试复杂性受错误类别影响显著。
📝 摘要(中文)
大型语言模型(LLMs)在编码能力上表现出色,但其调试能力尚未得到充分探索。现有评估方法存在数据泄露风险、数据集规模限制及测试错误种类不足等问题。为此,本文提出了DebugBench,一个包含4253个实例的调试基准,涵盖C++、Java和Python中的四大错误类别及18种小类型。通过从LeetCode社区收集代码片段,并利用GPT-4植入错误,确保了数据的质量。我们在零-shot场景下评估了两种商业模型和四种开源模型,发现闭源模型的调试性能低于人类,而开源模型的通过率相对较低。此外,调试的复杂性因错误类别而异,运行时反馈对调试性能的影响并不总是积极的。这些发现将有助于LLMs在调试方面的发展。
🔬 方法详解
问题定义:本文旨在解决大型语言模型调试能力评估不足的问题,现有方法面临数据泄露风险、数据集规模小及测试错误种类单一等痛点。
核心思路:通过构建DebugBench基准,系统性地收集代码片段并植入错误,以全面评估LLMs的调试能力。此方法确保了数据的多样性和质量。
技术框架:DebugBench的构建包括数据收集、错误植入和质量检查三个主要阶段。首先,从LeetCode社区收集代码片段;其次,利用GPT-4植入多种类型的错误;最后,进行严格的质量检查以确保数据的可靠性。
关键创新:DebugBench的最大创新在于其系统性和全面性,涵盖了多种编程语言及错误类型,与现有方法相比,提供了更为丰富和可靠的评估基准。
关键设计:在数据收集阶段,确保了代码片段的多样性;在错误植入阶段,采用GPT-4生成多样化的错误类型;在评估阶段,采用零-shot学习方法对模型进行测试,确保了评估的客观性和有效性。
🖼️ 关键图片
📊 实验亮点
实验结果显示,闭源模型的调试性能明显低于人类,而开源模型的通过率相对较低。调试复杂性因错误类别而异,且运行时反馈对调试性能的影响并不总是正面的。这些发现为LLMs在调试领域的进一步发展提供了重要依据。
🎯 应用场景
该研究的潜在应用领域包括软件开发、教育和自动化测试等。DebugBench可以作为评估和提升大型语言模型调试能力的标准工具,推动相关技术的进步,提升编程效率和代码质量。
📄 摘要(原文)
Large Language Models (LLMs) have demonstrated exceptional coding capability. However, as another critical component of programming proficiency, the debugging capability of LLMs remains relatively unexplored. Previous evaluations of LLMs' debugging ability are significantly limited by the risk of data leakage, the scale of the dataset, and the variety of tested bugs. To overcome these deficiencies, we introduce `DebugBench', an LLM debugging benchmark consisting of 4,253 instances. It covers four major bug categories and 18 minor types in C++, Java, and Python. To construct DebugBench, we collect code snippets from the LeetCode community, implant bugs into source data with GPT-4, and assure rigorous quality checks. We evaluate two commercial and four open-source models in a zero-shot scenario. We find that (1) while closed-source models exhibit inferior debugging performance compared to humans, open-source models relatively lower pass rate scores; (2) the complexity of debugging notably fluctuates depending on the bug category; (3) incorporating runtime feedback has a clear impact on debugging performance which is not always helpful. As an extension, we also compare LLM debugging and code generation, revealing a strong correlation between them for closed-source models. These findings will benefit the development of LLMs in debugging.