构建多层级可执行代码补全评估基准,提升大模型真实开发场景下的补全能力。
ExecRepoBench: Multi-level Executable Code Completion Evaluation
- 基于抽象语法树设计多层级代码片段遮蔽方法,模拟真实编码逻辑。
- 在1.2K个活跃Python仓库样本上测试,新模型在跨文件依赖任务中显著优于基线。
- 开源本地化服务部署方案,适合需要隐私保护的开发团队使用。
代码补全已成为日常软件开发的关键工具。现有评估基准多采用静态方法,未能充分反映真实编码环境的动态特性,面临上下文长度受限、评价指标表面化及训练数据过拟合等挑战。本文提出一个新框架,通过构建仓库级评估基准 ExecRepoBench 和指令语料 Repo-Instruct,旨在提升开源大语言模型(LLM)在涉及多文件复杂依赖的真实开发场景中的表现。ExecRepoBench 包含来自活跃 Python 仓库的 1.2K 个样本。我们提出一种基于语法的多层级补全方法,根据抽象语法树在不同逻辑单元(如语句、表达式、函数)上遮蔽代码片段。随后,使用 70亿参数的开源模型在 Repo-Instruct 上进行微调,得到强基线模型 Qwen2.5-Coder-Instruct-C。该模型在 MultiPL-E 与 ExecRepoBench 等基准上持续优于先前基线,覆盖所有编程语言。其部署可作为高性能、本地化的编程辅助服务。
原文摘要 · Abstract (English)
Code completion has become an essential tool for daily software development. Existing evaluation benchmarks often employ static methods that do not fully capture the dynamic nature of real-world coding environments and face significant challenges, including limited context length, reliance on superficial evaluation metrics, and potential overfitting to training datasets. In this work, we introduce a novel framework for enhancing code completion in software development through the creation of a repository-level benchmark ExecRepoBench and the instruction corpora Repo-Instruct, aim at improving the functionality of open-source large language models (LLMs) in real-world coding scenarios that involve complex interdependencies across multiple files. ExecRepoBench includes 1.2K samples from active Python repositories. Plus, we present a multi-level grammar-based completion methodology conditioned on the abstract syntax tree to mask code fragments at various logical units (e.g. statements, expressions, and functions). Then, we fine-tune the open-source LLM with 7B parameters on Repo-Instruct to produce a strong code completion baseline model Qwen2.5-Coder-Instruct-C based on the open-source model. Qwen2.5-Coder-Instruct-C is rigorously evaluated against existing benchmarks, including MultiPL-E and ExecRepoBench, which consistently outperforms prior baselines across all programming languages. The deployment of \ourmethod{} can be used as a high-performance, local service for programming development\footnote{\url{https://execrepobench.github.io/}}.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。