LLM Inference Energy and Cost Estimation: How Many Tokens per kWh?
This article breaks down a first-principles method for estimating large language model inference energy consumption and unit economics, starting from effective per-GPU power and aggregate output throughput. It explains why decoding and prefill have very different energy efficiency, how to convert energy use into revenue per kWh under neutral assumptions, and which correction factors and structural drivers shape the cost curve. Readers will find a reusable parameterized script and practical recommendations for capacity and pricing decisions.
LLM Inference Energy and Cost Estimation: How Many Tokens per kWh?
1. Why “Tokens per kWh” Deserves a Real Calculation
When teams discuss model rankings and benchmark scores, they often overlook a question that determines long-term commercial viability: how much useful output does a given unit of compute actually return? Reduced to the most basic physical quantity, that question becomes “how many tokens can one kilowatt-hour generate.” It connects three layers of decision-making:
- Infrastructure: rack power, cooling capacity, and power redundancy determine how many accelerators can be deployed.
- Serving: batch size, context length, and the input-to-output ratio determine actual throughput.
- Business: the gap between the price per token and the cost per token determines whether the business is sustainable.
This kind of estimation is not precise accounting; it is an order-of-magnitude judgment. Its value lies in quickly spotting assumptions that are off by an order of magnitude, so that product and capacity planning are not built on the wrong price band.
2. First Principles of Energy Estimation
2.1 Start from Effective Power
The starting point is not the chip’s nominal power rating but the effective power amortized to a single GPU. Nominal power covers only the compute core, while a real cluster also carries network switching, storage, CPU-side preprocessing, and cooling. The industry commonly uses PUE (Power Usage Effectiveness), the ratio of total data center energy to IT equipment energy; 1.3 is a common design target.
If a single GPU is rated at about 700 W, applying a PUE of 1.3 gives an effective power of roughly 900 W, or about 900 joules per second.
2.2 Bring In Aggregate Output Throughput
The second key variable is the aggregate output speed of a single GPU in real serving: the number of output tokens produced per second after continuous batching merges multiple requests on the same GPU. This value depends on model architecture, context length, memory bandwidth, and scheduling policy. A conservative estimate is about 500, a neutral estimate about 1000, and an aggressive one can reach 3000.
Energy per token is then:
E_token = P_effective / T_out= 900 J/s ÷ 1000 token/s= 0.9 J/token
One kilowatt-hour equals 3.6×10⁶ joules, so:
Tokens_per_kWh = 3,600,000 ÷ 0.9 ≈ 4,000,000 token/kWh
Under neutral assumptions, one kilowatt-hour produces about four million output tokens.
2.3 Why the Input Side Is Completely Different
The prefill stage processes prompts. It is highly parallel matrix multiplication with high arithmetic intensity and good parallelism, so aggregate throughput per GPU is typically an order of magnitude higher than in decoding; 10,000 token/s is not aggressive, corresponding to about 0.09 J/token and roughly forty million input tokens per kilowatt-hour.
There is an engineering fact that is often ignored: decoding is autoregressive token by token and constrained by memory bandwidth, so its energy efficiency is naturally lower than prefill. The input-to-output ratio is therefore not a billing detail but a core parameter of the efficiency model.
3. From Energy to Dollars: Unit Economics
Assume an output price of USD 50 per million tokens and an input price of USD 10 per million tokens. Under neutral assumptions:
Output side: 4,000,000 × 50 / 1,000,000 = USD 200/kWhInput side: 40,000,000 × 10 / 1,000,000 = USD 400/kWh
With a typical input-to-output ratio of 3:1, the blended figure is roughly USD 250 to 300 per kilowatt-hour. Accounting for throughput uncertainty (the 500 to 3000 token/s range), a reasonable band is about USD 100 to 800 per kilowatt-hour.
The meaning of this result is not that electricity is expensive, but that the value of the output corresponding to current prices is far above its physical cost. In other words, today’s prices still contain a large premium that has not yet been absorbed by scale effects and architectural optimization.
4. Turning the Estimation into a Reusable Tool
Make the assumptions explicit parameters instead of hard-coding estimates into a document:
def tokens_per_kwh(p_card_w=700, pue=1.3, t_out=1000, t_in=10000):p_eff = p_card_w * pue # Effective power in Wkwh_j = 3.6e6 # Joules in one kWhreturn kwh_j / (p_eff / t_out), kwh_j / (p_eff / t_in)def revenue_per_kwh(price_out=50, price_in=10, in_out_ratio=3, **kw):out_tok, in_tok = tokens_per_kwh(**kw)out_rev = out_tok / 1e6 * price_outin_rev = in_tok / 1e6 * price_in * in_out_ratioreturn out_rev, in_rev
Three correction factors also need to be added in practice. First, batching efficiency loss: long contexts and low concurrency can significantly reduce aggregate throughput. Second, cache hit rate: prefix reuse reduces repeated prefill. Third, wasted compute from failed retries and timeouts. Without these three, estimates tend to be optimistic.
5. Structural Factors That Shape the Cost Curve
- Scale effects: larger batches and higher utilization directly dilute fixed per-token overhead, and this is the primary driver of continued price declines.
- Architectural efficiency: sparsification, quantization, speculative decoding, prefix caching, and similar techniques all essentially increase the number of useful tokens per joule.
- Context strategy: a higher input share improves overall efficiency, so retrieval augmentation and context reuse are both quality and cost questions.
- Elastic scheduling: under tidal load patterns, whether idle compute can be shifted to offline batch processing sets the ceiling on resource utilization.
When deploying on the cloud, you can combine a container platform for elastic inference, object storage for models and corpora, a message queue for smoothing request spikes, and logging plus monitoring and alerting for observability and capacity warnings. Baidu AI Cloud offers standardized, cataloged components for these general capabilities; refer to the official documentation for specific specifications and pricing.
6. Conclusions and Actionable Recommendations
“One kilowatt-hour yields about four million output tokens” is a useful anchor, but it holds only under neutral assumptions. The executable approach is to turn power, PUE, aggregate throughput, input-to-output ratio, and cache hit rate into a parameter table, recompute continuously with a unified script, and compare the result against price to obtain the safety margin of the unit economics.
Three recommendations for teams: first, measure aggregate throughput before discussing cost, since single-request latency is not a valid basis for capacity; second, incorporate the input-to-output ratio into product design and pricing design; third, support decisions with order-of-magnitude ranges rather than single-point numbers. When physical cost is far below price, the focus of competition shifts from model benchmark rankings to unit-cost engineering capability, which is the most realistic driver of long-term changes in the landscape.
