Search papers, labs, and topics across Lattice.
This paper investigates the effectiveness of energy-aware knowledge distillation in improving the efficiency of Large Language Models (LLMs) for software engineering tasks, specifically focusing on clone detection and vulnerability prediction. The study reveals that using energy-surrogate models provides a more accurate assessment of energy consumption than traditional FLOP metrics, leading to distilled models that can reduce inference energy consumption by up to 90% and memory usage by 86% with only modest accuracy trade-offs. These findings highlight the potential for more sustainable deployment of LLMs on consumer hardware, addressing significant concerns regarding their computational demands and energy usage.
Energy-aware knowledge distillation can slash inference energy consumption by up to 90%, challenging the reliability of FLOPs as a metric for sustainability in LLMs.
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.