Daily Arxiv

This is a page that curates AI-related papers published worldwide.
All content here is summarized using Google Gemini and operated on a non-profit basis.
Copyright for each paper belongs to the authors and their institutions; please make sure to credit the source when sharing.

Generating Energy-Efficient Code via Large-Language Models -- Where are we now?

Created by
  • Haebom

Author

Radu Apsan, Vincenzo Stoico, Michel Albonico, Rudra Dhar, Karthik Vaidhyanathan, Ivano Malavolta

Outline

This paper presents the results of a study comparing the energy efficiency of Python code generated by a large-scale language model (LLM) with that of human-written code and code written by green software experts. We tested 363 solutions to nine coding problems in the EvoEval benchmark using six widely used LLMs and four prompting techniques, and compared them with human-written solutions. Energy consumption was measured and analyzed on three hardware platforms: a server, a PC, and a Raspberry Pi. Human-written code was 16% more energy efficient on a server and 3% more energy efficient on a Raspberry Pi, while LLM was 25% more energy efficient than human-written code on a PC. Prompting techniques showed inconsistent energy savings across hardware platforms, while code written by green software experts was found to be at least 17% to 30% more energy efficient across all LLMs and hardware platforms.

Takeaways, Limitations

Takeaways:
Although LLM has excellent code generation capabilities, it still has limitations in generating energy-efficient code.
We emphasize that the expertise of experienced professionals is still essential for developing energy-efficient codes.
It highlights the importance of prompt engineering and platform dependency in code generation using LLM.
We show that the energy efficiency of LLM-generated code can vary across hardware platforms.
Limitations:
This research is limited to a specific benchmark and programming language (Python).
The LLM and prompting techniques used may be limited.
The type and number of hardware platforms used in energy efficiency assessments may be limited.
Further research is needed on broader coding issues and across different hardware platforms.
👍