Beyond the Need for Speed: Energy-Aware Code Generation via Simulation-Guided Reinforcement Learning
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 33 of its 64 references that are in the map. First posted on arXiv 6 Jul 2026.
Builds on
33 of 64 references.
References · 33
- 2017Attention Is All You Needcited by 59,932
- 2017Proximal Policy Optimization Algorithmscited by 14,441
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 8,851
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,767
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,528
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
- 2019Quantifying the Carbon Emissions of Machine Learningcited by 516
- 2025SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolutioncited by 246
- 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 199
21 more
- 2024RLEF: Grounding Code LLMs in Execution Feedback with Reinforcement Learningcited by 146
- 2025On the Generalization of SFT: A Reinforcement Learning Perspective with Reward Rectificationcited by 121
- 2024A Note on Shumailov et al. (2024): `AI Models Collapse When Trained on Recursively Generated Data'cited by 114
- 2023RLTF: Reinforcement Learning from Unit Test Feedbackcited by 110
- 2023A Systematic Review of Green AIcited by 77
- 2024Evaluating Language Models for Efficient Code Generationcited by 69
- 2024EffiBench: Benchmarking the Efficiency of Automatically Generated Codecited by 62
- 2023The Wisdom of Hindsight Makes Language Models Better Instruction Followerscited by 59
- 2024How Efficient is LLM-Generated Code? A Rigorous & High-Standard Benchmarkcited by 39
- 2023Supersonic: Learning to Generate Source Code Optimizations in C/C++cited by 15
- 2025Afterburner: Reinforcement Learning Facilitates Self-Improving Code Efficiency Optimizationcited by 14
- 2023ComPile: A Large IR Dataset from Production Sourcescited by 10
- 2025AI-Powered, But Power-Hungry? Energy Efficiency of LLM-Generated Codecited by 8
- 2024Learn to Code Sustainably: An Empirical Study on LLM-based Green Code Generationcited by 7
- 2024A Controlled Experiment on the Energy Efficiency of the Source Code Generated by Code Llamacited by 7
- 2023Enhancing Energy-Awareness in Deep Learning through Fine-Grained Energy Measurementcited by 5
- 2025DRIVE: Data Curation Best Practices for Reinforcement Learning with Verifiable Reward in Competitive Code Generationcited by 3
- 2026FlipFlop: A Static Analysis-based Energy Optimization Framework for GPU Kernelscited by 2
- 2025Energy-Aware Code Generation with LLMs: Benchmarking Small vs. Large Language Models for Sustainable AI Programmingcited by 1
- 2026CodeGreen: Towards Improving Precision and Portability in Software Energy Measurementcited by 1
- 2026Watts This Smell: A Comprehensive Taxonomy of Software Energy Smellscited by 1
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Energy Efficient Software Hardware CoDesign for Machine Learning: From TinyML to Large Language Models
- 2025GREEN-CODE: Learning to Optimize Energy Efficiency in LLM-based Code Generation
- 2026WarmTuner: Program-Specific Warm Starts for Compiler Autotuning via Offline-to-Online Reinforcement Learning ↗
- 2025Toward Green Code: Prompting Small Language Models for Energy-Efficient Code Generation
- 2026Cutting AI Datacenter Energy with Reinforcement Learning: Measured Power Control of LLM Training from One GPU to the Fleet
- 2026HLS-Seek: QoR-Aware Code Generation for High-Level Synthesis via Proxy Comparative Reward Reinforcement Learning
- 2026Reinforcement Learning for Code Optimization
- 2026TIPCODER: Reinforcement Learning Boosted Test-time Instruction Proposer for Code Generation