Token Efficiency: The Real Driver of LLM Inference Costs

    This article explains why two large language models with similar benchmark scores can produce very different bills, and why unit price alone is a poor selection criterion. It covers how total versus activated parameters work in sparse mixture-of-experts models, how billable tokens break down into input context, reasoning, and final output, and how token efficiency forms a second cost curve. You will find formulas for per-task cost and effective cost ratio, four observable metrics for measuring token efficiency, a reproducible task-level cost measurement process, and a practical optimization checklist covering context governance, prompt compression, reasoning budgets, tiered routing, caching, batching, and output constraints.

    1. Where the Problem Starts: Benchmarks Converge, Bills Do Not

    A common pattern has emerged in the industry: two models with nearly identical capability scores on a public “intelligence index” can differ substantially in real invocation cost. Many teams compare only two things during selection — leaderboard scores and the price per million tokens — and then discover after launch that their budget has been amplified by token consumption in the inference stage.

    The situation can be abstracted into a general rule: model capability is determined by “base model + post-training,” while the bill is determined by “unit price × token usage.” These two chains do not overlap, so “capability parity” does not imply “cost parity.”

    From an engineering perspective, the billable tokens for a single request usually consist of three parts:

    • Input context: system prompts, conversation history, retrieved passages, tool return values;
    • Reasoning: the intermediate reasoning content the model generates before producing an answer (if the product bills generated tokens, this is counted as output);
    • Final output: the answer the user actually sees.

    What drives cost up is usually not the user-visible answer, but the repeatedly accumulated context and the lengthy reasoning process.

    2. Reading Parameter Counts Correctly: Total vs. Activated Parameters

    In sparse (mixture-of-experts) architectures, two numbers must be read separately:

    • Total parameters: determine the model’s capacity ceiling, memory and storage overhead, and deployment barrier;
    • Activated parameters: determine the compute per forward pass and the actual compute consumed per inference.

    The comparison described can be abstracted as: Model A has roughly 753 billion total parameters and about 40 billion activated; Model B has roughly 2.8 trillion total parameters and about 104 billion activated. Model A is significantly smaller on both metrics, yet achieves the same benchmark score.

    This leads to a key conclusion: optimization in the post-training stage (data mixture, preference alignment, reasoning behavior shaping, tool-calling training, and so on) can unlock substantial latent capability without enlarging the base model. For consumers, this means models with “small activated parameters + strong post-training” are usually friendlier in terms of throughput, concurrency, and deployment flexibility. Note, however, that small activated parameters do not automatically mean low token consumption; the two are governed by different mechanisms.

    3. Token Efficiency: The Undervalued Second Cost Curve

    The core observation is that Model A averages about 41K reasoning tokens per task, while Model B averages about 25K. Plugging both unit price and usage into the calculation, Model A costs about $0.68 per task and Model B about $0.84 — a gap that narrows to roughly 19%, even though the difference in token unit prices is far larger than that.

    The formulas make this clearest:

    1. cost per task = (input tokens × input price + output tokens × output price) / 1e6
    2. token efficiency = tokens required to complete the task / unit of effective output
    3. effective cost ratio = cost per task / task success rate

    What should really be compared during selection is the effective cost ratio, not the token unit price. A cheaper but more verbose model may lose its entire advantage in long-context, multi-turn tool-calling scenarios; conversely, a model with a higher unit price that gets it right in one pass may be cheaper for batch offline workloads.

    In engineering practice, it helps to break token efficiency into four observable metrics:

    1. Reasoning redundancy: reasoning tokens / output tokens;
    2. Context inflation rate: actual input tokens / theoretical minimum context;
    3. Retry amplification factor: total tokens consumed / tokens of the first request;
    4. First-pass task rate: the proportion of tasks completed without retries.

    Illustrative instrumentation code:

    1. record = {
    2. "task_id": task_id,
    3. "input_tokens": usage["prompt_tokens"],
    4. "output_tokens": usage["completion_tokens"],
    5. "reasoning_tokens": usage.get("reasoning_tokens", 0),
    6. "retry_count": retry_count,
    7. "passed": passed, # determined by evaluation cases or rule checks
    8. }
    9. # effective cost = cumulative cost / number of passed tasks, not cost per single request

    4. A Reproducible Method for Cost Estimation

    Teams should build a task-level cost table with fields for task type, average input tokens, average output tokens, reasoning share, retry count, pass rate, cost per task, and effective cost. The measurement process is as follows:

    1. Build a regression set of 50–200 real business samples (not public leaderboard questions);
    2. Fix the system prompt and context-trimming strategy to avoid contaminating variables;
    3. Record the full usage and validation result of every request;
    4. Compute the effective cost ratio and observe the inflection point of the curve at different context lengths;
    5. Re-measure every quarter, because model version updates change token efficiency.

    5. Token Efficiency Optimization Checklist

    • Context governance: rerank and deduplicate retrieved passages, keeping only segments relevant to the current sub-question;
    • Prompt compression: turn lengthy instructions into structured fields and remove repeated constraints;
    • Reasoning budget control: set stricter reasoning length limits for simple tasks and loosen them for complex ones;
    • Tiered routing: let small-activated-parameter models handle high-frequency simple requests, with a high-capability model as fallback for hard problems;
    • Cache reuse: apply prefix caching to stable prefixes (system prompts, knowledge base segments) to reduce repeated input billing;
    • Batching and asynchrony: schedule offline tasks off-peak to improve output per unit cost;
    • Output constraints: use structured output (such as strict JSON schemas) to reduce invalid generation and retries caused by parsing failures.

    6. Conclusion

    Benchmark scores provide a capability reference; the budget depends on token efficiency. Faced with phenomena like “a small-activated-parameter model matching a model with far larger parameters,” the correct reading is not a simple “which one is stronger,” but rather: capability unlocked by post-training is compressing the gap in parameter scale, while inference token consumption has become the new primary cost variable. Bringing cost per task and effective cost ratio into the selection baseline is what keeps technical choices aligned with financial budgets. If an enterprise wants to apply these methods on Baidu AI Cloud, it can combine a container platform to host inference services, logging services and a monitoring and alerting system to collect token usage, and object storage to accumulate evaluation samples, forming a sustainable, reusable cost governance loop.