Why LLM Inference Costs Are Not Just About Token Price

    Token price is only one factor in LLM inference cost. This article breaks the bill down into input, reasoning, and output tokens, task success rate, and retries, then shows how a four-step method and engineering optimizations help teams compare models by effective cost per task rather than price per million tokens.

    1. The Problem: A Cheaper Token Price, but a Barely Smaller Bill

    As model capabilities iterate quickly, teams usually compare two tables when choosing a model: a capability leaderboard and the price per million tokens. Multiplying the two often produces a counterintuitive result: a model with a unit price several times lower may cut the bill for the same set of real tasks by less than 20%.

    A recent evaluation update illustrates the gap. A model with roughly 753 billion total parameters and 40 billion active parameters raised its overall capability index from 53 to 60, matching a larger model with about 2.8 trillion total parameters and 104 billion active parameters. Its input and output prices were about $1.40 and $4.40 per million tokens, versus about $3.00 and $15 for the larger model. On paper, the first model was more than half as cheap. Per task, however, it cost about $0.68 versus about $0.84, narrowing the gap to roughly 19%.

    Almost all of that leakage comes from inference token efficiency: the first model consumed about 41K tokens per task on average, including reasoning and final output, while the second used about 25K. The core argument of this article is this: the token unit price is only one factor in the cost formula. What really determines the bill is the product of the total tokens needed to complete a task and the price per token.

    2. First Principles of Cost: Breaking the Bill into Computable Factors

    The cost of any model call can be written as a simple formula:

    1. Cost per task = (input tokens + reasoning tokens + output tokens) × corresponding unit price
    2. Effective cost = cost per task / task success rate

    This formula highlights three often-overlooked facts:

    1. Reasoning tokens are billed. When a model reasons before answering, the intermediate chain is charged on the output side, and a long chain directly inflates the bill.
    2. Success rate is a hidden multiplier. If a cheaper model has a low first-pass rate, retries can cancel out the savings or even reverse them.
    3. The input side has room for caching and reuse. Repeated prefixes such as system prompts, long documents, and code context can significantly reduce repeated charges in inference services that support prefix caching. This is an engineering optimization, though, and should not be counted as part of the model’s inherent capability.

    To judge whether a model is cost-effective, you therefore need to put it back into the token distribution of a specific task rather than compare price sheets in the abstract.

    3. Total Parameters vs. Active Parameters: Why a Smaller Model Can Match a Larger One

    Total parameters determine the upper limit of a model’s knowledge capacity, while active parameters determine the compute for a single forward pass. A mixture-of-experts architecture decouples the two. A configuration with about 753 billion total parameters and 40 billion active parameters matched one with 2.8 trillion total parameters and 104 billion active parameters on the overall capability index, showing that capability does not scale linearly with parameter count.

    Three general patterns combine behind this:

    • Data quality and data mixture often deliver higher marginal returns than simply adding parameters.
    • Post-training (supervised fine-tuning, preference alignment, reinforcement learning on verifiable tasks) can squeeze more out of the base model, adding a few points to the capability index without changing the base.
    • Inference-time compute (a longer reasoning chain) can substitute for some parameter capacity, trading tokens for capability.

    The third point is the root of the cost gap: capability bought with tokens ultimately gets paid for on the bill.

    4. The Underrated Variable: Inference Token Efficiency

    Token efficiency means the total number of inference tokens consumed to complete the same task. It is driven by three factors:

    1. Chain-of-thought length tendency: some models repeatedly verify and enumerate branches, producing longer chains.
    2. Output redundancy: explanatory text, repeated restatement, and formatting noise all add output tokens.
    3. Failure retry rate: rerunning a failed attempt is the most expensive waste.

    In practice, a simple estimation script can support a side-by-side comparison (illustrative):

    1. def task_cost(input_tok, think_tok, output_tok, p_in, p_out):
    2. # Unit price: USD per million tokens
    3. return (input_tok * p_in + (think_tok + output_tok) * p_out) / 1e6
    4. # High unit price, short chain
    5. a = task_cost(6000, 15000, 10000, 3.00, 15.0)
    6. # Low unit price, long chain
    7. b = task_cost(6000, 30000, 11000, 1.40, 4.40)
    8. print(round(a, 3), round(b, 3))

    Plug in the token distribution of real tasks and you get the effective cost instead of being led by the price sheet.

    5. Methodology: Build Your Own Cost per Unit of Intelligence in Four Steps

    1. Build a task set: sample 20–50 real business requests covering short Q&A, long documents, code generation, and structured extraction, and record the input length distribution.
    2. Collect the three token counts: measure input, reasoning, and output tokens separately rather than only total output.
    3. Factor in success rate and retries: measure the first-pass rate and include retry cost in the denominator.
    4. Calculate effective cost and rank: use effective cost per capability score as the selection metric, not unit price.

    Illustrative table structure:

    Candidate model Capability index Average total tokens Cost per task First-pass rate Effective cost
    Candidate A (small active) 60 41K 0.68 0.95 0.72
    Candidate B (large active) 60 25K 0.84 0.97 0.87

    6. Cost Reduction on the Engineering Side

    • Prefix caching: place system prompts and fixed context at the front and reuse the computed results.
    • Context trimming: control the number of retrieved items and snippet length in retrieval-augmented generation.
    • Output constraints: use structured output and length limits to suppress redundancy.
    • Tiered routing: send simple requests to a small model and complex requests to a large one.
    • Asynchronous batching: merge requests for offline tasks to improve throughput and spread cost.
    • Observability: attribute token consumption by task through logging services and monitoring alerts.

    In the cloud, these capabilities are typically provided by common categories such as container platforms, object storage, message queues, and monitoring and alerting. Baidu AI Cloud’s related product portfolio can be combined along these lines.

    7. Conclusion

    “Matching” is a conclusion about capability; “19% cheaper” is a conclusion about cost. The two do not conflict; they answer different questions. For developers, the right approach is to first check whether capability meets the bar, then measure total tokens and effective cost on a real task set, and finally use engineering techniques to compress redundancy. As token efficiency becomes a new competitive dimension, the core selection question has shifted from “whose unit price is lower” to “who gets the job done with fewer tokens”.