Can Large-Language Models Help us Better Understand and Teach the Development of Energy-Efficient Software?

Ryan Hasler,Konstantin Läufer,George K. Thiruvathukal,Huiyun Peng,Kyle Robinson,Kirsten Davis,Yung-Hsiang Lu,James C. Davis
2024-10-30
Abstract:Computing systems are consuming an increasing and unsustainable fraction of society's energy footprint, notably in data centers. Meanwhile, energy-efficient software engineering techniques are often absent from undergraduate curricula. We propose to develop a learning module for energy-efficient software, suitable for incorporation into an undergraduate software engineering class. There is one major problem with such an endeavor: undergraduate curricula have limited space for mastering energy-related systems programming aspects. To address this problem, we propose to leverage the domain expertise afforded by large language models (LLMs). In our preliminary studies, we observe that LLMs can generate energy-efficient variations of basic linear algebra codes tailored to both ARM64 and AMD64 architectures, as well as unit tests and energy measurement harnesses. On toy examples suitable for classroom use, this approach reduces energy expenditure by 30-90%. These initial experiences give rise to our vision of LLM-based meta-compilers as a tool for students to transform high-level algorithms into efficient, hardware-specific implementations. Complementing this tooling, we will incorporate systems thinking concepts into the learning module so that students can reason both locally and globally about the effects of energy optimizations.
Computers and Society,Software Engineering
What problem does this paper attempt to address?
The problem that this paper attempts to solve is: How can large language models (LLMs) help us better understand and teach energy - efficient software development? Specifically, the energy consumption of current computing systems (especially data centers) is constantly increasing and has reached an unsustainable level. At the same time, energy - efficient software engineering techniques are often overlooked in undergraduate courses. Therefore, the author proposes to develop a learning module suitable for inclusion in undergraduate software engineering courses to teach students how to write energy - efficient software. However, there is often not enough space in the undergraduate course syllabus to cover energy - related system programming aspects. To solve this problem, the author suggests leveraging the domain expertise of large language models (LLMs). Preliminary research shows that LLMs can generate basic linear algebra code optimized for ARM64 and AMD64 architectures and provide unit testing and energy consumption measurement tools. In small examples applicable to the classroom, this method can reduce energy consumption by 30% to 90%. The author proposes two educational research questions: 1. **RQ1**: How can LLMs be applied to help engineers learn to write energy - efficient software? 2. **RQ2**: Is system thinking an effective method for reasoning about energy - efficient software engineering design at the design level? To verify these ideas, the author conducted preliminary experiments, using GPT - 4 as an optimizer, and successfully generated more efficient algorithm versions and significantly reduced energy consumption. Based on these preliminary results, the author plans to develop an educational module aimed at increasing software engineers' awareness of sustainability and energy efficiency and introducing how to use LLMs to optimize algorithms to promote energy efficiency. In addition, the concept of system thinking will also be introduced to enable students to consider the impact of energy optimization as a whole. In conclusion, the goal of this paper is to provide students with a new learning tool and method by combining LLMs and system thinking, in order to meet the challenges brought by the increasing energy consumption of data center software and lay the foundation for long - term sustainable development.