arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2505.13004cs.CL
收藏

EffiBench-X:用于衡量大语言模型生成代码效率的多语言基准

EffiBench-X: A Multi-Language Benchmark for Measuring Efficiency of LLM-Generated Code

HKU(香港大学);UCL(伦敦大学学院);NTU(南洋理工大学);NUS(新加坡国立大学);HKUST (GZ)(香港科技大学(广州));HKUST(香港科技大学);Monash University(莫纳什大学);CSIRO’s Data61(澳大利亚联邦科学与工业研究组织Data61分部);KCL(伦敦大学国王学院)

Yuhao Qing, Boyu Zhu, Mingzhe Du, Zhijiang Guo, Terry Yue Zhuo, Qianru Zhang, Jie M. Zhang, Heming Cui, Siu-Ming Yiu, Dong Huang, See-Kiong Ng, Luu Anh Tuan

AI总结:

针对现有代码生成基准重功能正确性、轻效率且语言单一的问题,提出多语言效率基准EffiBench-X,评估发现前沿LLM生成代码效率远低于人类,且存在语言差异,凸显多语言代码效率优化的必要性。

摘要:

现有代码生成基准主要评估功能正确性,对代码效率的关注有限,且通常局限于Python等单一语言。为填补这一空白,我们推出了EffiBench-X,这是首个用于衡量大语言模型(LLM)生成代码效率的多语言基准。EffiBench-X支持Python、C++、Java、JavaScript、Ruby和Golang,包含以人类专家解决方案作为效率基线的竞赛编程任务。在EffiBench-X上对前沿LLM的评估显示,尽管模型生成的代码功能正确,但在效率上始终不及人类专家。即便是效率最高的LLM生成方案(Qwen3-32B),平均效率也仅达到人类的约62%,且存在显著的语言差异。LLM在Python、Ruby和JavaScript中的效率表现优于Java、C++和Golang,例如DeepSeek-R1的Python代码效率远高于其Java代码。这些结果凸显了研究LLM优化技术以提升多语言代码效率的迫切需求。数据集与评估基础设施已提交,可通过https://github.com/EffiBench/EffiBench-X.git和https://huggingface.co/datasets/EffiBench/effibench-x获取。

英文摘要:

Existing code generation benchmarks primarily evaluate functional correctness, with limited focus on code efficiency and often restricted to a single language like Python. To address this gap, we introduce EffiBench-X, the first multi-language benchmark designed to measure the efficiency of LLM-generated code. EffiBench-X supports Python, C++, Java, JavaScript, Ruby, and Golang. It comprises competitive programming tasks with human-expert solutions as efficiency baselines. Evaluating state-of-the-art LLMs on EffiBench-X reveals that while models generate functionally correct code, they consistently underperform human experts in efficiency. Even the most efficient LLM-generated solutions (Qwen3-32B) achieve only around \textbf{62\%} of human efficiency on average, with significant language-specific variations. LLMs show better efficiency in Python, Ruby, and JavaScript than in Java, C++, and Golang. For instance, DeepSeek-R1's Python code is significantly more efficient than its Java code. These results highlight the critical need for research into LLM optimization techniques to improve code efficiency across diverse languages. The dataset and evaluation infrastructure are submitted and available at https://github.com/EffiBench/EffiBench-X.git and https://huggingface.co/datasets/EffiBench/effibench-x.

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

↑