Green Code or Costly Code? Evaluating the Energy Costs of Iterative LLM-Based Code Optimizations
arXiv cs.AI · 24 Oct 2026, 02:58 AEST
Large Language Models (LLMs) are increasingly used to optimize code for performance. However, this study challenges the assumption that performance improvements lead to lower energy consumption.
Key facts
- We evaluate 11 open-source models across four decoding configurations on all 1,000 problems of EffiBench, a state-of-the-art performance benchmark, while collecting per-process, hardware-level energy measurements throughout.
- Inference energy spans 0.79 to 8.68 MJ across model-variant pairs, which is roughly equivalent to the energy of 250 to 2800 GPT-4.1 queries.
- On the execution side, 42 of 44 configurations produce code that consumes more energy per problem than the canonical human reference, with overheads ranging from +4% to +886%.
- Performance optimization and energy efficiency are not always aligned goals: LLM self-refinement consistently produces faster-seeking but energy-heavier code relative to what a human engineer would write.
Read aloud
Large Language Models L L M s are increasingly used to optimize code for performance. However, this study challenges the assumption that performance improvements lead to lower energy consumption. We evaluate eleven open-source models across four decoding configurations on all one thousand problems of EffiBench, a state-of-the-art performance benchmark, while collecting per-process, hardware-level energy measurements throughout. Inference energy spans zero point seven nine to eight point six eight MJ across model-variant pairs, which is roughly equivalent to the energy of two hundred fifty to two thousand eight hundred G P T four point one queries. On the execution side, forty two of forty four configurations produce code that consumes more energy per problem than the canonical human reference, with overheads ranging from +four percent to +eight hundred eighty six percent. Performance optimization and energy efficiency are not always aligned goals: L L M self-refinement consistently produces faster-seeking but energy-heavier code relative to what a human engineer would write.
Sources in this cluster
- Green Code or Costly Code? Evaluating the Energy Costs of Iterative LLM-Based Code Optimizations
arXiv cs.AI · 24 Oct 2026, 02:58 AEST