Beyond the Need for Speed: Energy-Aware Code Generation via Simulation-Guided Reinforcement Learning
- URL: http://arxiv.org/abs/2607.04577v1
- Date: Mon, 06 Jul 2026 01:04:40 GMT
- Title: Beyond the Need for Speed: Energy-Aware Code Generation via Simulation-Guided Reinforcement Learning
- Abstract summary: Green Tea is a corpus of $3.5$ million evaluations across $1,474$ C++ problems.<n>We train an energy-aware code model via supervised fine-tuning on energy-contrastive pairs, followed by closed-loop reinforcement learning.<n>On $143$ held-out problems, our simulation-in-the-loop pipeline achieves $12.63%$ CARET, nearly tripling the gain of fine-tuning alone.
- Score: 2.3228733137875524
- License: http://creativecommons.org/licenses/by-nc-nd/4.0/
- Abstract: Code models strictly prioritize functional correctness, leaving software energy efficiency as an unoptimized byproduct. Training models to generate energy-efficient code requires reproducible feedback at scale, which physical hardware measurement cannot reliably provide due to variance. In this paper, we replace hardware profiling with a deterministic architectural simulation harness to build Green Tea, a corpus of $3.5$ million evaluations across $1{,}474$ C++ problems. We train an energy-aware code model via supervised fine-tuning on energy-contrastive pairs, followed by closed-loop reinforcement learning (GRPO) using simulation-in-the-loop feedback. To rigorously evaluate deployment readiness, we introduce the Correctness-Adjusted Reduction in Energy Total (CARET), a metric that explicitly penalizes code that sacrifices functionality for efficiency. On $143$ held-out problems, our simulation-in-the-loop pipeline achieves $12.63\%$ CARET, nearly tripling the gain of fine-tuning alone, and successfully beats the energy efficiency of human-expert references on $58.4\%$ of its valid outputs. Furthermore, our analysis exposes the IPC trap: standard throughput proxies like Instructions-Per-Cycle (IPC) actively misrank true energy efficiency on $67.8\%$ of problems, proving the absolute necessity of direct energy simulation. By releasing our dataset and infrastructure, we bypass the $263{,}000$ CPU-hours required for reproduction, structurally empowering the community to deploy inherently energy-efficient code generation models.
Related papers
- Energy Flow Graph: Modeling Software Energy Consumption [2.3228733137875524]
Energy Flow Graph (EFG) is a formal model that represents computational processes as state-transition systems with energy costs for both states and transitions.<n>EFG enables various applications in software engineering, including static analysis of energy-optimal execution paths.<n>In AI pipelines, the cascade model predicts optimization combinations within 5.1% error, enabling selection from 4.2 million possibilities using only 22 measurements.
arXiv Detail & Related papers (2026-03-17T21:47:10Z) - SimulCost: A Cost-Aware Benchmark and Toolkit for Automating Physics Simulations with LLMs [56.07550353240028]
We introduce SimulCost, the first benchmark targeting cost-sensitive parameter tuning in physics simulations.<n>SimulCost compares LLM tuning cost-sensitive parameters against traditional scanning approach in both accuracy and computational cost.<n>Each simulator's cost is analytically defined and platform-independent.
arXiv Detail & Related papers (2026-03-11T05:00:48Z) - An Initial Exploration of Contrastive Prompt Tuning to Generate Energy-Efficient Code [46.879983975894135]
This study aims to investigate whether and how LLMs can be optimized to promote the generation of energy-efficient code.<n>CPT combines Contrastive Learning techniques, which help the model to distinguish between efficient and inefficient code.<n>This study evaluates CPT on Python, Java and C++ coding problems across three different models to provide a comprehensive evaluation.
arXiv Detail & Related papers (2026-03-03T12:36:15Z) - CVeDRL: An Efficient Code Verifier via Difficulty-aware Reinforcement Learning [57.24524263804788]
Code verifiers play a critical role in post-verification for LLM-based code generation.<n>Existing supervised fine-tuning methods suffer from data scarcity, high failure rates, and poor inference efficiency.<n>We show that naive RL with only functionality rewards fails to generate effective unit tests for difficult branches and samples.
arXiv Detail & Related papers (2026-01-30T10:33:29Z) - SOFT: a high-performance simulator for universal fault-tolerant quantum circuits [5.744501987992456]
SOFT is a high-performance SimulatOr for universal Fault-Tolerant quantum circuits.<n>Our work demonstrates the importance of reliable simulation tools for fault-tolerant architecture design.
arXiv Detail & Related papers (2025-12-28T18:28:56Z) - Approximate Model Predictive Control for Microgrid Energy Management via Imitation Learning [9.044455355747482]
This paper proposes an imitation learning-based framework to approximate mixed-integer Economic Model Predictive Control (EMPC) for microgrid energy management.<n>The proposed method trains a neural network to imitate expert EMPC control actions from offline trajectories, enabling fast, real-time decision making without solving optimization problems online.
arXiv Detail & Related papers (2025-10-22T21:39:18Z) - Efficient dataset construction using active learning and uncertainty-aware neural networks for plasma turbulent transport surrogate models [0.0]
This work demonstrates a proof-of-principle for using uncertainty-aware architectures to construct efficient datasets for surrogate model generation.<n>This strategy was applied again to the plasma turbulent transport problem within tokamak fusion plasmas, specifically the QuaLiKiz quasilinear electrostatic gyrokinetic turbulent transport code.<n>With 45 active learning iterations, moving from a small initial training set of $102$ to a final set of $104$, the resulting models reached a $F_1$ classification performance of 0.8 and a $R2$ regression performance of 0.75 on an independent test set
arXiv Detail & Related papers (2025-07-21T18:15:12Z) - Gradual Optimization Learning for Conformational Energy Minimization [69.36925478047682]
Gradual Optimization Learning Framework (GOLF) for energy minimization with neural networks significantly reduces the required additional data.
Our results demonstrate that the neural network trained with GOLF performs on par with the oracle on a benchmark of diverse drug-like molecules.
arXiv Detail & Related papers (2023-11-05T11:48:08Z) - Effective Pre-Training Objectives for Transformer-based Autoencoders [97.99741848756302]
We study trade-offs between efficiency, cost and accuracy of Transformer encoders.
We combine features of common objectives and create new effective pre-training approaches.
arXiv Detail & Related papers (2022-10-24T18:39:44Z) - Efficient pre-training objectives for Transformers [84.64393460397471]
We study several efficient pre-training objectives for Transformers-based models.
We prove that eliminating the MASK token and considering the whole output during the loss are essential choices to improve performance.
arXiv Detail & Related papers (2021-04-20T00:09:37Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.