arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2607.04577cs.LGcs.SE
收藏

超越速度需求:通过模拟引导强化学习实现能源感知代码生成

Beyond the Need for Speed: Energy-Aware Code Generation via Simulation-Guided Reinforcement Learning

Dalhousie University(达尔豪斯大学)

Saurabhsingh Rajput, Tushar Sharma

AI总结:

研究针对代码模型忽视软件能源效率问题,用确定性架构模拟构建数据集,经监督微调与闭环强化学习训练能源感知代码模型,引入新指标评估,提升能源效率,揭示问题并开源数据,助力社区。

摘要:

代码模型严格优先考虑功能正确性,使软件能源效率成为未优化的副产品。训练生成节能代码的模型需要大规模可重现反馈,而物理硬件测量因方差无法可靠提供。本文用确定性架构模拟工具取代硬件分析,构建了Green Tea数据集。通过对能源对比对进行监督微调,然后使用闭环强化学习训练能源感知代码模型。为严格评估部署准备情况,引入了正确性调整后的能源总量减少(CARET)指标。在143个保留问题上,我们的闭环模拟管道实现了12.63%的CARET,几乎使单独微调的增益增加了两倍,并在58.4%的有效输出上成功超过了人类专家参考的能源效率。此外,我们的分析揭示了IPC陷阱:像每周期指令数(IPC)这样的标准吞吐量代理在67.8%的问题上积极错误地排列真正的能源效率,证明了直接能源模拟的绝对必要性。通过发布我们的数据集和基础设施,我们绕过了再现所需的263,000个CPU小时,从结构上增强了社区部署固有节能代码生成模型的能力。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑