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

SWE Context Bench: 一个用于编码上下文学习的基准测试

SWE Context Bench: A Benchmark for Context Learning in Coding

Independent Researcher(独立研究员);University of Oxford(牛津大学);University of Edinburgh(爱丁堡大学);Technical University of Munich(慕尼黑工业大学);MemoraX AI;National University of Singapore(新加坡国立大学);Mohamed bin Zayed University of Artificial Intelligence(穆罕默德·本·扎耶德人工智能大学);Carnegie Mellon University(卡内基梅隆大学)

Jared Zhu, Minhao Hu, Junde Wu

AI总结:

本文提出SWE-ContextBench基准,用于评估编程代理的上下文重用能力,通过1100个基础任务和376个相关任务,从GitHub问题和拉取请求中挖掘真实依赖关系,评估预测准确度、时间效率和成本效率。

摘要:

大型语言模型越来越多地被用作编程代理,用于仓库级别的软件工程任务。尽管最近的基准测试评估了现实代码库中的正确性,但它们大多将任务视为独立的,并未评估代理在相关问题中重用先前经验或上下文的能力。因此,代理积累、检索和应用先前经验的能力以及由此带来的效率提升仍难以衡量。我们介绍了SWE-ContextBench,一个专门用于评估编程代理上下文重用的基准。该基准基于SWE-Bench Lite、SWE-Bench Multilingual和SWE-Bench Verified构建,包含1100个基础任务和376个相关任务,这些任务来源于GitHub问题和拉取请求之间的真实依赖和引用关系。SWE-ContextBench将具有共享上下文的基础任务和相关任务分为51个唯一仓库和9种编程语言。该基准从三个互补维度评估代理:预测准确性、时间效率和成本效率。利用SWE-ContextBench,我们研究了多种上下文重用设置,包括 oracle 引导和自主检索,以及完整执行轨迹和紧凑摘要。我们的结果表明,正确选择的摘要上下文提高了解决准确性,并显著减少了运行时间和令牌成本,特别是在更难的任务上。相比之下,未过滤或错误选择的上下文提供有限或负效益。这些发现突显了上下文表示和检索质量的重要性,并将SWE-ContextBench定位为研究编程代理上下文重用的系统性基准。

英文摘要:

Large language models are increasingly used as programming agents for repository level software engineering tasks. While recent benchmarks evaluate correctness in realistic codebases, they largely treat tasks as independent and do not assess whether agents can reuse previous experience or contexts across related problems. As a result, the ability of agents to accumulate, retrieve, and apply prior experience, as well as the efficiency gains from such reuse, remains difficult to measure. We introduce SWE-ContextBench, a benchmark designed to explicitly evaluate context reuse in programming agents. Built on SWE-Bench Lite, SWE-Bench Multilingual, and SWE-Bench Verified, SWE-ContextBench consists of 1,100 base tasks with 376 related tasks derived from real dependency and reference relationships among GitHub issues and pull requests. SWE-ContextBench groups base tasks and related tasks with shared context across 51 unique repositories and 9 programming languages. The benchmark evaluates agents along three complementary dimensions: prediction accuracy, time efficiency, and cost efficiency. Using SWE-ContextBench, we study multiple context reuse settings, including oracle guided and autonomous retrieval, as well as full execution trajectories and compact summaries. Our results show that correctly selected summarized context improves resolution accuracy and substantially reduces runtime and token cost, particularly on harder tasks. In contrast, unfiltered or incorrectly selected context provides limited or negative benefits. These findings highlight the importance of context representation and retrieval quality, and position SWE-ContextBench as a principled benchmark for studying context reuse in programming agents.

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

↑