arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.06041cs.SE
收藏

关于评估大语言模型所生成源代码的效率

On Evaluating the Efficiency of Source Code Generated by LLMs

Changan Niu, Ting Zhang, Chuanyi Li, Bin Luo, Vincent Ng

AI总结:

本文提出在代码正确性之外进一步评估LLMs生成代码的效率,通过在HumanEval、MBPP和LeetCode上进行评测,并探索能促使LLMs生成更高效代码的提示方法。

摘要:

近年来,大语言模型(LLMs)在代码生成方面展现出卓越的能力。与现有工作评估LLMs生成代码的正确性不同,我们提出进一步评估其效率。更高效的代码能够提升由LLM辅助编程所完成的程序和软件的性能与执行效率。首先,我们在两个基准HumanEval和MBPP上评估LLMs生成代码的效率。然后,我们从在线评测平台LeetCode中选取一组编程问题,进行更具难度的评估。最后,我们探索了若干提示(prompts),以使LLMs能够生成更高效的代码。

英文摘要:

Recent years have seen the remarkable capabilities of large language models (LLMs) for code generation. Different from existing work that evaluate the correctness of the code generated by LLMs, we propose to further evaluate its efficiency. More efficient code can lead to higher performance and execution efficiency of programs and software completed by LLM-assisted programming. First, we evaluate the efficiency of the code generated by LLMs on two benchmarks, HumanEval and MBPP. Then, we choose a set of programming problems from the online judge platform LeetCode to conduct a more difficult evaluation. Finally, we explore several prompts that would enable LLMs to generate more efficient code.

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

↑