LLM Inference Cost: Why Per-Token Price Tags Are Not the Whole Story
This article breaks down why the cheapest sticker price does not always mean the cheapest bill. It examines where cost savings actually come from across four layers—model architecture, linear attention, operator fusion, and the runtime scheduling layer—and shows how the same model can cut end-to-end task cost in half with only a runtime change. It closes with a practical framework for comparing inference services by cost per task rather than cost per million tokens.
Introduction: Two Sets of Numbers, Two Pricing Perspectives
In November 2026, one model service pushed its lightweight tier down to 1 RMB per million input tokens and 3 RMB per million output tokens. Over the same period, a comparable lightweight tier from another provider was priced at 2 RMB for input and 8 RMB for output during peak hours. Looking at the price tags alone, the first option is roughly two-thirds cheaper, and there is no obvious reason a developer would not open its documentation first.
But another set of numbers grows from a completely different direction: for the same model, simply swapping the runtime scheduling layer reduced the total cost of a 60-task real-world suite from 12 USD to 6 USD, with only a 4.2% increase in elapsed time. The cost score per unit went from 218 points/USD to 450 points/USD. Not a single model parameter changed, yet the bill looks completely different.
Put together, these two sets of numbers form the contradiction this article unpacks: the point where savings land is not the same. One price tag is denominated in tokens; the other is settled per task. Anyone who uses the former to compare against the latter will draw the wrong conclusion. Each layer below includes a reproducible example—no hand-waving.
Layer 1: The Price Tag Is Written into the Architecture
The first place a lightweight tier gets cheap is the model architecture. Take a sparse mixture-of-experts model as an example: 125B total parameters, with only about 6B activated per token, plus a 51B N-gram Embedding attached.
Sparse activation separates the “parameter pool” from the “compute per token”: the parameter pool determines how much the model can remember, while the activation volume determines how much compute a single inference pass requires. Context is computed the same way: 262,144 tokens natively, extended to 1 million via positional interpolation. Training cost dropped by nearly 90% compared with the previous generation, which the official account attributes to architectural and training-pipeline innovations—this saving is calculated, not subsidized.
But architecture only writes the theoretical discount. Real money is realized on the hardware.
Layer 2: Linear Attention Compresses O(L²) into O(L)
A reproducible example: in a 27B model with 64 layers, 48 layers use gated linear attention (GDN), with a per-sequence, per-layer state of 3.21 MB; the remaining 16 layers retain exact attention to handle tasks that require precise retrieval.
The value of GDN is not saving memory, but compressing standard attention’s O(L²) into O(L), saving the attention computation per token. The state size is fixed, so long sequences do not inflate the state; what it caps is the number of concurrent sequences, not the context length. This directly determines the throughput ceiling for long-context scenarios.
Layer 3: Operator Fusion Determines Hardware Utilization
The same linear attention still depends on operators to land on hardware. One team wrote the FlashQLA operator library in TileLang: prefill is split into two fused kernels with a context-parallel preprocessing step in between; inside each kernel, one producer warpgroup moves data while three consumer warpgroups compute V′, S, and O respectively; when shared memory is saturated, two consumers share one swap surface, using a count=4 mbarrier to signal “the previous round has been fully read.” On the same batch of Hopper and Blackwell cards, the forward pass is 2–3× faster and the backward pass is 2× faster.
Illustration (pseudocode, showing scheduling structure only):
# Prefill: two fused kernels + intermediate CP preprocessingkv = prefill_kernel_A(q, k, v) # producer moves data, consumer computes V'kv = cp_preprocess(kv) # context-parallel split and exchangeout = prefill_kernel_B(q, kv) # consumer computes S, O
Layer 4: The Runtime Is the Real Author of the Bill
Back to the 12 USD to 6 USD numbers. The model did not change; what changed was the runtime (a harness-type scheduling layer): batching strategy, KV cache reuse, speculative decoding, request coalescing, failure retries, and fallback paths. None of these change model capability, but they directly change “how many tokens it takes to complete a task.”
Conclusion: How to Compare Prices Without Capsizing
- Unify the unit: convert price tags into cost per task, not per million tokens.
- Look at effective tokens: cache hit rate, retry rate, and truncated context all cost money.
- Look at the runtime: with the same model, the optimization headroom in the scheduling layer is often larger than the unit-price gap.
- Build your own benchmark: run 50–100 real tasks end to end, recording elapsed time and total cost.
In practice with model services on platforms such as Baidu AI Cloud, the same recommendation applies: use task-level cost as the selection metric, and pair it with monitoring, alerting, and logging services for continuous recalculation, rather than looking only at the first line of the price sheet.
