Evaluating LLM Inference Costs: Why a Higher Unit Price Doesn't Always Mean Higher Cost

    This article presents a reusable framework for comparing inference costs across model generations. It explains why comparing per-million-token prices alone leads to contradictory conclusions, introduces four common service tiers that must be aligned before comparison, and shows how to convert unit price into cost per million tokens of effective output using a first-pass acceptance rate. It also covers the hidden costs of throughput, latency, and retries, outlines a reproducible benchmarking method with fixed inputs and decoding parameters, and takes a total cost of ownership view that includes prompt maintenance, evaluation sets, caching, batching, and tiered routing. The conclusion: judge cross-generation value by business output and your own test data.

    1. The Core Problem: Why Unit-Price Comparisons Reach Opposite Conclusions

    “The new flagship model costs 2.5x more per token than the previous generation. Is it actually more expensive?” This question reliably splits any comment thread into two camps. The reason isn’t that one side did the math wrong. It’s that the two sides aren’t comparing the same quantity. Unit price is the cost per million tokens, but what you actually pay for is a unit of work: one successful code completion, one acceptable API document, one round of refactoring suggestions that passes review.

    A representative argument from the original discussion: in practice the new generation feels cheaper, because its output speed at the mid-tier is far higher than the previous generation’s. Compare it against the previous generation’s high-speed tier rather than its standard tier, and the cost advantage is obvious. Abstracted, this is a general engineering principle: when comparing models across generations, align them to the same service level (throughput plus latency) first, then convert to the same unit of business output.

    This article doesn’t focus on any specific product. Instead, it turns this kind of debate into a reusable evaluation framework.

    2. Align the Billing Basis First: Four Common Model Tiers

    Model services across generations and vendors can usually be abstracted into four categories. Mixing them is the most common comparison error:

    • Standard tier: default throughput and latency, lowest unit price;
    • High-speed tier: higher unit price in exchange for higher output rate and more stable tail latency;
    • Mid tier: sits between the two, usually the cost-performance sweet spot;
    • Lightweight tier: built for low-complexity tasks such as classification, extraction, and rewriting.

    The correct approach is to compare like tier with like tier. Multiplying the new generation’s standard-tier price by the previous generation’s high-speed-tier output will inevitably distort the conclusion.

    3. Convert Unit Price into Cost per Million Tokens of Effective Output

    Let a tier’s input price be $P{in}$ and output price be $P{out}$ (in CNY per million tokens), with $T{in}$ input tokens and $T{out}$ output tokens. The cost of a single call:

    1. C_call = (T_in * P_in + T_out * P_out) / 1_000_000

    But what the business cares about is effective output, which requires a first-pass acceptance rate $q$ (the share of generations adopted without manual rework):

    1. C_effective = C_call / q

    This formula explains many “it feels cheaper” observations. If the new generation raises the first-pass acceptance rate from 0.6 to 0.85, then even at 2.5x the unit price, the effective cost is only 2.5 * 0.6 / 0.85 ≈ 1.76 times the original. If output tokens also drop 30% thanks to more concise responses, it falls further to roughly 1.23x. Fewer reworks from better quality often determine the bill more than the unit-price gap does.

    4. Throughput and Latency: The Hidden Cost Masked by Unit Price

    In interactive scenarios (AI coding tools, conversational customer support, real-time summarization), users perceive time-to-first-token and output rate. An order-of-magnitude increase in output rate means longer generations fit within the same human waiting budget, and fewer timeout retries.

    Retry cost is often overlooked and can be estimated as:

    1. C_total = N_request * C_call * (1 + r) + C_infra

    where $r$ is the timeout/failure retry rate and $C_{infra}$ is the infrastructure overhead for the orchestration, gateway, caching, and other components that carry the pipeline. If the high-speed tier cuts $r$ from 8% to 1%, the savings at high traffic volume are often more than just model fees.

    5. A Reproducible Benchmarking Method

    Don’t trust any “much faster” claim you haven’t tested yourself. Build a minimal benchmark set with fixed inputs and fixed decoding parameters, changing only the model tier:

    1. import time, statistics
    2. def bench(call_fn, prompts, repeat=3):
    3. rows = []
    4. for p in prompts:
    5. for _ in range(repeat):
    6. t0 = time.perf_counter()
    7. text, usage = call_fn(p)
    8. dt = time.perf_counter() - t0
    9. rows.append({
    10. "chars": len(text),
    11. "sec": dt,
    12. "in": usage["input_tokens"],
    13. "out": usage["output_tokens"],
    14. })
    15. out_tokens = sum(r["out"] for r in rows)
    16. return {
    17. "p50_latency": statistics.median(r["sec"] for r in rows),
    18. "tokens_per_sec": out_tokens / sum(r["sec"] for r in rows),
    19. "cost": sum(r["in"] * 0 + r["out"] for r in rows), # substitute actual unit prices
    20. }

    Four metrics are worth fixing: output rate (tokens/s), time-to-first-token P50/P95, first-pass acceptance rate, and cost per thousand effective outputs. The test set must cover the input-length distribution of your real workload. Long-context scenarios in particular can’t be evaluated with short samples only.

    6. The Total Cost of Ownership View

    Beyond call fees, also account for: the maintenance cost of prompts and context engineering, the cost of result validation and evaluation-set construction, the discount room from caching and batching, and the log-retention overhead tied to compliance and auditing. Common engineering cost-reduction tactics include:

    • Apply context caching to high-frequency repeated prefixes to cut repeatedly billed input;
    • Use the lightweight tier for routing and pre-filtering, sending only hard problems to the flagship tier;
    • Batch offline tasks, trading throughput for price;
    • Build an offline evaluation set to quantify whether “more expensive” really means “more accurate.”

    7. Decision Checklist

    1. Determine whether the task is interactive or offline batch;
    2. Align service tiers before comparing unit prices;
    3. Estimate effective cost with first-pass acceptance rate, not unit price;
    4. Stress-test tail latency and retry rate;
    5. Run a small-traffic canary and regress the model against real data;
    6. Build tiered routing so cost scales with difficulty.

    8. Conclusion

    A “2.5x unit price” is not by itself grounds for judging expensive or cheap. When a new flagship leads on output throughput, tail latency, and first-pass acceptance rate at the same time, the cost per unit of effective output is often flat or even lower. Conversely, if the workload is offline, tolerates high latency, and has modest quality requirements, staying on a lower tier is the more rational choice. There is only one conclusion: measure in units of business output and let your own test data be the standard, and only then does cross-generation price comparison mean anything. If you need elastic compute to carry stress-test and canary traffic, you can build a rollback-capable evaluation pipeline on top of general cloud capabilities such as container platforms and monitoring/alerting.