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

ContextBench: 一种用于编码代理代码上下文检索的基准测试

ContextBench: A Benchmark for Context Retrieval in Coding Agents

Nanjing University(南京大学);University College London(伦敦大学学院)

Han Li, Letian Zhu, Bohan Zhang, Rili Feng, Jiaming Wang, Yue Pan, Earl T. Barr, Federica Sarro, Zhaoyang Chu, He Ye

AI总结:

ContextBench通过评估编码代理在问题解决过程中代码上下文的检索能力,揭示了代理在上下文利用上的不足,为改进LLM在软件任务中的推理提供了新的研究方向。

摘要:

基于大语言模型的编码代理在自动化问题解决基准测试中表现出色,但现有评估主要集中在最终任务成功上,对代理在解决问题过程中如何检索和使用代码上下文的洞察有限。我们引入了ContextBench,这是一种面向过程的编码代理代码上下文检索评估。ContextBench包含来自八个编程语言的66个仓库中的1136个问题解决任务,每个任务都附加了人工标注的黄金上下文。我们进一步实现了一个自动化评估框架,跟踪代理轨迹并测量问题解决过程中上下文的召回率、精确率和效率。使用ContextBench,我们评估了四个前沿LLM和五个编码代理。我们的结果表明,复杂的代理 scaffolding 在上下文检索中仅带来微小的提升(“编码代理的苦涩教训”),LLM一贯倾向于召回而非精确率,且在探索和利用上下文之间存在显著差距。ContextBench通过添加中间的黄金上下文指标,补充了现有的端到端基准测试,揭示了问题解决过程。这些上下文为指导LLM在软件任务中的推理提供了有价值的信息信号。

英文摘要:

LLM-based coding agents have shown strong performance on automated issue resolution benchmarks, yet existing evaluations largely focus on final task success, providing limited insight into how agents retrieve and use code context during problem solving. We introduce ContextBench, a process-oriented evaluation of context retrieval in coding agents. ContextBench consists of 1,136 issue-resolution tasks from 66 repositories across eight programming languages, each augmented with human-annotated gold contexts. We further implement an automated evaluation framework that tracks agent trajectories and measures context recall, precision, and efficiency throughout issue resolution. Using ContextBench, we evaluate four frontier LLMs and five coding agents. Our results show that sophisticated agent scaffolding yields only marginal gains in context retrieval ("The Bitter Lesson" of coding agents), LLMs consistently favor recall over precision, and substantial gaps exist between explored and utilized context. ContextBench augments existing end-to-end benchmarks with intermediate gold-context metrics that unbox the issue-resolution process. These contexts offer valuable intermediate signals for guiding LLM reasoning in software tasks.

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

↑