CodeMonkeys:面向软件工程的测试时计算扩展
CodeMonkeys: Scaling Test-Time Compute for Software Engineering
AI总结:
CodeMonkeys 通过联合生成测试脚本与草稿编辑的多轮轨迹,并行采样候选编辑并结合投票与选择轨迹,在 SWE-bench Verified 上以约 2300 美元预算解决 57.4% 的 issue,集成选择后达 66.2%。
摘要:
扩展测试时计算是提升大语言模型(LLM)能力的一个有前景的方向。然而,测试时计算可以通过多种方式扩展,而有效结合不同方法仍然是一个活跃的研究领域。本文在解决 SWE-bench 数据集中的真实 GitHub issue 的背景下探索这一问题。我们的系统名为 CodeMonkeys,允许模型通过联合生成并运行测试脚本以及草稿编辑来迭代地编辑代码库。我们为每个 issue 采样大量这种多轮轨迹,以生成候选编辑集合。这种方法使我们能够通过增加每条轨迹的迭代次数来扩展“串行”测试时计算,并通过增加每个问题的轨迹数量来扩展“并行”测试时计算。借助并行扩展,我们可以将前期成本分摊到多个下游样本上,从而能够使用让 LLM 读取每个文件的简单方法来识别相关代码库上下文。为了在候选编辑之间进行选择,我们将基于模型生成测试的投票与专门用于选择的最终多轮轨迹相结合。总体而言,CodeMonkeys 使用约 2300 美元的预算解决了 SWE-bench Verified 中 57.4% 的 issue。我们的选择方法还可以用于合并来自不同来源的候选结果。对现有顶级 SWE-bench Verified 提交的编辑集合进行选择,获得了 66.2% 的分数,并且优于该集合中单独表现最好的成员。我们在 https://scalingintelligence.stanford.edu/pubs/codemonkeys 上完全公开了我们的代码和数据。
英文摘要:
Scaling test-time compute is a promising axis for improving LLM capabilities. However, test-time compute can be scaled in a variety of ways, and effectively combining different approaches remains an active area of research. Here, we explore this problem in the context of solving real-world GitHub issues from the SWE-bench dataset. Our system, named CodeMonkeys, allows models to iteratively edit a codebase by jointly generating and running a testing script alongside their draft edit. We sample many of these multi-turn trajectories for every issue to generate a collection of candidate edits. This approach lets us scale "serial" test-time compute by increasing the number of iterations per trajectory and "parallel" test-time compute by increasing the number of trajectories per problem. With parallel scaling, we can amortize up-front costs across multiple downstream samples, allowing us to identify relevant codebase context using the simple method of letting an LLM read every file. In order to select between candidate edits, we combine voting using model-generated tests with a final multi-turn trajectory dedicated to selection. Overall, CodeMonkeys resolves 57.4% of issues from SWE-bench Verified using a budget of approximately 2300 USD. Our selection method can also be used to combine candidates from different sources. Selecting over an ensemble of edits from existing top SWE-bench Verified submissions obtains a score of 66.2% and outperforms the best member of the ensemble on its own. We fully release our code and data at https://scalingintelligence.stanford.edu/pubs/codemonkeys.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。