LLM Inference Cost Evaluation: Why a Higher Token Price Can Still Be More Cost-Effective

    Comparing per-token list prices across model generations often leads to the opposite conclusion about which option is cheaper. This article explains why the real metric is cost per unit of effective output, factoring in throughput, first-pass success rate, and tail latency rather than sticker price. It walks through the cost formula, the hidden costs that price comparisons miss, a repeatable benchmarking method, and tier-based routing that turns cost optimization into an architecture decision.

    1. Where the Problem Starts: Why Unit Price Comparisons Reach Opposite Conclusions

    When a new model generation arrives, the most common discussion is whether the new version is more expensive because its list price is several times that of the previous generation. This comparison often reaches opposite conclusions because it compresses an end-to-end engineering problem into a single-dimension price comparison. The real cost of inference is never just one number, “dollars per million tokens.” It is the total resource overhead required to complete a business task, including queueing, failed retries, repeated context transmission, and manual rework.

    The core argument of the original discussion can be reduced to one sentence: when a new generation delivers significantly higher per-unit output throughput and a higher effective task completion rate, the cost per unit of effective output can drop even if the list price is higher. The rest of this article breaks that sentence into a verifiable calculation.

    2. Converting Price into Cost per Unit of Effective Output

    Let the list price be the price per token, throughput be the number of tokens that can be stably generated per second, and let a task require a certain number of input and output tokens, with a success rate equal to the share of tasks that pass on the first attempt. What should actually be compared is:

    1. cost per unit of effective output = (input tokens × input price + output tokens × output price)
    2. ÷ (task success rate × effective delivered tokens)

    This formula makes three points. First, the output side is usually more expensive than the input side, so improvements in output speed have greater leverage on the bill. Second, the success rate sits in the denominator: one failure means rerunning the task, which effectively doubles the cost. Third, if you are forced to split tasks or shorten context to fit a low-throughput tier, the effective delivered tokens fall and cost rises as well.

    An illustrative comparison (the numbers only demonstrate the algorithm and do not represent any real product):

    Option Output price (relative) Stable output throughput First-pass rate Cost per unit of effective output
    Previous generation, standard tier 1.0 Baseline Baseline Baseline
    Previous generation, high-speed tier ~2.0 Noticeably higher Slightly higher Close to baseline
    New generation, mid tier 2.5 Several times higher Noticeably higher Below baseline

    The conclusion is not mysterious: when throughput and success rate improve at the same time, a 2.5x list price is diluted by a larger denominator. This is also why “if you want to compare, compare against the previous generation’s high-speed tier” is sound engineering practice. What users actually buy is never the list price, but the usable output stably delivered per unit of time.

    3. Why Throughput Translates Directly into Cost

    In self-hosted or rented compute scenarios, cost is roughly equal to the time you occupy compute resources. Generation is memory-bandwidth intensive: every step of the output phase moves all model weights and the context cache, so output speed largely determines output per unit of time. Substituting this into the cost model:

    1. self-hosted unit cost ≈ compute price × occupancy time ÷ output tokens

    Halving occupancy time is equivalent to halving the compute bill, regardless of list price. In hosted scenarios, billing is per token, but higher throughput brings two indirect benefits: requests finish faster, connections and concurrency slots are released sooner, and the concurrency quota and retry budget needed to complete the same business volume both decrease.

    4. Hidden Costs Masked by Unit Price

    Comparing only unit prices misses four categories of spending that, in high-concurrency workloads, often exceed the price difference itself.

    • Queueing and timeouts: when throughput is insufficient, requests pile up in the queue, tail latency rises, and upstream timeouts and retries are triggered. Retries are pure loss.
    • Repeated context billing: retransmitting long context repeatedly to cut latency causes input tokens to be billed multiple times.
    • Task-splitting overhead: splitting a long task into segments to fit a low-throughput tier requires re-explaining background between segments, increasing total tokens.
    • Quality rework: a low first-pass rate means manual review, second-pass generation, and ticket handling, and the labor cost far exceeds the token cost.

    5. A Reusable Selection and Benchmarking Method

    Treat model selection as a small, quantifiable benchmark rather than a judgment based on feel.

    1. Build an evaluation set from real business samples covering three typical workloads: long context, structured output, and multi-turn tool calls.
    2. Fix concurrency and input distribution, then measure time to first token, stable output throughput, tail latency, and first-pass rate for each option.
    3. Calculate cost per unit of effective output using the formula above instead of recording list prices.
    4. Observe failure modes: truncation, format violations, or logic errors. Different failure modes imply different retry strategy costs.
    5. Establish a baseline, then decide whether to upgrade tiers.

    Illustrative benchmark pseudocode:

    1. def evaluate(cases, concurrency=32):
    2. total_tokens, ok, latencies = 0, 0, []
    3. for case in cases: # real business samples
    4. r = call_model(case.prompt, case.ctx)
    5. total_tokens += r.input_tokens + r.output_tokens
    6. latencies.append(r.first_token_ms)
    7. ok += int(r.passed) # first-pass criterion
    8. cost = total_tokens / max(ok, 1) # cost per unit of effective output
    9. return {"cost": cost, "p95_ttft": p95(latencies), "pass_rate": ok / len(cases)}

    6. Tier-Based Routing: Turning Cost Optimization into Architecture

    The mature approach is not a global either/or choice, but routing by task difficulty: requests that are difficult, involve long chains, require strict formatting, or need tool calls go to the more capable tier, while short tasks such as extraction, rewriting, and classification go to a lightweight tier. Combined with semantic caching, result reuse, and streaming output, average cost can be reduced further.

    1. request → difficulty assessment (length / needs tools / structured)
    2. ├─ simple → lightweight tier + cache first
    3. └─ complex → flagship tier + streaming output + strict mode constraints

    On the cloud, you can use a message queue to smooth peaks, a container platform to run inference services with elastic scaling, object storage to keep evaluation sets and results, and logging plus monitoring and alerting to observe tail latency and failure rates, forming a closed loop. Baidu AI Cloud offers standardized, categorized components for these general capabilities; refer to the official documentation for specific billing and quotas.

    7. Conclusion

    The list price multiple is just a number on paper; what determines the bill is the cost per unit of effective output. To judge whether a new flagship is expensive, look at whether throughput, first-pass rate, and tail latency improve together, and verify with a benchmark on real samples. When all three improve, a higher list price may actually be the more cost-effective choice for the current period. Conversely, if the workload is mostly short tasks with relaxed quality requirements, a lightweight tier plus cache routing is usually the optimal cost solution.