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

AuPair:用于代码修复的黄金示例对

AuPair: Golden Example Pairs for Code Repair

DeepMind(深度思维)

Aditi Mavalankar, Hassan Mansoor, Zita Marinho, Masha Samsikova, Tom Schaul

AI总结:

本文提出 AuPair 方法,通过合成并选择有序的黄金示例对,利用 LLM 的上下文学习能力进行代码自我修复,在多个数据集上显著提升性能并展现良好泛化性。

摘要:

扩展推理时计算已被证明是一种无需微调即可提高大型语言模型(LLM)性能的有价值策略。能够从额外推理时计算中受益的一项重要任务是自我修复;给定一个初始的有缺陷响应(即猜测),LLM 纠正自身错误并产生改进的响应(即修复)。我们利用 LLM 的上下文学习能力在编码领域执行自我修复。我们论文的关键贡献是一种方法,该方法综合并选择一组有序的黄金示例对(即 AuPairs),这些示例对包含针对相应问题的初始猜测和后续修复。每个这样的 AuPair 在推理时作为单个上下文示例提供,以生成修复后的解决方案。对于每个问题 $N$ 次 LLM 调用的推理时计算预算,使用 $N$ 个 AuPair 生成 $N$ 个修复后的解决方案,从中选择得分最高的解决方案作为最终答案。其基本直觉是,如果每次给 LLM 一个不同的修复错误猜测的示例,它随后可以生成多样化的修复解决方案集。我们的算法以最大化互补性和有用性的方式选择这些 AuPair。我们在 5 个 LLM 上、跨越 7 个竞争性编程数据集上展示了我们算法在代码修复任务上的结果。与 best-of-$N$ 和 self-repair 相比,我们的算法带来了显著的性能提升,并且在数据集和模型之间表现出强大的泛化能力。此外,与基线相比,我们的方法在推理时计算预算方面显示出显著更强的扩展性。

英文摘要:

Scaling up inference-time compute has proven to be a valuable strategy in improving the performance of Large Language Models (LLMs) without fine-tuning. An important task that can benefit from additional inference-time compute is self-repair; given an initial flawed response, or guess, the LLM corrects its own mistake and produces an improved response, or fix. We leverage the in-context learning ability of LLMs to perform self-repair in the coding domain. The key contribution of our paper is an approach that synthesises and selects an ordered set of golden example pairs, or AuPairs, of these initial guesses and subsequent fixes for the corresponding problems. Each such AuPair is provided as a single in-context example at inference time to generate a repaired solution. For an inference-time compute budget of $N$ LLM calls per problem, $N$ AuPairs are used to generate $N$ repaired solutions, out of which the highest-scoring solution is selected as the final answer. The underlying intuition is that if the LLM is given a different example of fixing an incorrect guess each time, it can subsequently generate a diverse set of repaired solutions. Our algorithm selects these AuPairs in a manner that maximises complementarity and usefulness. We demonstrate the results of our algorithm on 5 LLMs across 7 competitive programming datasets for the code repair task. Our algorithm yields a significant boost in performance compared to best-of-$N$ and self-repair, and also exhibits strong generalisation across datasets and models. Moreover, our approach shows significantly stronger scaling with inference-time compute budget compared to baselines.

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

↑