Green Code or Costly Code? Evaluating the Energy Costs of Iterative LLM-Based Code Optimizations
Critical sustainability findings for ML engineers using LLMs for code optimization, revealing energy-performance tradeoffs.
AI Summary
LLM-based code optimization produces faster but more energy-intensive code than human-written solutions, with energy costs equivalent to 250-2800 GPT-4.1 queries.
Excerpt
Large Language Models (LLMs) are increasingly used to optimize code for performance. This practice often assumes that improvements in execution speed naturally translate into overall lower energy consumption. We challenge this assumption empirically by measuring whether performance-optimized code produced by LLM self-refinement pipelines is also energy-efficient relative to canonical human reference solutions, and whether the energy cost of the optimization process can be offset by subsequent ex
