AI驱动,但耗电?大语言模型生成代码的能效研究
AI-Powered, But Power-Hungry? Energy Efficiency of LLM-Generated Code
AI总结:
本文首次系统评估了Github Copilot、GPT-4o和OpenAI o1-mini在LeetCode困难题上生成Python、Java和C++代码的能效与性能,发现模型生成Python和Java的成功率远高于C++。
摘要:
大语言模型(LLMs)被用于软件开发中以辅助各种任务,例如代码生成和代码补全,但对这些模型所产生结果质量的实证评估仅关注正确性,而忽略了其他相关方面,如性能和能效。研究LLM所生成程序的性能对于理解LLM能在多大程度上支持构建性能和能耗关键型软件(如操作系统、服务器和移动应用)至关重要。本文提出了首项研究,分析LLM生成代码在三种编程语言Python、Java和C++上的能效和性能,在Mac和PC两个平台上,利用三个前沿LLM——Github Copilot、GPT-4o和最近发布的OpenAI o1-mini,并针对LeetCode上的“困难”编程问题。我们的结果表明,这些模型在生成Python和Java代码方面比生成C++代码成功得多。
英文摘要:
Large language models (LLMs) are used in software development to assist in various tasks, e.g., code generation and code completion, but empirical evaluations of the quality of the results produced by these models focus on correctness and ignore other relevant aspects, such as their performance and energy efficiency. Studying the performance of LLM-produced programs is essential to understand how well LLMs can support the construction of performance- and energy-critical software, such as operating systems, servers, and mobile applications. This paper presents the first study analyzing the energy efficiency and performance of LLM-generated code for three programming languages Python, Java, and C++, on two platforms, a Mac and a PC, leveraging three frontier LLMs, Github Copilot, GPT-4o, and the recently-released OpenAI o1-mini, and targeting ``hard'' programming problems from LeetCode. Our results show that the models are much more successful in generating Python and Java than C++ code.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。