Evaluating LLM Reasoning Ability and Optimizing Token Costs: A Practical Guide

    Choosing an LLM is rarely just about benchmarks or price lists. This article proposes evaluating reasoning capability and token economics together, under a single budget constraint. It covers how to split capability into four measurable dimensions, how to test reasoning with questions that have no readily available reference answers, and how to build a scorecard that scores correctness, citation authenticity, formatting, chain-of-thought efficiency, and stability. On the cost side, it explains why input price, cache-hit input price, and output price behave differently, gives a language-agnostic cost function, and shows how to convert unit prices into a per-task cost that accounts for first-pass success rate. It then details practical savings levers—prompt layering for prefix caching, output constraints, tiered routing between low-cost and high-capability models, and observability—along with seven common evaluation pitfalls and a pre-launch checklist for both capability and cost.

    1. Where the Problem Starts: Why “Can It Do This?” and “Can We Afford It?” Must Be Evaluated Together

    Discussion of any new model in the community usually splits into two camps within minutes: one says “the quality is good,” the other says “we can’t afford it.” These two verdicts look opposed, but they are two sides of the same engineering question—how much capability you get per unit of effective output within a given budget.

    Judging by quality alone leads you to treat an occasional impressive answer as a stable capability. Judging by price alone leads you to ignore the hidden cost of “cheap, but it takes three rounds of rework.” A mature evaluation puts both on the same table: capability determines whether a task can be closed end to end, while cost determines whether the approach can scale.

    This article follows the order capability evaluation → cost modeling → cost reduction techniques → common pitfalls, and closes with a checklist you can apply directly.


    2. Capability Evaluation: Turning “Smart” into Measurable Dimensions

    2.1 Layer capabilities first, then compare models

    “Which model is stronger?” is an unanswerable question until you fix the task type. In practice, split capability into four categories and build a separate evaluation set for each:

    Capability dimension Typical tasks What to observe
    Logical reasoning and mathematical proof Theorem proving, combinatorial counting, constraint solving Whether the derivation is self-consistent; whether it reasons in circles
    Code and engineering comprehension Cross-file refactoring, defect localization, migration and modernization Whether it runs; whether it introduces regressions
    Long-context handling Contract review, literature surveys, log root-cause analysis Recall of key information; accuracy of citation location
    Generation and writing Report drafting, style rewriting Structural completeness; factual consistency

    Comparing models from different tiers on a single yardstick usually produces meaningless conclusions. The same model can show completely different performance curves under a “concise” versus a “long chain-of-thought” reasoning style. Some models keep short chains, reach conclusions directly, and write in a style close to human prose, which suits content production. Others produce extremely long chains with dense intermediate steps, which suits hard mathematics and complex code, at the cost of higher latency and higher output cost.

    2.2 Use questions that have no answer to copy

    The most effective way to evaluate reasoning ability is to pick propositions the model cannot have copied an answer to from its training data. A workable approach is to select conclusions whose proofs are not yet widely collected, drawn from public mathematics repositories, research literature, and open problems outside competitions, and then ask the model to produce the proof.

    Three design points matter:

    1. Explicit constraints. Require original derivation rather than restatement of an existing proof; specify the output language and formatting explicitly.
    2. Verifiable citations. Require every cited lemma to be attributed to a source, then check each one for actual existence. Fabricated citations (hallucinations) are the most sensitive indicator of whether a model is genuinely reasoning.
    3. Prefer decidable questions. Favor propositions whose truth value is known but whose proof path is not widely collected; only then can you distinguish “guessed correctly” from “proved correctly.”

    2.3 The scorecard: turning subjective impressions into structured scores

    Score every question on the following dimensions (1–5), sample multiple times, and track both mean and variance—the variance is itself an important signal:

    • Correctness: whether the conclusion is right and whether the derivation contains logical leaps;
    • Citation authenticity: whether cited lemmas, theorems, and references are real and verifiable;
    • Formatting compliance: whether layout, numbering, and symbol definitions are standard enough to deliver as-is;
    • Chain-of-thought efficiency: the intermediate steps and output token volume needed to reach the correct conclusion;
    • Stability: the pass rate across five repeated samples of the same prompt.

    “Chain-of-thought efficiency” is routinely overlooked, yet it directly determines cost. Given the same question, one model reaches the correct answer with 3,000 output tokens and another with 12,000; in scaled scenarios the former’s unit cost is an order of magnitude lower.


    3. Cost Modeling: The Four Numbers That Actually Drive the Bill

    3.1 Unit price is not cost

    Usage-based pricing typically includes three rates: input price, output price, and cached input price. Their ratio has a clear engineering explanation:

    • Output is more expensive, because decoding is autoregressive—every generated token requires a complete forward pass and cannot be parallelized;
    • Cache hits are cheaper, because the intermediate state of that prefix (the attention key-value cache) is already reused and the repeated computation is skipped. But what is saved is computation, not storage and scheduling overhead.

    So the real structure of a bill looks closer to:

    1. total cost = input tokens × input price
    2. + cached tokens × cached-input price
    3. + output tokens × output price
    4. + hidden cost of retries and failed calls

    3.2 Settling the account with one cost function

    The following language-agnostic pseudocode is for side-by-side estimates during model selection. All unit prices are illustrative values; use the official pricing page of your platform for real numbers.

    1. function estimate_cost(input_tokens, cached_tokens, output_tokens, price):
    2. # price = {in, cache_in, out} unit: $ per 1M tokens
    3. cost = (input_tokens - cached_tokens) / 1_000_000 * price.in
    4. cost += cached_tokens / 1_000_000 * price.cache_in
    5. cost += output_tokens / 1_000_000 * price.out
    6. return cost
    7. # Illustrative prices: in=8, cache_in=1.3, out=68 ($/1M tokens)
    8. # One long-context task: input 60,000 (of which 52,000 cached), output 2,000
    9. c = estimate_cost(60000, 52000, 2000, {in: 8, cache_in: 1.3, out: 68})
    10. # ≈ (8000×8 + 52000×1.3 + 2000×68) / 1e6 ≈ $0.268

    Once you plug the three numbers into the formula, you usually reach a counterintuitive conclusion: in long-context tasks, output cost often accounts for only 10%–30% of the total, and the cache hit rate on the input side is the dominant variable on the bill. An improvement that raises the hit rate from 20% to 80% frequently pays off far more than switching to a cheaper model.

    3.3 Convert to “cost per task,” not “cost per token”

    A price list cannot guide model selection on its own; it has to be converted into business terms:

    1. cost per task = avg input tokens × input price
    2. + avg output tokens × output price
    3. ÷ first-pass rate (1 / avg retries)

    Dividing by the first-pass rate is the critical step. A model whose unit price is 40% lower but whose first-pass rate is only 60% can end up more expensive in practice than a model with a higher price and a 95% pass rate. Agent-style scenarios are even more sensitive: in multi-step tasks, an error at any step triggers retries and rollbacks, and the cost amplifies multiplicatively.

    3.4 The hybrid account: subscription quotas plus pay-as-you-go

    Many teams hold both a subscription plan (fixed fee plus a periodic quota) and pay-as-you-go channels. The correct calculation here is marginal cost:

    • Calls inside the quota have zero marginal cost and should be allocated first to high-value offline batch work—bulk code refactoring, documentation and training material generation, evaluation set construction, historical data cleanup;
    • When the quota is about to expire, use it for one-off heavy jobs (such as backfilling comments across an entire repository) rather than burning it on low-value repetitive Q&A;
    • Calls beyond the quota have a marginal cost equal to the pay-as-you-go rate, so switch to a low-cost model or apply a fallback/degraded path.

    Worth flagging: quotas, rate limits, and queueing are also a cost. Queue time during peak hours translates into human waiting cost, which is especially damaging for interactive products. Availability, rate-limiting policy, and the recoverability of long-running tasks should therefore be evaluated alongside unit price.


    4. Cost Reduction in Practice: Saving Most of the Budget Without Changing the Model

    4.1 Engineering prefix caching: put stable content first

    A cache hit requires that the request prefix be byte-for-byte identical. Organize prompts in layers from “stable” to “volatile”:

    1. [Stable layer] System instructions, role definition, output format spec, glossary
    2. [Semi-stable layer] Project background, code conventions, domain knowledge
    3. [Volatile layer] The user's current question, this request's input data

    Inserting a timestamp, random ID, or incrementing counter into the stable layer invalidates the entire cache. The same applies to multi-turn conversations: do not insert changing content into the middle of the history—append it at the end.

    4.2 Constrain output, directly cutting the most expensive part

    • Replace free-form prose with structured output (explicit fields and format agreements) to reduce redundant pleasantries and self-restating;
    • For tasks that do not need to expose intermediate steps, ask for “the conclusion and key evidence only”;
    • For very long inputs, retrieve or summarize first and feed only the relevant fragments into the model instead of the entire document;
    • Set a maximum output length to keep long-chain reasoning models from spending budget on unbounded generation.

    4.3 Tiered routing: reserve the expensive model for hard problems

    Routing by task complexity is the optimization with the most predictable payoff:

    1. request -> rule-based / small-model complexity prediction
    2. ├─ simple (classification, extraction, formatting, rewriting) -> low-cost model
    3. └─ complex (proofs, cross-file refactoring, multi-step reasoning) -> high-capability reasoning model

    Signals for the decision can include input length, whether the input contains mathematical notation or code blocks, first-pass confidence, and the small model’s self-verification result. A commonly seen split in practice is that more than 70% of requests are handled by the low-cost channel, while total cost drops by 50%–70%.

    4.4 Observability: no measurement, no optimization

    At a minimum, record the following and aggregate daily:

    • Input, output, and cached token counts per request;
    • Cache hit rate and reasons for misses;
    • First-pass rate and average number of retries;
    • Cost per task and cost attribution by business line;
    • Queue latency distribution during peak hours.

    Wire these metrics into monitoring and alerting, with usage thresholds by project, by environment, and by caller, so that when the bill starts running away you can pinpoint the specific caller and calling pattern.


    5. Common Evaluation Pitfalls

    1. Substituting a single impression for an evaluation set. One stunning answer is not a capability; you need a fixed question set and repeated sampling.
    2. Ignoring the cache-miss input price. Looking only at “input price” hides the fact that real input cost can be dominated by full-price tokens.
    3. Looking at unit price but not effective output rate. You must divide by the first-pass rate to get the true unit cost.
    4. Burying variables in the stable prefix. Timestamps and random IDs invalidate the cache wholesale, and the failure is hard to notice.
    5. Over-pursuing long chains of thought. A longer chain is not automatically more reliable; read it together with accuracy and output cost.
    6. Ignoring latency and rate limits. For interactive scenarios, the business cost of queueing often exceeds the token bill itself.
    7. Treating an existing quota as a resource that must be consumed. The right use of quota is to absorb high-value offline batch work, not to manufacture meaningless calls.

    6. Launch Checklist

    Capability side

    • Build a private evaluation set for each of the four capability categories, with a decidable answer prepared for every question;
    • Include “no-reference-answer proof questions” and verify citation authenticity and derivation self-consistency;
    • Keep the scorecard to five items: correctness, citation authenticity, formatting compliance, chain-of-thought efficiency, and stability;
    • Record variance across repeated samples and use it to judge reliability in production.

    Cost side

    • Convert unit prices into cost per task with the cost function, and divide by the first-pass rate;
    • Layer prompts from stable to volatile, and monitor the cache hit rate;
    • Set up tiered routing that pushes simple requests down to low-cost models;
    • Apply structure and length constraints on the output side;
    • Connect usage monitoring and alerting, and do cost attribution;
    • Allocate subscription quota to high-value offline tasks first.

    Merge these two checklists into a routine pre-launch review, and you can find a sustainable balance between quality and bill: not the cheapest model, and not the strongest model, but the model with the best cost efficiency for each class of task.