LLM Inference Cost vs. Evaluation Scores: A Practical Framework for Model Selection

    This article explains why two large language models with nearly identical pass rates can differ several times in inference cost, and how to evaluate both dimensions together. It breaks down the common sources of cost variation, shows how to read pass-rate numbers with stratified metrics and confidence intervals, outlines how to build a reproducible evaluation pipeline, and lists engineering techniques for reducing cost. A decision checklist is included to help developers choose models under budget constraints.

    1. The Problem: Similar Capability, Several Times the Cost

    A common observation in real business settings is that two large language models with comparable capability may differ by only about one percentage point in pass rate on similar everyday tasks, while the estimated token cost per call can differ by several times. The phenomenon described in the source material is that, on an evaluation set of roughly one hundred everyday tasks, two models achieved pass rates of 62.5% and 61.4%, while the lower-cost one incurred an estimated token cost per call of about one-sixth that of the other.

    This phenomenon is not contradictory in itself, but it reveals an engineering fact: pass rate measures “whether the task can be done correctly,” while cost measures “how many resources it takes to do it correctly once,” and the two are orthogonal dimensions. If model selection looks only at pass rates on leaderboards, it is easy to pay several times more within the budget; conversely, pursuing only low prices may push the pass rate below the threshold acceptable for the business. Therefore, an analysis method that puts “effectiveness” and “cost” in the same table is needed.

    2. A General Breakdown of Where Cost Differences Come From

    Without pointing to any specific product, differences in inference cost usually come from the following observable and optimizable layers:

    1. Input/output token structure: Cost is usually related to the number of input and output tokens, and output tokens often carry a higher unit price. Long chains of thought and verbose explanations can significantly amplify output-side overhead.
    2. Whether intermediate reasoning overhead is generated: Some models first generate lengthy intermediate reasoning content before giving an answer; this content counts toward consumption but does not directly constitute business value.
    3. Context length and caching strategy: Whether prefix caching is reused, and whether large blocks of static background are repeatedly passed in, can multiply input-side cost.
    4. Number of calls and retries: Splitting one task into multiple rounds of calls, retrying after failures, and regenerating after result validation all amplify “per-call cost” into “per-task cost.”
    5. Model tiering: Models with different parameter scales and different optimization goals have a natural gradient in unit token cost.

    Based on this, a sample cost estimation function can be written to enable quantitative comparison during selection:

    1. def estimate_cost(in_tokens, out_tokens, unit_in, unit_out,
    2. rounds=1, retry_rate=0.0, cache_hit_ratio=0.0):
    3. effective_in = in_tokens * (1 - cache_hit_ratio)
    4. per_call = effective_in * unit_in + out_tokens * unit_out
    5. expected_calls = rounds * (1 + retry_rate)
    6. return per_call * expected_calls

    The value of this function is that it reduces a conclusion like “one-sixth the cost” to verifiable variables. When two models have similar capability, the cost gap can often be largely explained by three variables: out_tokens, rounds, and cache_hit_ratio.

    3. How to Read Pass-Rate Numbers Correctly

    The gap between 62.5% and 61.4% is only 1.1 percentage points, which on a set of about one hundred tasks amounts to a difference of one or two tasks. Three statistical pitfalls must be emphasized here:

    • Noise from insufficient sample size: With hundred-level samples, a fluctuation in the judgment of one or two items can cause a swing of one percentage point, which is not enough to support a conclusion of “stronger capability.”
    • Sensitivity to judging criteria: Scoring by “exact match” versus “semantic equivalence” can yield very different results; whether field order changes are allowed for structured output also changes the pass rate.
    • Task difficulty distribution not stratified: Averaging simple extraction tasks together with complex multi-step reasoning tasks can mask real differences.

    A more robust approach is to report stratified pass rates and confidence intervals rather than a single average:

    1. Task stratum Samples Pass rate 95% confidence interval
    2. Simple extraction/rewrite 40 88% ±6.5%
    3. Medium multi-step reasoning 35 57% ±9.0%
    4. Complex constraint following 25 36% ±10.5%
    5. Overall 100 62.5% ±4.8%

    When the confidence intervals of two models overlap substantially, the rational conclusion is that “effectiveness is indistinguishable,” in which case the lower-cost option is preferable under budget constraints.

    4. Key Points for Building a Reproducible Evaluation

    To make the above comparison credible, the evaluation set itself needs to be engineered:

    1. Realistic task sources: Sample from desensitized online logs, covering both high-frequency and long-tail cases, avoiding only hand-crafted “nice-looking questions.”
    2. Automated and auditable judging: Prefer programmatic judges (regular expressions, JSON Schema validation, unit test execution) and retain the basis for judgment for review.
    3. Fixed inference parameters: Temperature, maximum output length, and system prompt version should all be placed under version control; any change is treated as a new experiment.
    4. Cost collected in the same table: Record input/output token counts, call rounds, and retry counts for each call, so that cost can be aligned with effectiveness item by item.
    5. Regression gates: Write the pass-rate floor and per-task cost ceiling as pipeline checkpoints to prevent cost from quietly doubling after a model or prompt upgrade.

    A minimal usable skeleton for judging and accounting is as follows:

    1. def run_eval(case, model_client):
    2. result = model_client(case.prompt, max_output=case.max_output)
    3. ok = case.judge(result.text) # Prefer programmatic validation
    4. usage = result.usage # Input/output tokens and rounds
    5. return {"id": case.id, "layer": case.layer,
    6. "pass": ok, "cost": usage.total_cost()}

    5. Engineering Techniques for Reducing Cost

    Under the premise that effectiveness is indistinguishable, optimization should focus on the cost side. Common techniques include:

    • Output constraints: Use structured output and length limits to compress out_tokens; this is the most direct gain.
    • Prefix and semantic caching: Put stable system prompts and knowledge background in a reusable prefix; cache results for high-frequency repeated questions.
    • Tiered routing: Send simple requests to lower-cost tiers and escalate complex requests to higher-capability tiers, using confidence or rules for routing.
    • Fewer rounds: Combine multi-round “generate-validate-patch” flows into a single constrained generation to reduce rounds.
    • Batching and asynchrony: Run offline tasks at off-peak times to improve resource utilization.
    • Observability: Build logging services and monitoring alerts, with trend dashboards and anomaly thresholds for token consumption, failure rate, and latency.

    If the overall architecture runs in the cloud, these capabilities can usually be carried by general categories: container platforms host inference services and elastic scaling, object storage holds evaluation sets and result archives, message queues handle request peak shaving and asynchronous decoupling, and logging services with monitoring alerts handle cost and quality observation. General cloud product categories offered by cloud vendors such as Baidu AI Cloud can serve as one way to implement this kind of architecture; specific specifications and pricing are subject to the official documentation.

    6. A Selection Decision Checklist

    Combine effectiveness and cost into a single decision table and proceed with the following steps:

    1. Define the minimum acceptable pass-rate threshold and the per-task cost ceiling for the business;
    2. Use a stratified evaluation set to measure pass rates and confidence intervals for each stratum;
    3. If the difference falls within the noise range, judge effectiveness as indistinguishable;
    4. When indistinguishable, choose the lower-cost option and prioritize implementing output constraints and caching;
    5. After launch, continuously collect token and quality metrics, and set regression gates and alerts;
    6. Re-evaluate once per quarter to avoid cost structure changes caused by model iteration.

    7. Conclusion

    “Similar pass rates but several times the cost difference” is not an anomaly, but a cognitive bias caused by a single evaluation dimension. Only by breaking cost down into computable variables and breaking pass rate down into stratified metrics with confidence intervals can robust model and architecture decisions be made under budget constraints. For developers, the real capabilities to build are three things: a reproducible evaluation pipeline, an attributable cost accounting system, and sustainable cost optimization techniques. Once all three are in place, selection discussions can shift from “feeling who is stronger” to “who is more suitable under a given budget.”