LLM Inference Cost: Why the Price Per Million Tokens Is Not the Whole Story
Summary: Token-based pricing is only an entry metric; the real cost of LLM inference is settled per completed task. This article breaks down three layers behind the price tag—model architecture (sparse MoE activation, long-context trade-offs), hardware execution (linear and hybrid attention), and the runtime harness (prefix caching, batching, output control, retries)—and shows how the same model can halve task cost with no parameter changes. It also outlines a reproducible evaluation method and scenario-based selection advice so you compare cost per task instead of comparing stickers.
1. Two Price Tags That Get Misread
On a model service pricing page, the most common format is “input X per million tokens, output Y per million tokens.” In November 2026, one platform launched a lightweight tier priced at 1 for input and 3 for output; around the same time, another platform’s lightweight tier still cost 2 for input and 8 for output during peak hours. Looking at that single line, the former is roughly two-thirds cheaper, and any developer would open the cheaper vendor’s docs first.
But another set of numbers grows from a completely different direction: with the same model and the same parameters, swapping only the runtime (an execution framework in the Harness category) cut the total cost of a 60-task real-world suite from 12 USD to 6 USD, while total time increased by just 4.2% and the unit-cost score rose from 218 points per dollar to 450 points per dollar. Not a single model parameter changed, yet the bill looks entirely different.
Put these two sets of numbers side by side and you get the contradiction this article unpacks: the cheap spot is not the same spot. One price tag is denominated in tokens; the other is settled per task. Whoever uses the first to compare against the second will see their conclusion capsize.
2. First Layer of Difference: Cost Lives in the Model Architecture
The lightweight tier can cut prices for a first reason written into the model architecture. Take a sparse Mixture-of-Experts (MoE) model as an example: 125B total parameters, with only about 6B activated per token, plus roughly 51B of N-gram Embedding attached for fast hits on high-frequency fragments.
Sparse activation separates two things: the parameter pool determines how much the model can remember, while the activation volume determines how much compute a single inference requires. This explains a common confusion—why the unit price can be low even when total parameters are huge. You pay only for the portion of parameters that gets activated.
Context length is also a computed quantity: a native 262,144 tokens, extendable to the million-token range through position-interpolation methods such as YaRN. Long context is not free; it buys fewer retrieval hops and a simpler engineering structure, at the cost of attention compute and GPU memory usage.
Training-side costs are falling too. One generation of the lightweight model cost nearly 90% less to train than its same-family predecessor, and the vendor attributes this to innovations in architecture and the training pipeline. That money was engineered, not subsidized—and understanding this is how you judge whether a low price is sustainable.
3. Second Layer of Difference: Real Money Is Settled on the Accelerators
Architecture only writes down the theoretical discount; the actual bill is settled on the accelerator cards. Pick an example that can be recomputed: in a 27B model’s 64 layers, 48 layers use gated delta net-style linear attention (a GDN-class linear attention variant) with a per-sequence, per-layer state of about 3.21 MB; the remaining 16 layers keep exact attention to handle the part of the workload that needs precise retrieval.
Linear attention compresses standard attention from O(L²) to O(L). What it mainly saves is not GPU memory but the attention compute per token. The hybrid layer design is a compromise: the vast majority of layers trade linear complexity for throughput, while a few layers retain exact retrieval so that long-document QA and code-base retrieval do not suffer a capability collapse.
The direct implication for developers: under long context, the marginal cost curves of different architectures are completely different. Both may be labeled “1 per million tokens,” yet the actual spend at 30K input tokens versus 300K input tokens can differ by several times.
4. Third Layer of Difference: The Runtime Is the Dividing Line on the Bill
Back to those numbers where “parameters did not move and the bill halved.” Runtime optimization usually comes from four kinds of techniques:
- Prefix cache reuse: system prompts, tool definitions, and few-shot examples recur across multi-turn requests; once a cache hit occurs, that portion of input is no longer re-billed or recomputed.
- Batching and scheduling: concurrent requests are merged into batches to raise throughput per unit time and amortize fixed overhead; the peak versus off-peak price difference comes from exactly this.
- Output length governance: curb ineffective reasoning, compress redundant chain-of-thought, and replace long natural language with structured output, directly cutting the most expensive output tokens.
- Retry and fallback strategy: split “one long request” into “multiple short requests,” with timeouts and degradation paths, so long-tail requests do not drag down the whole group’s cost.
Illustrative pseudocode showing how a runtime turns “billed per token” into “controllable per task”:
def run_task(task, runtime):plan = runtime.plan(task) # Task decomposition to cut ineffective long outputctx = runtime.prefix_cache(plan) # Shared prefix hits the cachefor step in plan.steps:r = runtime.call(step, ctx=ctx, max_output=step.budget)if not r.ok:r = runtime.fallback(step) # Degrade to a cheaper tierctx = runtime.append(ctx, r)return runtime.verify(plan, ctx) # Result verification to avoid re-runs
With the same model wrapped in a runtime like this, halving total task cost is not surprising; people who compare only price tags will credit that gain to the model.
5. A Reproducible Evaluation Method: Break Cost Down Until It Reconciles
To keep conclusions from capsizing, evaluation must be reproducible. Fix four variables and move only one:
- Task set: pick 50–100 real business tasks covering short Q&A, long documents, code retrieval, and structured extraction.
- Measurement scope: record input tokens, output tokens, cache-hit tokens, request count, and end-to-end latency at the same time.
- Cost formula:
total cost = billed input × unit_price_in + billed output × unit_price_out + platform fixed overhead, with the cache-hit portion converted according to each vendor’s actual rules. - Metric: replace the bare unit price with “unit-cost score = task success rate / total cost,” and list P95 latency separately.
Only when “price per million tokens” is converted into “cost per completed task” do the two price tags become comparable for the first time.
6. Selection Advice: Choose by Scenario, Not by Price Tag
- High-concurrency short requests: the sparse-activation lightweight tier has a clear advantage; focus on output unit price and rate-limiting policy.
- Long documents and code bases: focus on marginal cost under long context and retrieval-layer design; a hybrid attention architecture is more stable.
- Cost-sensitive batch processing: invest in the runtime and cache reuse first; the payoff often beats switching models.
- Compliance and stability first: wire general cloud capabilities such as monitoring and alerting, log auditing, and message-queue peak shaving into the pipeline, using engineering means to absorb long-tail cost.
The conclusion is simple: the unit price is an entry metric; task cost is the settlement metric. Break things apart across three layers—architecture, runtime, and evaluation scope—and you will not use one price tag to dismiss another.
