Table of Contents
Fetching ...

Green Prompting

Marta Adamska, Daria Smirnova, Hamid Nasiri, Zhengxin Yu, Peter Garraghan

TL;DR

Green Prompting investigates how prompt design and semantic content affect energy consumption in LLM inference. The authors deploy three open-source 7B transformers across three tasks, building an experimental framework with ZEUS/NVML energy measurements to quantify energy vs. response length, prompt length, and task semantics. They find response length is the primary predictor of energy, while prompt length is less influential; task type and keywords significantly shape energy use, enabling suggestions for energy-efficient prompting and energy-adaptive LLMs. The work provides a practical framework for measuring and optimizing inference energy in real-world LLM deployments and identifies concrete factors (semantic meaning, keywords, output length) to guide greener AI.

Abstract

Large Language Models (LLMs) have become widely used across various domains spanning search engines, code generation, and text creation. However, a major concern associated with their adoption is the high cost of inference, impacting both their sustainability and financial feasibility. In this study, we empirically study how different prompt and response characteristics directly impact LLM inference energy cost. We conduct experiments leveraging three open-source transformer-based LLMs across three task types$-$question answering, sentiment analysis, and text generation. For each inference, we analyzed prompt and response characteristics (length, semantic meaning, time taken, energy consumption). Our results demonstrate that even when presented with identical tasks, models generate responses with varying characteristics and subsequently exhibit distinct energy consumption patterns. We found that prompt length is less significant than the semantic meaning of the task itself. In addition, we identified specific keywords associated with higher or lower energy usage that vary between associated tasks. These findings highlight the importance of prompt design in optimizing inference efficiency. We conclude that the semantic meaning of prompts and certain task-related keywords significantly impact inference costs, leading the way for deeper exploration towards creating energy-adaptive LLMs.

Green Prompting

TL;DR

Green Prompting investigates how prompt design and semantic content affect energy consumption in LLM inference. The authors deploy three open-source 7B transformers across three tasks, building an experimental framework with ZEUS/NVML energy measurements to quantify energy vs. response length, prompt length, and task semantics. They find response length is the primary predictor of energy, while prompt length is less influential; task type and keywords significantly shape energy use, enabling suggestions for energy-efficient prompting and energy-adaptive LLMs. The work provides a practical framework for measuring and optimizing inference energy in real-world LLM deployments and identifies concrete factors (semantic meaning, keywords, output length) to guide greener AI.

Abstract

Large Language Models (LLMs) have become widely used across various domains spanning search engines, code generation, and text creation. However, a major concern associated with their adoption is the high cost of inference, impacting both their sustainability and financial feasibility. In this study, we empirically study how different prompt and response characteristics directly impact LLM inference energy cost. We conduct experiments leveraging three open-source transformer-based LLMs across three task typesquestion answering, sentiment analysis, and text generation. For each inference, we analyzed prompt and response characteristics (length, semantic meaning, time taken, energy consumption). Our results demonstrate that even when presented with identical tasks, models generate responses with varying characteristics and subsequently exhibit distinct energy consumption patterns. We found that prompt length is less significant than the semantic meaning of the task itself. In addition, we identified specific keywords associated with higher or lower energy usage that vary between associated tasks. These findings highlight the importance of prompt design in optimizing inference efficiency. We conclude that the semantic meaning of prompts and certain task-related keywords significantly impact inference costs, leading the way for deeper exploration towards creating energy-adaptive LLMs.

Paper Structure

This paper contains 7 sections, 4 figures, 2 tables.

Figures (4)

  • Figure 1: Diagram of framework designed to conduct the experiments.
  • Figure 2: Energy consumption measured during inference for each model and task.
  • Figure 3: Scatter plots representing energy usage in relation to response length measured in tokens.
  • Figure 4: Scatter plots representing energy usage in relation to prompt length measured in tokens.