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

评估和实现可控的代码补全在代码LLM中

Evaluating and Achieving Controllable Code Completion in Code LLM

University of Science and Technology of China(中国科学技术大学);Alibaba Group(阿里巴巴集团);Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);University of Chinese Academy of Sciences(中国科学院大学)

Jiajun Zhang, Zeyu Cui, Lei Zhang, Jian Yang, Jiaxi Yang, Qiang Liu, Zilei Wang, Binyuan Hui, Liang Wang, Junyang Lin

AI总结:

本文提出可控代码补全基准C3-Bench,评估了40种LLM在代码补全中的指令遵循能力,开发数据合成管道并推出Qwen2.5-Coder-C3模型,实现代码补全性能的突破。

摘要:

代码补全已成为一个核心任务,随着基于大型语言模型(LLM)的工具在软件工程中的兴起,获得了显著关注。尽管最近的进展极大地提高了LLM的代码补全能力,但评估方法却没有同步进步。当前大多数基准测试仅关注基于给定上下文的代码补全的功能正确性,忽略了模型在补全过程中遵循用户指令的能力——这是LLM辅助编程中的常见场景。为了解决这一限制,我们提出了第一个指导指令的代码补全基准,可控代码补全基准(C3-Bench),包含2195个精心设计的补全任务。通过在C3-Bench和传统基准上对超过40种主流LLM进行全面评估,我们揭示了在代码补全任务中,开源和高级专有模型在遵循指令能力上的显著差距。此外,我们开发了一条简单的数据合成管道,利用Qwen2.5-Coder生成高质量的指令-补全对用于监督微调(SFT)。所得到的模型,Qwen2.5-Coder-C3,在C3-Bench上实现了最先进的性能。我们的发现为增强LLM的代码补全和指令遵循能力提供了有价值的见解,为未来代码LLM的研究指明了新方向。为了促进可重复性和进一步推动代码LLM的研究,我们开源了所有代码、数据集和模型。

英文摘要:

Code completion has become a central task, gaining significant attention with the rise of large language model (LLM)-based tools in software engineering. Although recent advances have greatly improved LLMs' code completion abilities, evaluation methods have not advanced equally. Most current benchmarks focus solely on functional correctness of code completions based on given context, overlooking models' ability to follow user instructions during completion-a common scenario in LLM-assisted programming. To address this limitation, we present the first instruction-guided code completion benchmark, Controllable Code Completion Benchmark (C3-Bench), comprising 2,195 carefully designed completion tasks. Through comprehensive evaluation of over 40 mainstream LLMs across C3-Bench and conventional benchmarks, we reveal substantial gaps in instruction-following capabilities between open-source and advanced proprietary models during code completion tasks. Moreover, we develop a straightforward data synthesis pipeline that leverages Qwen2.5-Coder to generate high-quality instruction-completion pairs for supervised fine-tuning (SFT). The resulting model, Qwen2.5-Coder-C3, achieves state-of-the-art performance on C3-Bench. Our findings provide valuable insights for enhancing LLMs' code completion and instruction-following capabilities, establishing new directions for future research in code LLMs. To facilitate reproducibility and foster further research in code LLMs, we open-source all code, datasets, and models.

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

↑