arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.15894cs.LGcs.AIcs.SE
收藏

让每一次扩展都发挥作用:学习在大语言模型代码修复中高效搜索

Make Every Expansion Count: Learning to Search Efficiently in LLM Code Repair

Technion(以色列理工学院);NVIDIA(英伟达)

Elad Sharony, Ido Greenberg, Jialin Song, Shie Mannor, Gal Chechik, Eli Meirom

AI总结:

本研究提出CodeTriage策略,通过0.6B参数模型读取测试输出等信息预测修复步骤分布,在代码修复搜索中减少21%程序修订和12%输出标记,且在多未见LLM上表现最优,还发布了相关语料库。

摘要:

大语言模型(LLM)代码修复系统通过反复生成和测试修订版来修复有缺陷的程序,每次修订的成本都很高,因此选择要采用的修复方案对效率至关重要。现有的搜索策略依赖于测试通过率和搜索统计数据,却忽略了测试失败和提议编辑的细节。我们引入了CodeTriage,这是一种学习策略,可在生成和测试修订程序之前对编辑进行优先级排序。其0.6B参数模型会读取测试输出、失败诊断和提议编辑,然后预测通过该编辑达到修复所需的修复步骤数量的分布。这些预测会在生成和测试修订代码之前,对跨程序的所有待处理编辑进行优先级排序。在保留的修复任务上,CodeTriage找到修复方案所需的程序修订次数比每个指标上最强的基准少21%,输出标记数少12%。在不重新训练的情况下,它在11个未见的修复LLM的每个搜索预算下都实现了最高的平均成功率。消融实验表明,失败上下文、编辑文本以及跨程序比较都能改善搜索效果。我们还发布了一个包含来自四个LLM的1220万个程序版本的语料库,这些版本被组织成带有提议编辑和测试结果的修复树。

英文摘要:

Large language model (LLM) code-repair systems fix faulty programs by repeatedly generating and testing revisions. Each revision is costly, making the choice of which repair to pursue important for efficiency. Existing search policies rely on test pass rates and search statistics, ignoring the details of test failures and proposed edits. We introduce CodeTriage, a learned policy that prioritizes edits before their revised programs are generated and tested. Its 0.6B-parameter model reads the test output, failure diagnosis, and proposed edit, then predicts a distribution over the number of repair steps needed to reach a fix through that edit. These predictions prioritize all pending edits across programs before generating and testing the revised code. On held-out repair tasks, CodeTriage finds fixes with 21% fewer program revisions and 12% fewer output tokens than the strongest baseline on each metric. Without retraining, it achieves the highest average success across search budgets for each of 11 unseen repair LLMs. Ablations show that both the failure context and edit text, as well as comparisons across programs, improve search. We also release a corpus of 12.2 million program versions from four LLMs, organized into repair trees with proposed edits and test results.

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

↑