LLM Token Usage: How to Evaluate Efficiency and Real Task Costs
Lower token usage does not necessarily mean lower costs or better performance. This article explains how to measure token consumption across complete LLM workflows, account for pricing and retries, improve agent context management, and build reproducible evaluations that compare cost per accepted result, quality, latency, and operational risk.
1. Token Savings and Cost Savings Are Different Metrics
Evaluating large language model (LLM) token usage requires more than counting generated text or looking at a reported percentage reduction. The real question is how many resources, how much money, and how much time a business task requires while meeting the same quality standards.
A token is a basic unit used by a model to process text. It is not equivalent to a word, character, or Chinese character. Tokenization methods, languages, and content types can all change the number of tokens representing the same text. Code, natural language, and structured data cannot reliably be compared through simple character-count conversions.
Token efficiency should therefore be measured at three levels:
- Per-call usage: The input and output tokens consumed by a single request.
- End-to-end task usage: The total tokens consumed by every model call from the start of a task to its completion.
- Usage per accepted result: The average tokens required to produce a result that meets acceptance criteria, including failures, retries, and necessary rework.
For simple question answering, these metrics may be similar. For agent workflows that modify code, retrieve information, invoke tools, and repeatedly validate results, they can differ substantially.
A short final response may follow multiple rounds of retrieval, planning, code changes, and testing. Its length does not represent the resources consumed by the entire task.
2. Break Down the Task Bill Before Interpreting the Numbers
Under a typical usage-based pricing model, model costs can be approximated as:
Task model cost = input tokens × input price + output tokens × output price
If prices are quoted per million tokens, divide the token counts by one million when calculating the cost. Services with cached-input pricing, multiple input categories, or other billing items require a more detailed calculation based on their actual rules. Not every token can be multiplied by the same price.
Let:
I= input token countO= output token countPi= input price per million tokensPo= output price per million tokens
Then:
C = (I × Pi + O × Po) / 1,000,000
Cost depends on both total token usage and the input-output mix. If output tokens are more expensive than input tokens, eliminating 1,000 output tokens saves a different amount than eliminating 1,000 input tokens.
Lower Token Usage Can Still Mean Higher Costs
Suppose a new configuration reduces both input and output usage to one-third of their previous levels, while both unit prices rise to 2.5 times their previous levels. Excluding other charges:
New cost / old cost = (1/3) × 2.5 ≈ 0.833
The cost decreases by approximately 16.7%, not by two-thirds.
Now suppose another task category uses only 10% fewer input and output tokens, with the same 2.5-fold increase in unit prices:
New cost / old cost = 0.9 × 2.5 = 2.25
The cost increases by 125%.
These are hypothetical examples illustrating the calculation, not claims about any particular product. The key point is that token reductions cannot be interpreted independently of price changes.
Do Not Multiply Unrelated Statistics
A report showing a substantial usage reduction for one task category does not necessarily contradict another report showing higher costs across a broader task mix. The reports may cover different tasks, runtime settings, or input-output ratios.
However, if a report claims that the same task set used “10% fewer tokens, with all unit prices rising to 2.5 times their previous levels, but costs increasing by only 75%,” its measurement definitions need clarification. Under the simplified assumptions above, those figures cannot all hold simultaneously.
Check whether:
- Usage includes only some model calls.
- Cost calculations use different task weights.
- Input and output prices changed by different proportions.
- Cache discounts or other pricing categories apply.
- The results use different runtime configurations.
- The reported average is a ratio of aggregate totals or an average of individual task ratios.
When figures do not reconcile, ask for clearer definitions rather than explaining away the discrepancy with unverified assumptions.
3. Why AI Agents Can Consume So Many Tokens
Agent costs usually come from the execution process, not the final deliverable. A typical workflow may include:
Task interpretation → information review → planning → tool calls → result inspection → targeted corrections → further validation → final delivery
Each stage can generate new inputs and outputs, while later calls may repeatedly include earlier context.
Repeated Context Processing
A coding task may require reading multiple files, error logs, dependency notes, and test results. If every call includes the full history, input tokens can continue accumulating even when little new information has been added.
A larger context window does not automatically lower costs. Capacity determines what can fit; efficiency determines what is worth carrying forward.
Rework Caused by Poor Attempts
An incorrect first edit, unsuitable tool arguments, or inadequate test coverage can trigger additional execution rounds. Reducing failed attempts often saves more end-to-end tokens than shortening the final answer.
However, verification should not be skipped merely to reduce the number of rounds. An untested “quick completion” may simply transfer costs to human reviewers or production incident response.
History Compression That Loses Decision Rationale
A summary of a long-running task may preserve what was done while losing why it was done. The model may then reconsider rejected approaches or repeat operations that already failed.
This is not merely verbose writing. It is wasted computation caused by inadequate state management.
4. Reduce Unnecessary Usage Through Task State Management
Lowering the cost of long-running tasks does not require assuming that a model has unverified, exclusive capabilities. Applications can improve context management through general engineering practices.
Maintain an Updatable Working Record
A working record should include:
- The current objective and acceptance criteria.
- Confirmed facts and constraints.
- Completed changes and their validation results.
- Approaches already tried that failed.
- Unresolved issues.
- The smallest necessary next action.
This record is not just a shorter chat history. It preserves the state that matters for future decisions. Failure reasons and constraints deserve particular priority.
External records do not mean that a model inherently remembers information across requests. The application must still store and retrieve that information, then provide it again when needed.
Provide Information on Demand Instead of Reloading Everything
For large repositories or long documents, locating relevant files and sections before supplying the necessary excerpts is generally more sensible than submitting all available material in every round.
Retrieval must not be too narrow, however. Modifying a function may require examining its callers, data constraints, and related tests—not just the function itself. Input savings are useful only if enough evidence remains for sound decisions.
Make Tool Results Easier to Use
Long logs, repeated error messages, and irrelevant file listings inflate subsequent inputs. Applications can structure tool results to:
- Preserve failed tests and key error locations.
- Consolidate duplicate errors.
- Separate original evidence from summary conclusions.
- Retain a traceable path to complete logs.
- Clearly mark uncertainty in summaries.
Summaries cannot replace evidence. When the model needs to verify a conclusion, it should be able to access the original material rather than rely on potentially distorted compression.
5. Evaluate Efficiency Alongside Quality and Success Rate
A configuration that uses fewer tokens on average but frequently fails to deliver is not necessarily more economical.
For a fixed task set, use:
Average cost per accepted result =Total cost of all attempts / Number of accepted results
For example, suppose a hypothetical configuration makes 100 attempts at a total cost of 100 cost units, and 80 results meet acceptance criteria. Its average cost per accepted result is 1.25 units.
Another configuration may cost more per attempt yet deliver a lower cost per accepted result if its success rate is sufficiently higher.
This metric also has limits. If unsuccessful tasks ultimately require manual completion, that remediation cost must be included. Undelivered work should not simply disappear from the accounting.
Organizations can use a broader measure:
Total delivery cost =Model costs+ Tool and execution costs+ Human review costs+ Failure remediation costs
Tool and execution costs may include compute, retrieval services, storage, and network usage. Cost structures vary widely across businesses and should reflect the actual workflow rather than a universal assumption.
Latency also matters. Fewer tokens can reduce some generation overhead, but total elapsed time depends on the number of calls, external tool speed, queueing, and sequential dependencies. A given token reduction does not imply an equivalent percentage speedup.
6. Build a Reproducible Evaluation Process
Instead of chasing a single “efficiency improvement” figure, build an evaluation set that reflects your business needs.
Group Tasks by Type
At minimum, distinguish:
- Short question answering and information extraction.
- Long-document comprehension and knowledge organization.
- Code generation and code modification.
- Long-running workflows involving multiple tools.
Different tasks have different cost drivers. Code modification may spend most of its resources on trial and error and validation, while long-document analysis may be dominated by input processing. Combining them into one average can hide meaningful changes.
Keep Comparison Conditions Consistent
Where possible, compare old and new configurations using the same task materials, acceptance criteria, tool permissions, execution environment, and retry policy.
Also record settings such as context-compression strategy and maximum model-call count.
If the goal is to compare each system under its own best configuration, label the comparison accordingly. Do not attribute all observed gains solely to a model change.
Record the Complete Task Workflow
For each run, record:
- Input, output, and any other available billable usage.
- Applicable prices and actual charges.
- Model-call rounds and tool-call counts.
- First-attempt pass status and final acceptance outcome.
- Wall-clock duration.
- Number of human interventions.
- Failure categories and reasons for rework.
Mark unavailable metrics as unknown. Do not infer them from the final response length.
Examine Averages and Tail Behavior
Alongside average cost, examine the median, higher percentiles, and maximum values for both cost and latency. A small number of tasks stuck in loops can substantially increase budget risk.
If results vary between runs, repeat tests enough to avoid mistaking a one-off advantage for a stable improvement.
7. Subscription Limits Are Not the Same as Token Efficiency
Usage-based billing and subscriptions require separate analysis.
With usage-based billing, focus on actual billing categories and cost per accepted result. With subscriptions, determine whether limits are based on message count, task count, compute budget, or another measure.
Lower token usage can approximately translate into more completed tasks only when the limit primarily depends on token consumption and other constraints do not become bottlenecks.
If request count or concurrency is the main constraint, a more token-efficient task may not allow users to execute more tasks.
Therefore, a claim such as “roughly 70% fewer tokens means subscription users can complete three times as many tasks” is only an estimate under specific assumptions, not a generally valid conclusion.
8. Judge Progress by Accepted Deliverables
Improved token efficiency may come from more accurate decisions, less repeated reading, or better state management. It may also come from shorter outputs or reduced verification. Usage figures alone cannot establish the technical cause, let alone demonstrate an architectural breakthrough.
Developers and organizations should prioritize four questions:
- Does end-to-end token usage decrease on our tasks?
- Does the success rate stay the same or improve under identical acceptance criteria?
- Is each accepted result cheaper after actual billing is applied?
- Are latency, human intervention, and costly failure outliers under control?
Evaluating these questions together helps distinguish genuine efficiency improvements from apparent advantages created by inconsistent measurement.
Tokens measure resource usage, not value. The more reliable standard is whether a system completes business tasks at a lower total cost through a more stable process—without compromising quality, safety, or traceability.
