arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2311.03366cs.SEcs.AIcs.LG
收藏

面向神经代码生成的功能重叠重排序

Functional Overlap Reranking for Neural Code Generation

FPT Software AI Center(FPT软件人工智能中心)

Hung Quoc To, Minh Huynh Nguyen, Nghi D. Q. Bui

AI总结:

本文提出 SRank 重排序策略,通过建模并量化代码解决方案簇之间的功能重叠来改进 CodeLLM 输出选择,在 Human-Eval 等多个模型上显著提升 pass@1,平均超越现有方法约 6.1%。

摘要:

代码大语言模型(CodeLLMs)开启了代码生成进步的新时代。然而,从所有可能的 CodeLLM 输出中选择最佳代码解决方案仍然是一项挑战。以往的方法常常忽视解决方案簇之间复杂的功能相似性与交互关系。我们提出 SRank,这是一种新颖的重排序策略,用于从代码生成结果中选择最佳解决方案,重点对解决方案簇之间的关系进行建模。通过量化解决方案簇之间的功能重叠,我们的方法为代码解决方案提供了更优的排序策略。实验结果表明,我们的方法在 pass@1 分数上取得了显著成果。例如,在 Human-Eval 基准上,我们使用 Codex002 达到 69.66% 的 pass@1,使用 WizardCoder 达到 75.31%,使用 StarCoder 达到 53.99%,使用 CodeGen 达到 60.55%,以显著优势(平均约提升 6.1%)超越了同一 CodeLLM 上最先进的代码生成重排序方法,如 CodeT 和 Coder-Reviewer。即使在采样解决方案数量和测试用例有限的情况下,我们的方法也表现出鲁棒性和优越性,树立了代码生成重排序的新基准。我们的实现可在 https://github.com/FSoft-AI4Code/SRank-CodeRanker 找到。

英文摘要:

Code Large Language Models (CodeLLMs) have ushered in a new era in code generation advancements. However, selecting the best code solutions from all possible CodeLLM outputs remains a challenge. Previous methods often overlooked the intricate functional similarities and interactions between solution clusters. We introduce SRank, a novel reranking strategy for selecting the best solutions from code generation, focusing on modeling the relationships between clusters of solutions. By quantifying the functional overlap between solution clusters, our approach provides a better ranking strategy for code solutions. Empirical results show that our method achieves remarkable results on the pass@1 score. For instance, on the Human-Eval benchmark, we achieve 69.66% in pass@1 with Codex002, 75.31% with WizardCoder, 53.99% with StarCoder, and 60.55% with CodeGen, surpassing state-of-the-art code generation reranking methods such as CodeT and Coder-Reviewer on the same CodeLLM by a significant margin (approximately 6.1% improvement on average). Even in scenarios with a limited number of sampled solutions and test cases, our approach demonstrates robustness and superiority, marking a new benchmark in code generation reranking. Our implementation can be found at https://github.com/FSoft-AI4Code/SRank-CodeRanker.

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

↑