arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2611.09212cs.SEcs.AI
收藏

LLM生成代码中修复断言失败的执行轨迹局限性研究

On the Limits of Execution Traces for Repairing Assertion Failures in LLM-Generated Code

University of Canberra(堪培拉大学)

Muntasir Adnan, Carlos C. N. Kuhn

AI总结:

该研究针对LLM生成代码的断言失败问题,提出断点调试(BPD)方法,实验表明其在BigCodeBench等数据集上的修复效果优于重采样,且能减少未修改代码的重新提交率。

摘要:

迭代修复会将失败程序的错误反馈给大语言模型(LLM)以进行修复。经迭代修复后,剩余失败大多为断言失败:使用四款Qwen2.5模型时,其在BigCodeBench的剩余失败中占79%,在HumanEval中占全部失败,在LiveCodeBench中占93%。我们通过反馈的信息视角指出,断言失败几乎无法说明故障位置。我们提出断点调试(BPD),返回标注了变量运行时值的失败程序。针对迭代修复经五次尝试仍未修复的任务,我们比较两种额外五次生成的处理方式:BPD与重采样。在BigCodeBench上,BPD修复26.7%的此类任务,而重采样为22.4%,且其优势随模型规模增大而提升;在HumanEval上,BPD略优于重采样;在LiveCodeBench上,新采样修复更多(6.5% vs 4.9%)。此外,BPD将BigCodeBench上未修改代码的重新提交率从28%降至8%。仅使用首个失败测试的轨迹,其性能优于使用所有失败测试的轨迹,且比全轨迹BPD和普通迭代修复使用更少token。在LiveCodeBench上,即使针对公开测试,BPD也无增益,故可见的失败输入不足以让轨迹发挥作用。这些结果与信息视角一致:仅当测试暴露失败输入且故障为实现疏漏时,轨迹才有用;否则,修复循环应重采样而非使用轨迹。

英文摘要:

Iterative repair returns a failed program's error to a large language model (LLM) and asks it to fix it. After iterative repair, the remaining failures are mostly assertion failures: with four Qwen2.5 models, they make up 79% of residual failures on BigCodeBench, all on HumanEval and 93% on LiveCodeBench. We argue, through an information view of the feedback, that an assertion failure says little about where the fault lies. We propose Breakpoint Debugging (BPD), which returns the failed program annotated inline with its variables' runtime values. We take the tasks that iterative repair failed to fix with five repair attempts and compare two ways of spending five further generations on them: BPD, and resampling. On BigCodeBench, BPD repairs 26.7% of these tasks against 22.4%, and its advantage grows with model size. On HumanEval, BPD outperforms resampling but only slightly, and on LiveCodeBench, fresh sampling repairs more (6.5% against 4.9%). Furthermore, BPD reduces unchanged-code resubmissions from 28% to 8% on BigCodeBench. Using only the first failing test's trace, it outperforms tracing all failing tests while using fewer tokens than both all-trace BPD and plain iterative repair. On LiveCodeBench, BPD gives no gain even on the public tests, so a visible failing input is not enough for a trace to help. These results match the information view: a trace helps only when the test exposes a failing input, and the fault is an implementation slip; otherwise, a repair loop should resample rather than trace.

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

↑