LLM Evaluation Needs More Than Benchmark Scores: Analyzing Cost and Token Consumption
Benchmark scores alone do not show what a model costs to run. This article explains how unit price, usage, and completion rate combine into total cost, why reasoning tokens and verbose output inflate bills, and how to set up metrics and controls that make model comparisons fair.
Introduction
When choosing an LLM service, many teams check leaderboard scores first and then compare unit prices. This approach overlooks a key fact: actual spending depends on unit price, usage, and completion rate together. In the same evaluation, total cost can differ by a factor of dozens across models, often because of how many tokens each model consumes. This article examines cost and token consumption and provides an analysis framework that teams can apply directly.
1. Three Variables Determine Total Cost
Total cost breaks down into three components:
- Unit price: Input and output tokens are priced separately. Some services also bill for the reasoning process on its own.
- Usage: For the same task, output length can vary significantly across models.
- Completion rate: When a model answers incorrectly, retries or manual review are needed, which can multiply the actual cost.
Comparing unit prices alone leads to wrong conclusions. A model with a lower unit price but verbose output does not necessarily cost less per task.
2. Three Sources of Token Consumption
- Input tokens: System prompts, conversation history, and retrieved documents all count toward input tokens.
- Output tokens: The visible response the model generates.
- Reasoning tokens: Some models reason internally before they answer. These tokens are usually billed as well, and they may not appear in the final response.
In evaluations, the share of reasoning tokens is especially important. Two models may produce visible responses of similar length while their reasoning tokens differ several times over. As a result, the bills can diverge far more than expected.
3. Verbosity: A Common Source of High Token Usage
Verbosity refers to the extra content a model produces beyond what the task requires. Common patterns include:
- restating the question;
- adding lengthy background before the conclusion;
- comparing multiple options for a simple question;
- including code comments and wrapper code unrelated to the requirements.
Verbose output does not mean higher quality. In scenarios that require precise answers, extra content increases reading cost and can introduce new errors.
4. Building Cost Evaluation Metrics
Record at least the following four metrics:
- average cost per task;
- cost per correct answer, calculated as total cost divided by the number of correct samples;
- average output token count and average reasoning token count;
- response latency, including time to first token and total completion time.
The following example shows how to calculate these values:
def estimate_task_cost(input_tokens, output_tokens, reasoning_tokens,price_in, price_out, price_reasoning):# Prices are per million tokenscost = (input_tokens * price_in+ output_tokens * price_out+ reasoning_tokens * price_reasoning) / 1_000_000return costdef cost_per_correct(total_cost, correct_count):if correct_count == 0:return float("inf")return total_cost / correct_count
When using these functions, first aggregate the token statistics for each evaluation sample, then calculate the averages. If a model has a low cost per task but also a low accuracy rate, its cost per correct answer may turn out to be the highest.
5. Variables to Control During Evaluation
Before comparing models, make sure the test conditions are consistent:
- use the same prompts and input samples;
- use the same temperature and maximum output length settings;
- use the same reasoning mode configuration, and avoid comparing results with reasoning enabled against results with reasoning disabled;
- run each test multiple times and average the results to reduce the effect of randomness.
If the conditions differ, the cost gap you measure will not reflect the model’s own efficiency.
6. Engineering Methods for Controlling Output Length
Reducing token consumption at the application layer is often more direct than switching models. Consider the following approaches:
- Specify the output format: State the structure in the system prompt. For example, “Give the conclusion first, then explain it with no more than three reasons.”
- Set a reasonable output limit: This prevents abnormal generations from exhausting the quota.
- Constrain structured responses: For structured tasks, require fixed fields to reduce free-form text.
- Cache repeated requests: Reuse results for identical queries to avoid paying for them again.
The following example shows a sample configuration:
request = {"model": model_name,"messages": [{"role": "system","content": "Give the conclusion first, then explain the basis in no more than three sentences."},{"role": "user", "content": question},],"max_tokens": 512,"temperature": 0.2,}
This configuration does not guarantee that the model will follow the constraints. Before deployment, test the output length distribution with an evaluation set and monitor the truncation rate. If the truncation rate is high, adjust the prompt first, then consider changing the output limit.
7. Implementing Cost Governance on Baidu AI Cloud
When running LLM services on a cloud platform, cost governance can be organized into three areas:
- Usage monitoring: Track token consumption by project and API to identify high-cost call paths.
- Logging and auditing: Record the input length, output length, and status of each request to trace abnormal increases.
- Alerts and quotas: Set thresholds for daily or hourly consumption, and notify the owner when a threshold is exceeded.
These capabilities can be implemented with general-purpose monitoring, alerting, and logging services. For specific configuration steps and billing details, refer to the official documentation of Baidu AI Cloud.
8. Summary
Evaluating LLM cost requires looking at unit price, usage, and completion rate together. Reasoning tokens and verbosity are easy to overlook, yet they have a large effect on cost. Teams can establish a consistent evaluation standard, track the cost per correct answer, and control output length at the application layer through prompt constraints and output limits. Model selection decisions based on these measures hold up better as business scale grows.
