Green by Design: Energy-Guided Reranking of LLM-Generated Programs

The carbon footprint of computing is increasingly shaped by software, yet existing programming tools and large language models (LLMs) remain largely energy-blind. We propose energy-guided code generation, a method that reranks LLM-generated programs based on direct energy measurements using CodeCarbon while ensuring functional correctness. Evaluating a benchmark of algorithmic and data-processing tasks, we show that energy-guided selection yields statistically significant energy reductions. It reduces consumption by an average of 44.69% compared to unguided Top-1 candidates and by an additional 1.86% compared to the fastest (Best-Time) implementations, all without runtime penalties or loss of accuracy. These results provide the first conclusive evidence that LLMs produce diverse implementations with substantial variation in energy use, and that energy-aware reranking can consistently surface verifiably greener solutions. By embedding energy as a first-class optimization signal in the act of code generation, this work establishes a foundation for green-by-design software generation systems, where sustainability is not an afterthought but a default property of programming tools.

Authors

Publication Details

Journal
RODIN (Universidad de Cádiz)
Published
2025-10-22
Primary Topic
Green IT and Sustainability
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Green by Design: Energy-Guided Reranking of LLM-Generated Programs

José Miguel Aragón Jurado, Ruck Thawonmas, Yi Xia
RODIN (Universidad de Cádiz)
Green IT and Sustainability
article

Green by Design: Energy-Guided Reranking of LLM-Generated Programs

José Miguel Aragón Jurado, Ruck Thawonmas, Yi Xia
article en

Abstract

The carbon footprint of computing is increasingly shaped by software, yet existing programming tools and large language models (LLMs) remain largely energy-blind. We propose energy-guided code generation, a method that reranks LLM-generated programs based on direct energy measurements using CodeCarbon while ensuring functional correctness. Evaluating a benchmark of algorithmic and data-processing tasks, we show that energy-guided selection yields statistically significant energy reductions. It reduces consumption by an average of 44.69% compared to unguided Top-1 candidates and by an additional 1.86% compared to the fastest (Best-Time) implementations, all without runtime penalties or loss of accuracy. These results provide the first conclusive evidence that LLMs produce diverse implementations with substantial variation in energy use, and that energy-aware reranking can consistently surface verifiably greener solutions. By embedding energy as a first-class optimization signal in the act of code generation, this work establishes a foundation for green-by-design software generation systems, where sustainability is not an afterthought but a default property of programming tools.

RODIN (Universidad de Cádiz)
Openalex Percentile: Top 37%
Green IT and Sustainability
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Green by Design: Energy-Guided Reranking of LLM-Generated Programs — José Miguel Aragón Jurado, Ruck Thawonmas, et al. · RODIN (Universidad de Cádiz) (2025) | TGRS Research Map | TGRS