arXiv:2608.17515cs.SEcs.AI2026-08

用能耗模型替代FLOPs,让代码大模型更省电高效

Beyond FLOPs: Energy-Aware Knowledge Distillation for Sustainable LLMs on Code-Related Task

  • 用能耗代理模型直接优化蒸馏过程,不依赖传统FLOPs指标
  • 模型推理能耗降低90%,内存减少86%,精度损失小
  • 适合在手机等低资源设备上部署代码类大模型

大型语言模型(LLMs)在软件工程任务中应用日益广泛,如克隆检测、漏洞预测和代码摘要,虽精度高但计算开销大、能耗高,制约其在消费级硬件和资源受限平台的应用。现有文献与工业界普遍使用浮点运算量(FLOPs)衡量模型计算成本。本文通过基于多目标优化的蒸馏方法Morph,实证检验了FLOPs是否能准确反映能耗。研究扩展该方法,引入直接估算CPU/GPU能耗的能耗代理模型,并应用于CodeT5+进行代码摘要的生成任务。结果表明,FLOPs并非可靠的能耗指标;采用能耗代理模型可显著提升效率。蒸馏后的学生模型在克隆检测和漏洞预测任务中,推理能耗降低最高达90%,内存使用减少86%,精度仅小幅下降。

原文摘要 · Abstract (English)

Background: Large Language Models (LLMs) are increasingly being applied to Software Engineering (SE) tasks, achieving high accuracy across problems such as clone detection, vulnerability prediction, and code summarization. However, their high computational demands and energy consumption raise sustainability concerns and hinder their use on consumer hardware and resource-constrained platforms. A common way to report the computational cost of an LLM in the literature and industry is to use the number of Floating Point Operations (FLOPs) required to perform a pass over the network. Aims: This paper investigates the implications of energy-aware knowledge distillation for SE, aiming to improve model efficiency while maintaining performance and to determine whether FLOPs is a reliable energy-aware metric. Method: We conduct a controlled experiment using Morph, a Many-Objective Optimization-based distillation methodology, to empirically examine whether FLOPs accurately reflect energy consumption in Clone Detection and Vulnerability Prediction tasks. We extend this methodology to include energy-surrogate models that directly estimate CPU and GPU energy consumption during optimization, and we apply Morph to generative tasks using CodeT5+ for code summarization. Results: Our results show that FLOPs is not always a reliable indicator of energy consumption, and better results can be achieved by using energy-surrogate models. Distilled student models can reduce inference energy consumption by up to 90\% and memory usage by 86\%, with only modest accuracy trade-offs. Conclusions: Energy-aware knowledge distillation when guided by direct energy surrogates rather than FLOPs can improve the energy consumption, sustainability, and deployability of LLMs for SE applications, enabling efficient models on consumer hardware.

知识蒸馏能耗优化代码生成可持续AI

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。