构建首个面向智能编程的代码检索综合评测基准
CORE-Bench: A Comprehensive Benchmark for Code Retrieval in the Era of Agentic Coding

- 从函数匹配升级为基于上下文的仓库级代码搜索
- 涵盖18万+查询,测试代码理解与上下文关联能力
- 适合研究智能编程代理与代码检索模型的开发者
代码检索正成为编程智能体的核心能力,但传统方法仅关注自然语言查询与孤立代码片段的匹配。在智能编程场景下,系统需根据用户需求,导航具体仓库状态,定位相关文件与函数,获取上下文信息,并过滤同库相似干扰项。现有基准多聚焦于文档字符串到函数或片段级别的匹配,忽略了以任务为导向的仓库级搜索需求。为此,我们提出CORE-Bench,一个面向智能编程时代的综合性代码检索评测基准。该基准涵盖代码理解、问题到修改定位、以及更广范围上下文检索三个层次,基于精选代码搜索任务与SWE-bench系列实例构建,包含超过18万条查询和10.6万条上下文相关性标签。实验表明,在智能编程设置下,传统代码搜索性能显著下降;对现有嵌入模型进行简单监督微调可大幅提升表现,表明仍有巨大改进空间。
原文摘要 · Abstract (English)
Code retrieval is becoming central to coding agents, but agentic coding requires more than matching a natural-language query to an isolated snippet. Given a user request, a coding agent needs to navigate a concrete repository state, locate relevant files and functions, gather supporting context, and filter similar in-repository distractors. Existing code retrieval benchmarks mainly evaluate docstring-to-function or snippet-level matching, thereby missing this requirement-driven repository search problem. To address this gap, we introduce CORE-Bench, a comprehensive benchmark for code retrieval in the era of agentic coding. CORE-Bench evaluates code retrieval ability at three levels: code understanding, issue-to-edit localization, and broader context retrieval. Built from curated code-search tasks and SWE-bench-series instances, CORE-Bench contains over 180K queries and 106K broader-context relevance labels. Experiments with representative embedding models show a sharp drop from traditional code search to code retrieval in agentic coding settings. Simple supervised fine-tuning of existing embedding models significantly improves performance in this setting, suggesting substantial room for further progress.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。