Table of Contents
Fetching ...

Energy Considerations of Large Language Model Inference and Efficiency Optimizations

Jared Fernandez, Clara Na, Vashisth Tiwari, Yonatan Bisk, Sasha Luccioni, Emma Strubell

TL;DR

This work tackles the energy footprint of large language model inference by moving beyond latency-centric benchmarks to a workload-aware, hardware- and software-conscious analysis. It introduces a binning-based energy modeling approach to approximate real-world LLM workflows across diverse tasks, decoding strategies, and serving stacks, then validates this model with extensive experiments on multiple architectures and workloads. Key findings show that naive energy estimates based on FLOPs severely underestimate real-world consumption, while carefully applied optimizations can cut energy use by up to 73% in offline/real-world scenarios, with gains highly sensitive to workload geometry and hardware. The study provides practical guidance for sustainable LLM deployment and underscores the need for energy-conscious design in AI infrastructure.

Abstract

As large language models (LLMs) scale in size and adoption, their computational and environmental costs continue to rise. Prior benchmarking efforts have primarily focused on latency reduction in idealized settings, often overlooking the diverse real-world inference workloads that shape energy use. In this work, we systematically analyze the energy implications of common inference efficiency optimizations across diverse Natural Language Processing (NLP) and generative Artificial Intelligence (AI) workloads, including conversational AI and code generation. We introduce a modeling approach that approximates real-world LLM workflows through a binning strategy for input-output token distributions and batch size variations. Our empirical analysis spans software frameworks, decoding strategies, GPU architectures, online and offline serving settings, and model parallelism configurations. We show that the effectiveness of inference optimizations is highly sensitive to workload geometry, software stack, and hardware accelerators, demonstrating that naive energy estimates based on FLOPs or theoretical GPU utilization significantly underestimate real-world energy consumption. Our findings reveal that the proper application of relevant inference efficiency optimizations can reduce total energy use by up to 73% from unoptimized baselines. These insights provide a foundation for sustainable LLM deployment and inform energy-efficient design strategies for future AI infrastructure.

Energy Considerations of Large Language Model Inference and Efficiency Optimizations

TL;DR

This work tackles the energy footprint of large language model inference by moving beyond latency-centric benchmarks to a workload-aware, hardware- and software-conscious analysis. It introduces a binning-based energy modeling approach to approximate real-world LLM workflows across diverse tasks, decoding strategies, and serving stacks, then validates this model with extensive experiments on multiple architectures and workloads. Key findings show that naive energy estimates based on FLOPs severely underestimate real-world consumption, while carefully applied optimizations can cut energy use by up to 73% in offline/real-world scenarios, with gains highly sensitive to workload geometry and hardware. The study provides practical guidance for sustainable LLM deployment and underscores the need for energy-conscious design in AI infrastructure.

Abstract

As large language models (LLMs) scale in size and adoption, their computational and environmental costs continue to rise. Prior benchmarking efforts have primarily focused on latency reduction in idealized settings, often overlooking the diverse real-world inference workloads that shape energy use. In this work, we systematically analyze the energy implications of common inference efficiency optimizations across diverse Natural Language Processing (NLP) and generative Artificial Intelligence (AI) workloads, including conversational AI and code generation. We introduce a modeling approach that approximates real-world LLM workflows through a binning strategy for input-output token distributions and batch size variations. Our empirical analysis spans software frameworks, decoding strategies, GPU architectures, online and offline serving settings, and model parallelism configurations. We show that the effectiveness of inference optimizations is highly sensitive to workload geometry, software stack, and hardware accelerators, demonstrating that naive energy estimates based on FLOPs or theoretical GPU utilization significantly underestimate real-world energy consumption. Our findings reveal that the proper application of relevant inference efficiency optimizations can reduce total energy use by up to 73% from unoptimized baselines. These insights provide a foundation for sustainable LLM deployment and inform energy-efficient design strategies for future AI infrastructure.

Paper Structure

This paper contains 37 sections, 5 equations, 12 figures, 5 tables.

Figures (12)

  • Figure 1: Proper application of efficiency methods with optimized vLLM (orange) approaches the ideal energy consumption (green) as compared with an unoptimized baseline PyTorch (purple) implementation.
  • Figure 2: Controlled sweeps of input and output sequence lengths on A6000 GPUs, on vLLM backend, described in §\ref{['subsec:seqlen_results']}. We decompose inference costs into prefill and decode energy. At small batch sizes and input sequence lengths, energy intensity of a workload scales sub-linearly with increasing sequence length input sequence lengths. Decoding is more energy intensive per token than prefill, but energy intensity begins scaling linearly even for short generations and small batch sizes with the vLLM framework.
  • Figure 3: At small batch sizes, speculative decoding provides reduced latency and energy savings. At larger batch size speculative decoding increases energy.
  • Figure 4: Mixture-of-Experts LLMs require more energy than dense models with comparable active parameters; differences are pronounced at larger batch sizes.
  • Figure 5: Energy consumption comparison across different GPUs for inference with PyTorch and vLLM backends of 1024 samples for 64 output tokens. For each GPU, we compare PyTorch with and without compilation, and vLLM with and without CUDA Graph serialization. The line in black represents the maximum allowable batch size for PyTorch. Relative savings are most apparent in the low batch size regime and that vLLM due to its optimizations can serve a larger batch size.
  • ...and 7 more figures