AIarXiv

Ranked by formulaVerdict: Notable

Green Code or Costly Code? Evaluating the Energy Costs of Iterative LLM-Based Code Optimizations

Large Language Models (LLMs) are increasingly used to optimize code for performance.

By Emami, Weigell, Mousavi +3

Score████░░░░░░3.7

Key numbers

  • 69% compared to the default
  • 4% to
  • 8.68 MJ across model-variant pairs

VerdictWorth a reader's time today.

Read the originalPDF

Abstract

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 https://doi.org/10.5281/zenodo.23598170.

Sadra Emami, Benjamin Weigell, Mohammad Reza Mousavi, Gunel Jahangirova, Hugo Araujo, Bernhard Bauer

The editor's rubric

Heuristic review

Leverage3 / 5
A method or resource many groups across the field will adopt within a year.
24% of this desk’s rubric
Magnitude4 / 5
A qualitative jump: a capability or regime that did not exist before.
18% of this desk’s rubric
Evidence3 / 5
Solid: multiple benchmarks or cohorts, ablations, fair baselines, released code or data.
14% of this desk’s rubric
Novelty3 / 5
A genuinely new approach to an open problem.
16% of this desk’s rubric
Trajectory3 / 5
A clear path to scale.
18% of this desk’s rubric
Stakes2 / 5
Benefits a professional community (practitioners, clinicians, engineers).
10% of this desk’s rubric

Editor’s rationale

Heuristic triage from title and abstract text only, not a reading of the paper. Cues found: breadth (many tasks); gains (relative gain, state of the art); firsts (new capability); verification (code released); scale (efficient); stakes (general AI).

How the score was computed

rank-2026-10-18

Score████░░░░░░3.7

Score = 10 × (65% × adjusted merit / 10 + 25% × attention + 10% × freshness)

Desks place stronger verdicts first, then use this score to order work within the same verdict.

Merit
6.2 / 10
Weighted rubric, evidence-gated.
Adjusted merit
4.9 / 10
Shrunk toward the desk prior by editor confidence (42%).
Attention
0%
Citations, upvotes, points, mentions.
Freshness
51%
Half-life decay since publication.

No attention signals recorded yet.

The record

  • Reviewed by heuristic-v10 on Oct 26, 2026, 03:46 UTC. Paper type: empirical.
  • Categories: cs.SE, cs.AI
  • BRIEF, No.9 in the Artificial Intelligence edition of October 26, 2026.