LLM Token Usage: How to Evaluate Efficiency and Real Task Costs

    Token usage alone does not determine whether a large language model is cost-effective. This article explains how to measure usage across complete workflows, calculate costs by billing category, account for failures and human effort, and run reproducible evaluations. It also examines why token savings vary across coding, document analysis, retrieval, and subscription services—and why cost per successful task is a more useful metric than token count alone.

    1. Token Efficiency Is Not the Same as Cost Efficiency

    A common mistake when evaluating large language model (LLM) usage is to treat “generating less text,” “using fewer tokens to complete a task,” and “spending less money” as equivalent.

    These metrics answer different questions:

    • Output length measures how much content the model ultimately produces.
    • Task token usage measures the cumulative input and output processed from the start of a task to the end of execution.
    • Task cost measures the charges incurred when that usage is converted into money under the applicable billing rules.

    For a single question-and-answer exchange, these measures may be closely related. In coding agents, multistep retrieval, and long-document processing, however, the relationship becomes weaker. A model may reduce total token usage by avoiding rework but still cost more because its unit price is higher. It may also produce a longer answer yet reduce overall cost by completing the task without repeated revisions.

    An evaluation therefore needs to answer more than “How many tokens did it use?” It must also establish the measurement boundary, whether the task succeeded, and the actual cost of delivery.

    2. Define the Measurement Boundary: Count More Than the Final Answer

    Tokens are the basic units used to measure how models process text and other information. They are not directly equivalent to words, characters, or Chinese characters. Different tokenizers can split the same text differently, so cross-model comparisons need a clearly defined accounting method. Otherwise, differences in measurement may be mistaken for differences in capability.

    A complete agent task typically includes:

    1. Receiving the user’s request and task constraints.
    2. Reading relevant documents, code, or environment information.
    3. Developing a plan and generating tool-call requests.
    4. Receiving tool results.
    5. Revising the approach, rerunning steps, or validating results.
    6. Producing the final deliverable.

    The final answer may not account for most of the context. Repeated conversation history, complete files, execution logs, and corrections after failed attempts can consume far more tokens.

    For a task involving multiple model calls, visible token usage can be expressed as:

    1. T_task = Σ (T_input,i + T_output,i)

    The sum covers every model call in the task, not just the last one.

    If the service reports additional categories, such as cached input or separately metered reasoning usage, record them according to the actual billing documentation. Some reasoning usage may already be included in reported output tokens. Do not add it again without evidence that it is a separate category.

    Avoid Common Accounting Errors

    First, distinguish tool execution overhead from model token usage. Running programs, accessing files, or executing tests through a tool is generally not itself token usage. Once the tool’s results enter the model context, however, they contribute to subsequent input usage.

    Second, distinguish a failed model request from a failed task. A request may return successfully while the generated changes fail acceptance tests. That attempt still incurs usage, but it does not count as a successful delivery.

    Finally, retain the termination reason. Tasks that end because of a timeout, budget limit, or manual interruption should not be treated as equivalent to normally completed tasks.

    3. Build a Cost Model: Calculate Input and Output Separately

    In a basic usage-based billing model, task cost is:

    1. C_task = (T_input × P_input + T_output × P_output) / M

    Where:

    • T_input and T_output are cumulative input and output token counts.
    • P_input and P_output are the corresponding unit prices.
    • M is the pricing denominator. For prices quoted per million tokens, M is 1,000,000.

    If cached tokens or other billing categories have separate prices, calculate each category separately and then sum the charges. Avoid multiplying total tokens by an average price unless the calculation of that average is explicit and the input-to-output ratio is reasonably stable.

    Why Lower Usage Can Still Mean Higher Costs

    To isolate the relationship, assume that task types, input-to-output ratios, and billing-category shares remain unchanged, and that all unit prices change by the same factor. Under those simplified assumptions:

    1. New task cost / Original task cost
    2. ≈ Usage ratio × Unit-price ratio

    The following examples are illustrative, not evaluation results for any specific product:

    • If usage falls to one-third of its original level and unit prices rise to 2.5 times their original level, cost becomes approximately 83.3% of the original—about a 16.7% reduction.
    • If usage falls by only 10% and unit prices rise to 2.5 times their original level, cost becomes approximately 225% of the original—a 125% increase.
    • If unit prices rise to 2.5 times their original level but cost increases by only 75%, usage must have fallen to 70% of the original under these assumptions.

    Whether a set of published figures is internally consistent depends on whether those figures use the same task set, billing categories, and configuration. A token reduction measured on coding tasks cannot be directly combined with an average cost increase measured on knowledge-based question answering.

    When figures appear contradictory, check their measurement boundaries before drawing conclusions about model architecture or commercial strategy.

    4. Why Token Savings Vary Across Tasks

    Coding Agents: Savings Often Come from Avoiding Failed Paths

    Coding tasks commonly involve reading code, locating a problem, making changes, running tests, and fixing errors. The final response may be short even when the execution workflow is long.

    Effective ways to reduce token usage include:

    • Locating relevant files more accurately and avoiding unrelated code.
    • Clarifying constraints before editing to prevent large rewrites in the wrong direction.
    • Making targeted fixes based on test results rather than repeatedly replacing the entire approach.
    • Retaining verified facts to avoid duplicate exploration.
    • Detecting unproductive loops early and reporting blockers before exhausting the budget.

    These improvements may increase success rates while reducing the number of calls. However, lower total token usage alone does not establish an architectural advance. Prompt design, tool organization, context-truncation rules, and changes in task difficulty can all affect the result.

    To isolate the model’s contribution, compare systems using the same task set, tool permissions, budgets, and acceptance criteria.

    Long Documents and Knowledge-Based Questions: Some Information Cannot Be Omitted

    Long-document analysis requires sufficient source material. Structured question answering also needs to preserve key facts and constraints. Even with more efficient reasoning, necessary input may remain the dominant cost.

    If a task already succeeds in one attempt, there is little rework to eliminate. Unit-price changes can then have a stronger influence on the bill.

    Token advantages observed in coding agents should therefore not be assumed to apply to summarization, information extraction, knowledge-based question answering, or fixed-format generation. Measure each task category separately, paying particular attention to the input share and required output length.

    Multistep Retrieval: Filtering Results May Matter More Than Shortening Answers

    In retrieval workflows, much of the usage comes from candidate material added to the context rather than from the final answer. Deduplication, relevance filtering, and selective trimming during retrieval may be more useful than asking the model to write fewer paragraphs.

    Trimming must preserve supporting evidence, time ranges, and important qualifications. Shorter source material may reduce cost while increasing the risk of omitted facts or incorrect conclusions.

    5. Manage Context to Reduce Repeated Work, Not Create Information Gaps

    Context management is an important part of token efficiency in long-running tasks.

    A general approach is to maintain a structured work record containing:

    • The current objective and acceptance criteria.
    • Confirmed facts.
    • Actions already taken and their results.
    • Hypotheses that have been ruled out.
    • Unresolved questions.
    • Locations of key evidence.

    Subsequent calls can read the compact record first and access complete materials when needed. This reduces repeated input and helps prevent the model from retrying approaches that have already failed.

    Such a record is not inherently reliable “memory.” Summaries can omit conditions, older records can become inconsistent with the current state, and compression can turn uncertain judgments into apparent facts.

    Work records should therefore distinguish facts, hypotheses, and items awaiting verification, while retaining sources for important conclusions. For code and data tasks, final decisions should rely on actual files, execution results, and acceptance tests—not solely on descriptions in a summary.

    Context savings also need validation. If fewer tokens lead to more missing facts, incorrect fixes, or human takeovers, overall efficiency may not have improved.

    6. Measure Cost per Successful Task, Not Minimum Usage

    A model that fails quickly while using very few tokens is not necessarily economical.

    For a batch of tasks, a more useful metric is:

    1. Effective cost per successful task
    2. = Total cost of all tasks / Number of successfully completed tasks

    Failed tasks still consume budget and must remain in the numerator. If retries occur, attribute their costs to the original task. Do not split each attempt into a separate task in a way that obscures the impact of failures.

    Organizations should also assess the full cost of delivery:

    1. Total delivery cost
    2. = Model fees + Tool and compute costs + Human review costs + Rework costs

    A model with lower API fees may have a higher delivery cost if developers must frequently inspect its edits, supply missing context, and repair errors. Conversely, a model with a higher unit price may offer greater value if it reliably completes difficult tasks with less human intervention.

    At minimum, track the following metrics together:

    Metric Main purpose
    Task success rate Determine whether outputs meet acceptance criteria
    Cost per successful task Measure how efficiently spending produces useful results
    Completion latency Check whether delivery meets time requirements
    Human takeover rate Identify the limits of automation
    Retry count Detect excessive failed execution paths
    Quality score Prevent lower usage from masking lower output quality

    Under the same quality constraints, a solution has a clear advantage if it costs less and its latency is no worse. When alternatives involve trade-offs, choose according to business budgets and quality requirements rather than the lowest token count on a single leaderboard.

    7. How to Run a Reproducible Evaluation

    Step 1: Build a Representative Task Set

    Separate tasks by real business use case, such as bug fixing, document analysis, information extraction, and multistep retrieval. Include a range of difficulty levels within each category rather than selecting only tasks that are easy to complete in one attempt.

    Fix the task descriptions, input materials, and acceptance criteria. Coding tasks should start from the same code state and use actual tests to verify results. A model’s own claim that it has finished is not sufficient.

    Step 2: Standardize Execution Constraints

    Specify tool permissions, maximum call counts, timeouts, context-management policies, and task budgets. These settings change both the scope of exploration and the resulting usage and success rates.

    When comparing reasoning effort levels, record each configuration as a separate candidate. Do not combine the quality of a high-effort setting with the cost of a low-effort setting into one result.

    Step 3: Record Per-Call Traces

    For each call, record at least input usage, output usage, billing categories, actual charges, latency, tool calls, and termination status. Redact sensitive material and restrict access where necessary.

    Per-call records help distinguish three sources of consumption: necessary information processing, productive exploration, and repeated failure. Knowing where usage occurs makes it possible to decide whether to optimize model selection, retrieval, or the workflow itself.

    Step 4: Repeat Runs and Examine the Distribution

    Model execution can vary across runs. Repeat important tasks and examine medians, high-percentile costs, and maximum execution times in addition to averages.

    A small number of tasks stuck in loops can significantly increase the total bill. Average token usage alone can conceal the risk of runaway spending.

    Step 5: Test Sensitivity to Budget Limits

    Evaluate low, medium, and high budgets and observe how success rates change. If a substantial budget increase yields only a small quality improvement, reconsider the execution strategy.

    Design budget limits together with acceptance criteria. When a task reaches its limit, the system should clearly report completed work, blockers, and unverified items rather than present an unfinished result as a success.

    8. Subscription Benefits Cannot Be Inferred Directly from Token Savings

    Subscription services do not necessarily deduct allowances according to actual token usage. They may instead use request counts, time windows, feature access, or combined resource limits.

    The claim that “using two-thirds fewer tokens allows three times as many tasks on the same subscription” holds only under specific conditions: the allowance must be deducted using the same token accounting method, other limits must remain unchanged, and task quality must stay consistent.

    A more reliable test is to record the number of acceptable tasks completed during an allowance period, waiting times, and the reasons limits were triggered. The practical benefit for subscribers should appear as more successful deliveries or less waiting—not merely lower internal model usage.

    9. Conclusion: Evaluate Token Efficiency Through Delivery Outcomes

    Token usage is an important engineering metric, but it is not a standalone measure of value.

    A reliable evaluation follows a clear sequence:

    1. Standardize measurement boundaries and verify task quality.
    2. Calculate input and output charges separately, then include failures, retries, and human effort.
    3. Validate results in each specific use case before generalizing to other workloads.

    The ultimate question is not “Which model uses the fewest tokens?” It is “Which solution completes tasks most reliably within the required quality, latency, and budget constraints?”

    Only by evaluating token efficiency, task success, and actual delivery cost together can teams distinguish genuine efficiency gains from changes in accounting or pricing.