From Tokens to Watt-hours: Analytical Energy Estimation for LLM Inference on Modern GPUs
This paper introduces an empirically calibrated, analytical methodology for estimating the energy consumption of LLM inference on NVIDIA H100 GPUs by decomposing workloads into compute and memory-traffic components, enabling transparent, reproducible energy assessments without requiring direct hardware measurement.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine the internet as a giant, bustling library where millions of people are constantly asking a magical librarian (an Artificial Intelligence) to write stories, solve math problems, or summarize news. For a long time, we only worried about how much "brainpower" this librarian needed to learn its tricks (training). But now, the librarian is working non-stop, answering millions of questions every day. This constant work uses a massive amount of electricity, which is bad for the planet. The big question for scientists and engineers is: "How much energy does it actually take to answer just one question?" The trouble is, measuring this energy directly is like trying to weigh a single grain of sand while it's being blown by a hurricane; you need special, expensive sensors and perfect conditions that most people don't have. Without a way to guess the energy cost, it's hard to know if one AI is "greener" than another or if a specific way of asking a question is wasting power.
This paper, titled "From Tokens to Watt-hours," offers a clever way to solve that puzzle without needing to plug in a power meter. The authors, a team of researchers from universities and tech companies, have built a mathematical "calculator" that estimates how much energy an AI uses just by looking at the size of the AI and the length of the conversation. Think of it like a nutrition label for AI: instead of counting calories, it counts "Watt-hours" (a unit of energy). They tested their calculator on powerful computer chips called NVIDIA H100s, which are the engines driving many of today's smartest AIs.
Here is how their calculator works, using a simple analogy. Imagine the AI is a chef in a kitchen. To cook a meal (generate an answer), the chef does two things: they read the recipe and gather ingredients (this is the "compute" part), and they run back and forth to the pantry to grab spices and tools (this is the "memory" part). The researchers found that for short orders, the chef mostly just cooks, so the energy cost is mostly about the cooking. But for long, complex orders, the chef has to run to the pantry so many times that the energy spent running around starts to dominate the bill.
The paper breaks down the energy cost into two main phases:
- The "Prefill" Phase: This is when the chef reads the customer's order (the input prompt). The energy cost here depends on how long the order is.
- The "Decode" Phase: This is when the chef writes the answer, word by word. The energy cost here depends on how long the answer is.
The researchers discovered that the energy cost isn't just about how big the AI is (how many "ingredients" or parameters it has). It also depends heavily on how long the conversation gets. They found that as the answer gets longer, the energy doesn't just go up in a straight line; it curves upward sharply. Why? Because every new word the AI writes requires it to look back at all the previous words to make sense of the story. It's like the chef having to re-read the entire recipe every time they add a new pinch of salt. The longer the recipe, the more running back and forth is needed, and the more energy is wasted.
Using their formula, the team calculated that a small AI (with about 0.3 billion parameters) uses very little energy, roughly 0.001 Watt-hours for a request. But a giant AI (with 120 billion parameters) uses a lot more—about 0.15 Watt-hours for the same task. They also showed that for a 70-billion-parameter model, their estimate was very close (within 5%) to real-world measurements taken by other scientists, proving their "calculator" is reliable enough to use when you can't measure the power directly.
The paper explicitly states that this tool is not a perfect replacement for measuring electricity with a meter. It doesn't count the energy used by the air conditioning, the internet cables, or the other computers in the data center. It only counts the energy used by the specific chip doing the thinking. However, the authors argue that this chip energy is the biggest part of the bill that engineers can control.
So, what does this mean for the future? The paper suggests that if we want to save energy, we shouldn't just try to make bigger AIs. Instead, we should try to make the "recipes" shorter (compressing the input), ask for shorter answers, or use smaller, specialized chefs for simple jobs. The authors hope this calculator will help developers compare different AI models and choose the ones that are more energy-efficient, helping to build a "greener" digital world without needing to install a power meter on every single computer.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.