The increasing use of Large Language Models (LLMs) for automated software development creates a paradox: LLM-generated code can boost energy efficiency across industries through digital transformation but their often unsupervised usage unintentionally generates energy-inefficient code when functional correctness is prioritized. Current benchmarks show that LLMs generate energy-efficient code when prompted with optimized instructions. However, it is unclear for which problems, programming languages, and prompting strategies lead to the best trade-off between correctness and energy efficiency. To address the current gaps in untested prompts, this work uses a systematic approach to analyze which prompt elements lead to LLMs generating correct and energy-efficient code. Results reveal that prompt engineering increases code energy efficiency by up to 91.9% in some cases, but often reduces accuracy. Our novel approach, inspired by Holistic Evaluation of Language Models (HELM), reveals that LLMs are sensitive to prompt contents. One result shows that the energy efficiency increases by more than 4 × when half of the programming problem description is removed, while in other cases accuracy drops to zero.
Abstract as published.
Ionescu, D., Jensen, S. K., & Thomsen, B. (2025). EnergyBench: Holistic Benchmark for Correct and Energy-Efficient LLM-Generated Code. 2025 3rd International Conference on Federated Learning Technologies and Applications (FLTA), 571–579. https://doi.org/10.1109/flta67013.2025.11336593
Ionescu, D., Jensen, S. K., & Thomsen, B. (2025). EnergyBench: Holistic Benchmark for Correct and Energy-Efficient LLM-Generated Code. 2025 3rd International Conference on Federated Learning Technologies and Applications (FLTA), 571–579. https://doi.org/10.1109/flta67013.2025.11336593Ionescu, D., Jensen, S.K. and Thomsen, B. (2025) ‘EnergyBench: Holistic Benchmark for Correct and Energy-Efficient LLM-Generated Code,’ 2025 3rd International Conference on Federated Learning Technologies and Applications (FLTA). Edited by , pp. 571–579. Available at: https://doi.org/10.1109/flta67013.2025.11336593.[1]D. Ionescu, S. K. Jensen, and B. Thomsen, ‘EnergyBench: Holistic Benchmark for Correct and Energy-Efficient LLM-Generated Code,’ 2025 3rd International Conference on Federated Learning Technologies and Applications (FLTA), pp. 571–579, Oct. 2025, doi: 10.1109/flta67013.2025.11336593.Ionescu, Dragoș, Søren Kejser Jensen, and Bent Thomsen. 2025. ‘EnergyBench: Holistic Benchmark for Correct and Energy-Efficient LLM-Generated Code.’ 2025 3rd International Conference on Federated Learning Technologies and Applications (FLTA), October 14, 571–79. https://doi.org/10.1109/flta67013.2025.11336593.Ionescu D, Jensen SK, Thomsen B. EnergyBench: Holistic Benchmark for Correct and Energy-Efficient LLM-Generated Code. 2025 3rd International Conference on Federated Learning Technologies and Applications (FLTA). 2025. https://doi.org/10.1109/flta67013.2025.11336593@inproceedings{Ionescu_2025, title={EnergyBench: Holistic Benchmark for Correct and Energy-Efficient LLM-Generated Code}, url={http://dx.doi.org/10.1109/flta67013.2025.11336593}, DOI={10.1109/flta67013.2025.11336593}, booktitle={2025 3rd International Conference on Federated Learning Technologies and Applications (FLTA)}, publisher={IEEE}, author={Ionescu, Dragoș and Jensen, Søren Kejser and Thomsen, Bent}, year={2025}, month=Oct, pages={571–579} }