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

DivAlgo:代码生成模型算法多样性的系统性评估

DivAlgo: A systematic evaluation of algorithmic diversity for code generation models

Columbia University(哥伦比亚大学);Barnard College(巴纳德学院)

Anubhav Jangra, Smaranda Muresan

AI总结:

本研究提出DivAlgo基准与轻量相似度指标,评估24种代码生成模型的算法多样性,发现其多样性远低于人类解决方案,过度接触模型生成代码会限制程序员的算法词汇量。

摘要:

代码生成模型正被积极应用于专业与教育场景,但大型语言模型(LLMs)生成算法多样化代码的能力仍鲜为人知。我们提出DivAlgo基准,这是一个包含编程问题算法多样化解决方案的大规模数据集;还引入一种轻量相似度指标以实现大规模评估。我们对24种现代代码生成模型开展实验,发现无约束的模型生成代码多样性显著低于人类解决方案(仅达到人类多样性的约31%),即便最优的多样化代码生成策略也仅能达到人类多样性的约70%。此外,虽可引导模型生成基于人类策略的解决方案,但它们无法复现人类解决方案的多样性。这些发现表明,代码生成模型在捕捉人类展现的算法多样性方面存在局限,且过度接触模型生成代码会缩小程序员的算法词汇量。

英文摘要:

Code generation models are actively being used in professional and educational settings. However, the competence of large language models (LLMs) to generate algorithmically diverse code remains largely unknown. We propose the DivAlgo benchmark, a large-scale dataset constituting algorithmically diverse solutions to programming problems. We also introduce a lightweight similarity metric to enable large-scale evaluation. Our experiments across 24 modern code generation models found that uncontrolled model-generated code is significantly less diverse than human solutions (capturing ~31% of human diversity), and even the best diverse code generation strategy could achieve only ~70% of human diversity. Moreover, while it was possible to steer the models to generate solutions based on human strategies, they were unable to reproduce the diversity of the human solutions. These findings indicate the limitations of code generation models in capturing the algorithmic diversity humans exhibit, and that overexposure to model-generated code can narrow programmers' algorithmic vocabulary.

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

↑