paperbot · PL 论文追踪

全部论文 待读 收藏

P2 When Faster Isn’t Greener: The Hidden Costs of LLM-Based Code Optimization

当更快并不更环保:基于LLM的代码优化的隐藏成本
ASE 2025 40th IEEE/ACM International Conference on Automated Software Engineering (ASE)2025匹配度 3/10 · 论文评估LLM代码优化的能耗与性能权衡,属于LLM在PL中的应用,但与用户核心关注的静态分析、形式化验证、浮点/贝叶斯程序分析无直接关联;研究目标也非改进静态分析工具,而是评估LLM自身能耗代价。引用 0 inbox
Tristan Coignion, Clément Quinton, Romain Rouvoy
crossref: 2026-09-12

AI 速览

一句话:系统评估基于大语言模型的代码优化在性能、正确性与能耗间的权衡,并提出盈亏平衡点指标。

论文研究基于大语言模型(LLM)的代码优化是否真的节能。针对LLM自身能耗高、已有工作只看运行时性能的缺口,作者以能耗为中心,使用EvalPerf基准的118个任务,评估多个LLM家族和优化方法在性能、正确性与能耗上的权衡,并提出盈亏平衡点(BEP),量化优化程序需执行多少次才能抵消生成优化所耗能量。结果发现,部分配置可显著加速并降低运行能耗,但需数百至数十万次执行才在能量上划算;优化还常产生错误或更低效代码。性能增益与实际节能呈弱负相关,说明更快不一定更环保,提示应面向高频高影响负载并监测全生命周期能耗。

问题
LLM被广泛用于代码优化,但生成优化本身能耗高,尚不清楚其性能收益能否抵消能耗成本。
方法
以EvalPerf的118个任务为基准,对多LLM家族和多优化方法进行能耗导向评估,并提出BEP指标量化执行次数阈值。
评估
评估性能、正确性与能耗的权衡;发现节能需数百至数十万次执行,且性能增益与节能弱负相关,常出现错误或更低效代码。
原文摘要(Abstract)

Large Language Models (LLMs) are increasingly adopted to optimize source code, offering the promise of faster, more efficient programs without manual tuning. This capability is particularly appealing in the context of sustainable computing, where enhanced performance is often assumed to correspond to reduced energy consumption. However, LLMs themselves are energy- and resource-intensive, raising critical questions about whether their use for code optimization is energetically justified. Prior work mainly focused on runtime performance gains, leaving a gap in our understanding of the broader energy implications of LLM-based code optimization.In this paper, we report on a systematic, energy-focused evaluation of LLM-based code optimization methods. Relying on 118 tasks from the EvalPerf benchmark, we assess the trade-offs between code performance, correctness, and energy consumption of multiple optimization methods across multiple families of LLMs. We introduce the Break-Even Point (BEP) as a key metric to quantify the number of executions required for an optimized program to outweigh the energy consumed when generating the optimization itself.Our results show that, while certain configurations achieve substantial speedups and energy reductions, these benefits often demand from hundreds to hundreds of thousands of executions to become energetically profitable. Moreover, the optimization process often yields incorrect or less efficient code. Importantly, we identify a weak negative correlation between performance gains and actual energy savings, challenging assumptions that faster code automatically equates to a smaller energy footprint. This work underscores the necessity of energy-aware optimization strategies. Practitioners should carefully target LLM-based optimization efforts to high-frequency, high-impact workloads, while monitoring energy consumption across the entire life-cycle of development and deployment.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot9385,
  title = {When Faster Isn’t Greener: The Hidden Costs of LLM-Based Code Optimization},
  author = {Tristan Coignion and Clément Quinton and Romain Rouvoy},
  booktitle = {ASE},
  year = {2025},
  doi = {10.1109/ase63991.2025.00139}
}