A Practical Guide to Measuring LLM Inference Energy Consumption and Cost

    This guide explains how to measure large language model (LLM) inference energy consumption and translate it into cost, starting from a simple question: how many tokens can one kilowatt-hour produce. It walks through the assumptions, the output-side and input-side energy calculations, a sample price conversion, and a sensitivity analysis showing why ranges matter more than single-point numbers. It also covers what drives long-term cost declines and practical recommendations for developers. All figures are illustrative assumptions used to demonstrate the calculation logic.

    1. Why Start Cost Analysis with a Single Kilowatt-Hour

    As large language models move into large-scale deployment, the way teams discuss cost is shifting. The default view has been the procurement lens: dollars per million tokens. But judging whether a technical approach is sustainable over the long term requires going back to the physical layer, meaning the relationship between compute, power draw, and output.

    Using “how many tokens does one kilowatt-hour produce” as the starting point has a clear advantage: it links the bill, chip power consumption, data center efficiency, and model throughput into a single chain. Any change in any link can then be quantified and tracked.

    This chain can be expressed as an identity: energy output per unit = effective power ÷ energy per token, where energy per token is itself determined by per-card throughput. As long as the assumptions are stated clearly, anyone can reproduce the calculation and swap in real parameters from their own workload. The method below is complete, but every number is an illustrative assumption meant to demonstrate the calculation logic. None of them represent the real specifications of any specific product.

    2. Step 1: Measure How Many Tokens One Kilowatt-Hour Produces

    2.1 Define the Scenario and Boundaries

    Any measurement must declare its scenario first, or the numbers are meaningless. The typical scenario here is large-batch offline inference, with the hardware assumed to be a single high-power accelerator card and the facility’s overall overhead taken into account.

    Key assumptions:

    • A single card draws about 700 W. Adding cooling, networking, storage, and management node overhead, the facility’s power usage effectiveness (PUE) is estimated at 1.3, which works out to roughly 900 W of effective power.
    • For large-batch inference, aggregate output speed per card is conservatively taken as 1,000 tokens per second, with a fluctuation range of 500 to 3,000.
    • Only the output-side decode phase is counted; the input-side prefill phase is calculated separately.

    2.2 Deriving Output-Side Energy Consumption

    An effective power of 900 W equals 900 joules consumed per second. If the system produces 1,000 output tokens per second, then:

    1. Energy per token = 900 J/s ÷ 1000 token/s = 0.9 J/token
    2. 1 kWh = 3,600,000 J
    3. Output tokens per kWh ≈ 3,600,000 ÷ 0.9 ≈ 4 million tokens

    The result is intuitive: under the given assumptions, one kilowatt-hour corresponds to roughly four million output tokens. Note that it is extremely sensitive to throughput. Double the throughput, and energy per token is halved while output doubles.

    2.3 Why the Input Side Is Completely Different

    The prefill phase is a highly parallel matrix operation with high compute utilization, and aggregate throughput per card is typically well above the decode phase. Here it is illustratively taken as 10,000 tokens per second, corresponding to about 0.09 J per token, or roughly 40 million input tokens per kilowatt-hour. This distinction matters: in long-context scenarios where input makes up a large share, the actual energy structure per request differs from intuition.

    3. Step 2: Convert Energy into Dollars

    Using illustrative prices of $50 per million output tokens and $10 per million input tokens:

    • Output side: 4 million tokens × $50/million ≈ $200 per kWh;
    • Input side: 40 million tokens × $10/million ≈ $400 per kWh;
    • Blended at the common industry 3:1 input-to-output token ratio, the combined figure is roughly $250 to $300 per kWh, or about RMB 1,800 to 2,200.

    It must be stressed that this is a “selling price” measure, not a “cost” measure. It captures how much the current price is marked up relative to physical energy consumption, not the vendor’s real gross margin. Conflating the two is the most common mistake in this kind of discussion.

    4. Sensitivity Analysis: Ranges Matter More Than Point Values

    A single-point number is easy to misread. The more reliable engineering practice is to give a range. Four variables drive the result:

    1. Aggregate throughput per card: affected by batch size, sequence length, and parallelism strategy, with swings of several times;
    2. Facility PUE: a clear gap between older data centers and newly built liquid-cooled ones;
    3. Hardware power draw and utilization: idle time, waiting, and communication overhead all reduce effective compute;
    4. Input-to-output ratio: long-document summarization and short Q&A have completely different energy structures.

    Weighing all of this uncertainty, a reasonable range is roughly $100 to $800 per kWh, or about RMB 700 to 6,000. The width of the range is close to eightfold, which shows that any “precise conclusion” must come with its assumptions, or it is unusable.

    5. What the Energy Curve Says About Price and Market Evolution

    Extending the framework above along the time axis yields three inferences.

    First, cost decline is driven by three curves working together: gains in compute per watt, data center efficiency improvements, and inference engineering optimizations (continuous batching, paged attention, quantization, speculative decoding, prefix reuse, and so on). Combined, they steadily reduce the physical resources behind the same selling price.

    Second, when the selling price is well above the energy-derived value, the market holds excess profit, which attracts new supply, and price moves toward cost. This is a general rule of competitive markets, regardless of how many vendors there are.

    Third, falling prices reshape application boundaries. Scenarios previously suppressed by cost, such as long-context analysis, batch document processing, and high-frequency code-related calls, scale up quickly, and the resulting demand growth further dilutes fixed costs.

    6. Practical Recommendations for Developers

    • Build your own measurement sheet, with power draw, PUE, throughput, and input-to-output ratio as adjustable parameters, and re-run the calculation on every selection decision;
    • Budget by input-to-output ratio rather than unit price, and model long-context workloads separately;
    • Treat cache reuse, batching, distilling smaller models, and tiered task routing as standard optimization practices;
    • Keep the architecture able to switch among multiple models, using a unified gateway for routing and fallback, to avoid being locked to a single price curve;
    • Invest in observability: use monitoring, alerting, and logging services to collect real token consumption, turning cost from an estimate into verifiable data.

    7. Conclusion

    “How many tokens does one kilowatt-hour produce” is an analytical tool that connects physical constraints with commercial pricing. It cannot predict whether a particular vendor will succeed, but it does show that, with compute efficiency and engineering optimization continuing to advance, inference prices trend downward over the long run, and a closed-source model that relies only on pricing power rather than efficiency and experience faces mounting pressure. For consumers, the real capability is not memorizing a number, but mastering this reproducible framework whose assumptions can be swapped out.