LLM Inference Cost Evaluation: Why a Higher Per-Token Price Can Still Lower Your Bill

    A higher per-million-token price does not necessarily mean higher LLM inference costs. This article explains why comparing list prices across service tiers leads to wrong conclusions, and how to evaluate cost per unit of effective output instead. It covers aligning comparisons by tier, context length, and latency constraints, a quantitative cost model linking throughput to required concurrency, hidden savings and hidden costs, a five-step evaluation workflow, and architecture-level optimizations such as tiered routing, batching, caching, observability, and elastic scaling.

    1. The Problem: Why “More Expensive Per Token” Often Leads to the Wrong Conclusion

    Once large model applications move into production, one of the most common debates within a team is whether a new generation of inference services is out of control on cost, because its per-million-token price is clearly higher than that of the previous flagship generation, sometimes by several times. Feedback from frontline users in the source material points to a counterintuitive conclusion: the actual bill is lower instead. The reason lies not in the unit price, but in a substantial increase in output throughput and concurrency capacity.

    The root of this disagreement is the comparison basis. The unit price is the price per unit of billing volume, while what a business actually buys is effective output per unit of time. When generation speed increases several times, the compute resources needed for the same volume of user requests are occupied for a significantly shorter time, and the billing volume drops accordingly. Benchmarking the standard tier of the new generation against the fastest tier of the previous generation is a cross-tier comparison, and the conclusion is bound to be distorted.

    2. Establishing the Right Comparison Basis

    2.1 Shift from Unit Price to Cost per Unit of Effective Output

    It is recommended to standardize on the following metric:

    1. Cost per unit of effective output = unit price / (effective output tokens × success rate)
    2. Effective output tokens = total output tokens × (1 - retry rate) × effective content ratio

    The “effective content ratio” is used to exclude output that is malformed, truncated, or requires manual rework. In engineering practice, retry rate and rework rate are often overlooked hidden costs, and they directly amplify real spending.

    2.2 Align on the Same Tier

    The comparison must be built on the same service tier, the same context length range, and the same output length distribution. Different tiers differ markedly in throughput, concurrency quota, and scheduling priority, and mixing them will produce the opposite conclusion.

    2.3 Introduce Latency Constraints

    For interactive applications, time to first token and tokens per second determine user experience, and also determine whether additional scaling is needed. The benefit of higher throughput often shows up as “meeting the same latency target with fewer instances.”

    3. Quantitative Breakdown of the Cost Model

    Let the daily request volume be Q, the average output length be L, the service price be P (per million tokens), and the sustainable throughput per instance be T (tokens/second). Then:

    1. Daily billing volume ≈ Q × (input tokens + L) / 1,000,000
    2. Daily model cost = daily billing volume × P
    3. Required concurrency ≈ Q × L / (T × 86400 × target utilization)

    The key is the third formula: when throughput T increases n times, the required concurrency and instance count drop to roughly 1/n of the original. When the application also carries the overhead of supporting resources such as gateways, orchestration, vector retrieval, and logging, these savings are amplified.

    Illustrative comparison (values only demonstrate the structure of the model and are not real product data):

    Option Unit Price Index Relative Throughput Relative Instances Relative Total Spend
    Previous generation, standard tier 1.0 1.0 1.00 1.00
    Previous generation, fastest tier 2.0 1.6 0.63 1.26
    New generation, standard tier 2.5 3.5 0.29 0.73

    Even with a unit price of 2.5x, total spend still goes down as long as the throughput gain exceeds the price increase. A cross-tier comparison, by contrast, conflates “a more expensive unit price” with “a more expensive tier.”

    4. Easily Overlooked Hidden Savings and Hidden Costs

    Hidden savings include a lower retry rate, less duplicate billing caused by timeouts, shorter batch job windows, lower peak demand for elastic scaling, and reduced human waiting time.

    Hidden costs include input token inflation from growing context length, redundant prompts, increased log and monitoring data volume, and insufficient cache hit rates. Engineering can suppress this growth through prompt trimming, structured output constraints, semantic caching, and result reuse.

    5. A Practical Evaluation Workflow

    1. Sample: extract a representative request distribution from production logs, covering input and output lengths, peak hours, and failed retries.
    2. Normalize: align tiers and context ranges, and remove incomparable samples.
    3. Load test: measure sustainable throughput and the concurrency ceiling under the target latency constraint.
    4. Calculate: plug the numbers into the cost model and output the cost per unit of effective output.
    5. Canary: validate quality and stability with a small traffic share running in parallel, then ramp up gradually.
    1. def effective_cost(price_per_mtok, out_tokens, retry_rate=0.0,
    2. rework_rate=0.0, throughput_ratio=1.0):
    3. """Estimate the cost per unit of effective output; throughput_ratio converts the concurrency resource overhead"""
    4. valid = out_tokens * (1 - retry_rate) * (1 - rework_rate)
    5. if valid <= 0:
    6. return float("inf")
    7. return (price_per_mtok / 1_000_000) / valid / throughput_ratio

    6. Supporting Optimizations at the Architecture Level

    • Tiered routing: send simple requests to a lightweight tier and complex reasoning to a high-performance tier, avoiding the use of a high-cost channel for all traffic.
    • Batching and asynchrony: run offline jobs off-peak to improve utilization.
    • Caching: combine exact caching with semantic caching to reduce repeated generation.
    • Observability: instrument token consumption, latency, and retries in the logging service and monitoring/alerting system to build a cost dashboard.
    • Elastic scaling: have the container platform scale based on queue length and time-to-first-token metrics rather than keeping a fixed number of instances running.

    If you use the relevant general capabilities of Baidu AI Cloud, you can feed the instrumentation data above into the logging service and monitoring/alerting, and use object storage for long-term archival, so that costs can be continuously accounted for by business dimension.

    7. Conclusion

    A higher unit price is not by itself a sufficient condition for higher cost. There is only one standard for judging whether something is worth it: whether the cost per unit of effective output drops under the same latency and quality constraints. Only by aligning the comparison basis to the same tier and the same length distribution, and by bringing throughput, retry rate, and supporting resources into the model, can you reach a reliable conclusion.