AI-Powered, But Power-Hungry? Energy Efficiency of LLM-Generated Code

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Solovyeva, Lola, Weidmann, Sophie, Castor, Fernando
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910814061985792
author Solovyeva, Lola
Weidmann, Sophie
Castor, Fernando
author_facet Solovyeva, Lola
Weidmann, Sophie
Castor, Fernando
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2502_02412
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle AI-Powered, But Power-Hungry? Energy Efficiency of LLM-Generated Code
Solovyeva, Lola
Weidmann, Sophie
Castor, Fernando
Software Engineering
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.
title AI-Powered, But Power-Hungry? Energy Efficiency of LLM-Generated Code
topic Software Engineering
url https://arxiv.org/abs/2502.02412