Large Language Models for Energy-Efficient Code: Emerging Results and Future Directions

Huiyun Peng,Arjun Gupte,Nicholas John Eliopoulos,Chien Chou Ho,Rishi Mantri,Leo Deng,Wenxin Jiang,Yung-Hsiang Lu,Konstantin Läufer,George K. Thiruvathukal,James C. Davis
2024-10-12
Abstract:Energy-efficient software helps improve mobile device experiences and reduce the carbon footprint of data centers. However, energy goals are often de-prioritized in order to meet other requirements. We take inspiration from recent work exploring the use of large language models (LLMs) for different software engineering activities. We propose a novel application of LLMs: as code optimizers for energy efficiency. We describe and evaluate a prototype, finding that over 6 small programs our system can improve energy efficiency in 3 of them, up to 2x better than compiler optimizations alone. From our experience, we identify some of the challenges of energy-efficient LLM code optimization and propose a research agenda.
Software Engineering
What problem does this paper attempt to address?
The problem that this paper attempts to solve is the lack of energy efficiency in software development. Specifically, the authors focus on how to use large - language models (LLMs) to optimize code in order to improve its energy efficiency without sacrificing performance or correctness. In current software development practices, although there are already some methods and techniques for improving energy efficiency, these methods are often difficult to be widely adopted because they may introduce additional complexity and usually require specialized knowledge of the system. In addition, existing LLMs are mainly used to generate fast code, rather than energy - saving code. Therefore, this paper proposes a novel application direction, that is, using LLMs as code optimizers, focusing on improving energy efficiency. In this way, the authors hope to lower the threshold for achieving energy - efficient software, enabling more developers to easily write programs that are both efficient and energy - saving.