The Price of Prompting: Profiling Energy Use in Large Language Models Inference

Erik Johannes Husom, Arda Goknil, Lwin Khin Shar, Sagar Sen
7/4/2024
cs.CYcs.AIcs.CL

No official code found. Best implementation: ejhusom/MELODI (17 stars, last commit 2025-12-08).

Abstract

In the rapidly evolving realm of artificial intelligence, deploying large language models (LLMs) poses increasingly pressing computational and environmental challenges. This paper introduces MELODI - Monitoring Energy Levels and Optimization for Data-driven Inference - a multifaceted framework crafted to monitor and analyze the energy consumed during LLM inference processes. MELODI enables detailed observations of power consumption dynamics and facilitates the creation of a comprehensive dataset reflective of energy efficiency across varied deployment scenarios. The dataset, generated using MELODI, encompasses a broad spectrum of LLM deployment frameworks, multiple language models, and extensive prompt datasets, enabling a comparative analysis of energy use. Using the dataset, we investigate how prompt attributes, including length and complexity, correlate with energy expenditure. Our findings indicate substantial disparities in energy efficiency, suggesting ample scope for optimization and adoption of sustainable measures in LLM deployment. Our contribution lies not only in the MELODI framework but also in the novel dataset, a resource that can be expanded by other researchers. Thus, MELODI is a foundational tool and dataset for advancing research into energy-conscious LLM deployment, steering the field toward a more sustainable future.

View on arXivView PDF

Code Implementations(1)

ejhusom/MELODICommunity100%

Use local Large Language Models (LLMs) while monitoring energy usage.

170Python, Jupyter NotebookMar 7, 202410 months ago
energy-consumptiongenerative-aigreen-aillmmachine-learning+1 more

Similar Papers

Cite this paper

@article{husom2024price,
  title  = {The Price of Prompting: Profiling Energy Use in Large Language Models Inference},
  author = {Erik Johannes Husom and Arda Goknil and Lwin Khin Shar and Sagar Sen},
  year   = {2024},
  eprint = {2407.16893},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.16893v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2407.16893.svg)](https://codeofpaper.com/paper/2407.16893)

Discussion