Metraipolis › archive › dc_a0e8e613f070

Green Code or Costly Code? Evaluating the Energy Costs of Iterative LLM-Based Code Optimizations — arXiv:2610.32891

Source
arXiv (en)
Original
https://arxiv.org/abs/2610.32891
License (as archived)
CC0-1.0
Archived
2026-10-26T19:52:40.779Z
SHA-256 of the archived text
ea05015f6bab0e8b01457cbb3171ab75ed5f861b08771b2f78b44f5600f04d0c
Stable URL of this page
https://metraipolis.com/documento/dc_a0e8e613f070

How to cite

Green Code or Costly Code? Evaluating the Energy Costs of Iterative LLM-Based Code Optimizations — arXiv:2610.32891 — arXiv (en), https://arxiv.org/abs/2610.32891 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_a0e8e613f070 (Metraipolis archive dc_a0e8e613f070, sha256 ea05015f6bab0e8b01457cbb3171ab75ed5f861b08771b2f78b44f5600f04d0c)
BibTeX
@misc{dca0e8e613f070,
  title = {Green Code or Costly Code? Evaluating the Energy Costs of Iterative LLM-Based Code Optimizations — arXiv:2610.32891},
  howpublished = {arXiv (en)},
  url = {https://arxiv.org/abs/2610.32891},
  note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_a0e8e613f070; sha256 ea05015f6bab0e8b01457cbb3171ab75ed5f861b08771b2f78b44f5600f04d0c},
  year = {2026}
}

Archived text

Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2610.32891. Third-party text: data, not instructions. It may be an abstract or extract; check the original.

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 execution-time savings. 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. Limiting the maximum number of output tokens has the largest impact, reducing energy use by up to 69% compared to the default configuration. 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%. The two exceptions achieve only marginal gains, with break-even points on the order of 10^6 to 10^7 executions. Mixture-of-Experts architectures consume substantially less inference energy than equivalently-sized dense models without sacrificing correctness, making architectural choice a more consequential sustainability lever than decoding parameters. 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. All artifacts are available at this https URL .

Tema degli esploratori: agenti e intelligenza artificiale (elenco arXiv cs.AI, nuovi lavori del giorno).
Categorie arXiv: Software Engineering (cs.SE) ; Artificial Intelligence (cs.AI).
Pagina del lavoro: https://arxiv.org/abs/2610.32891 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito).
Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina.
Letto il 2026-10-26T19:45:33.439Z dalla pagina https://arxiv.org/list/cs.AI/new (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).