arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.03344cs.SEcs.AI
收藏

学会可持续编码:基于大语言模型的绿色代码生成实证研究

Learn to Code Sustainably: An Empirical Study on LLM-based Green Code Generation

TWT GmbH Science & Innovation(TWT 科学与创新有限公司);National Technical University of Athens(雅典国立技术大学);Massachusetts Institute of Technology(麻省理工学院);Harvard University(哈佛大学);Mercedes-Benz(梅赛德斯-奔驰)

Tina Vartziotis, Ippolyti Dellatolas, George Dasoulas, Maximilian Schmidt, Florian Schneider, Tim Hoffmann, Sotirios Kotsopoulos, Michael Keckeisen

AI总结:

本研究围绕绿色编码开展实证,提出代码“绿色容量”定义,对比三款商用AI大模型生成代码与人工代码的性能及可持续性,揭示AI模型助力可持续软件开发的现有能力。

摘要:

信息技术的日益普及使得数据中心的能源消耗和碳排放占比居高不下。随着大数据分析需求增长、数字化程度提升以及大型人工智能(AI)模型的发展,这一占比预计还将上升。解决软件开发环境影响的必要性引发了人们对绿色(可持续)编码的更多关注,也催生了“使用AI模型可提升能源效率”的相关说法。本文针对绿色编码开展了一项实证研究,梳理了绿色编码实践,同时介绍了用于量化AI模型可持续性意识的指标。在该框架下,我们评估了自动生成代码的可持续性。本研究涉及的自动生成代码由商用生成式AI语言模型产出,包括GitHub Copilot、OpenAI ChatGPT-3和Amazon CodeWhisperer。在研究方法中,为量化这些AI模型的可持续性意识,我们基于若干可持续性指标,提出了代码“绿色容量”的定义。我们对比了人工编写的代码,与上述三款AI语言模型针对从易到难的问题陈述生成的代码,在性能和绿色容量上的表现。研究结果揭示了当前AI模型助力可持续软件开发的实际能力。

英文摘要:

The increasing use of information technology has led to a significant share of energy consumption and carbon emissions from data centers. These contributions are expected to rise with the growing demand for big data analytics, increasing digitization, and the development of large artificial intelligence (AI) models. The need to address the environmental impact of software development has led to increased interest in green (sustainable) coding and claims that the use of AI models can lead to energy efficiency gains. Here, we provide an empirical study on green code and an overview of green coding practices, as well as metrics used to quantify the sustainability awareness of AI models. In this framework, we evaluate the sustainability of auto-generated code. The auto-generate codes considered in this study are produced by generative commercial AI language models, GitHub Copilot, OpenAI ChatGPT-3, and Amazon CodeWhisperer. Within our methodology, in order to quantify the sustainability awareness of these AI models, we propose a definition of the code's "green capacity", based on certain sustainability metrics. We compare the performance and green capacity of human-generated code and code generated by the three AI language models in response to easy-to-hard problem statements. Our findings shed light on the current capacity of AI models to contribute to sustainable software development.

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

↑