How to Choose an LLM Without Being Misled by Per-Token Pricing
The listed input and output prices of a large language model do not represent the true cost of completing a task. This article explains how to evaluate models using cost per successful task, capability–cost frontiers, task-specific benchmarks, caching, retries, latency, and human editing effort. It also provides an A/B testing framework, sample cost-calculation code, guidance for evaluating frontend generation tasks, and a repeatable model selection process for production systems.
1. Why You Should Not Look Only at the Listed Price
Model pricing is usually stated as the input and output cost per million tokens. However, this does not equal the actual cost of completing a task. The cost of a single task can be expressed as:
Single-task cost = Σ (input tokens × input price + output tokens × output price) / 1,000,000
Several easily overlooked variables affect this calculation.
First, output tokens are usually more expensive than input tokens. If a model tends to produce long responses, output usage can quickly increase the total cost.
Second, some models perform multi-step reasoning before producing an answer. These intermediate reasoning steps also consume output tokens. As a result, two models with the same listed prices may generate bills that differ by several times.
Third, failed tasks may be retried, and each retry incurs additional charges. If a lower-priced model succeeds only 60% of the time, its effective cost may be higher than that of a slightly more expensive model with stable performance.
Model selection should therefore compare cost per successful task, rather than listed prices alone.
2. Understanding the Capability–Cost Frontier
A common way to compare models is to plot them on a scatter chart. The horizontal axis represents the cost of a single task, while the vertical axis represents an overall capability score. Models on the upper-left frontier provide the strongest capabilities at their respective cost levels. Models outside the frontier offer no advantage at the same cost, unless they perform particularly well on a specific dimension.
This chart serves two purposes.
First, it helps eliminate clearly inefficient options. If one model is more expensive than another model on the frontier while receiving a lower overall score, there is usually little reason to continue evaluating it.
Second, it highlights the limitations of aggregate scores. An overall score is calculated by weighting multiple benchmarks. The task distribution, benchmark version, and inference settings can all affect the result. A high aggregate score does not necessarily mean that a model will perform well in your business scenario.
If you want to create this type of chart yourself, follow these steps:
- Extract a representative set of tasks from real business workflows, covering both common and edge cases.
- Run the complete task set with every candidate model, and record cost, success rate, and average latency.
- Plot cost on the horizontal axis and success rate on the vertical axis, then identify the frontier.
- Keep only the candidates on the frontier for the next evaluation stage.
3. How to Interpret Dimension-Specific Benchmarks
In addition to aggregate scores, evaluate individual capability dimensions. Common categories include:
- Coding: Code generation, defect fixing, and unit test creation.
- Agent capabilities: Tool calling, multi-step planning, and completion rates for long-running workflows.
- Vision: Chart interpretation, interface screenshot analysis, and document layout recognition.
- Knowledge and reasoning: Answers to domain-specific questions, mathematical reasoning, and logical reasoning.
When reviewing dimension-specific benchmarks, pay attention to three factors.
First, check the sample size. When there are only a small number of questions, the outcome of one or two tasks can change the conclusion about which model “wins” the most categories.
Second, examine the absolute difference. A two-point difference between two models has a very different meaning from a 40-point difference. The former may be normal variation, while the latter usually indicates a real capability gap.
Third, consider the relevance of each task to your business. If your workflows primarily involve document processing, rankings for agent-oriented tasks may have limited value.
You can weight each capability dimension according to business priorities to produce a more practical score:
score = Σ (dimension score × business weight)The weights must sum to 1. For example:coding 0.4, agent capabilities 0.3, vision 0.2, reasoning 0.1
Business teams should determine these weights based on actual usage frequency rather than copying a configuration from another organization.
4. The Cost Impact of Caching and Multi-Turn Reasoning
Many services support prefix caching. When the beginning of a request is identical to that of previous requests, the repeated portion may be billed at a lower rate. The actual savings depend on two factors: the cache hit rate and the difference between the cached-input price and the standard input price.
If your system prompt is long and remains mostly unchanged, the cache hit rate is usually high, and caching can significantly reduce costs. If the context changes substantially from request to request, the hit rate will be low and the savings will be limited. Billing rules vary by provider, so consult the official service documentation and use actual billing data during evaluation instead of relying only on estimates.
Multi-turn reasoning has an even more direct impact. Some models attempt a task multiple times to improve accuracy, and each round generates additional output tokens. In this situation, a lower per-token price may still result in a higher total cost because the model requires more rounds.
The core metric should therefore be the average total cost per successful task:
Cost per successful task = Total cost of all tasks / Number of successfully completed tasks
This metric accounts for unit prices, token usage, retries, and success rate, making it one of the most direct ways to compare models.
5. Using A/B Testing to Validate Cost Assumptions
After making theoretical calculations, validate them with real traffic. An A/B test should follow these principles:
- Control variables: Use the same input data, prompt template, and runtime environment for both groups. Change only the model.
- Random traffic allocation: Assign requests to the two groups randomly to avoid manually selecting easier or harder tasks.
- Record results by time period: Treat the time of day as a stratification variable. If the provider uses different prices at different times, running the experiment only at night will produce a biased result.
- Cover a sufficient period: Ideally, cover at least one complete business cycle, including both peak and off-peak periods.
Track the following metrics during the experiment:
- Cost per task
- Success rate
- Average latency
- Retry rate
- Human editing rate
Human editing rate is often overlooked, but it directly affects labor costs.
The following example shows how to summarize experiment data. The prices are placeholders and must be replaced with values from actual billing records:
records = load_call_logs() # Each record contains variant, input tokens, output tokens,# cached tokens, success status, and retry countPRICE = {"model_a": {"input": INPUT_PRICE_PLACEHOLDER,"output": OUTPUT_PRICE_PLACEHOLDER,"cache": CACHE_PRICE_PLACEHOLDER},"model_b": {"input": INPUT_PRICE_PLACEHOLDER,"output": OUTPUT_PRICE_PLACEHOLDER,"cache": CACHE_PRICE_PLACEHOLDER},}def call_cost(r):p = PRICE[r.variant]fresh_input = r.input_tokens - r.cached_tokensreturn (fresh_input * p["input"]+ r.cached_tokens * p["cache"]+ r.output_tokens * p["output"]) / 1_000_000for variant in ["model_a", "model_b"]:rows = [r for r in records if r.variant == variant]total = sum(call_cost(r) for r in rows)successes = sum(1 for r in rows if r.success)print(variant, "cost per successful task:", total / max(successes, 1))
max(successes, 1) prevents division by zero. In actual reporting, results should also be grouped by time period so that the impact of time-dependent pricing can be analyzed.
6. How to Evaluate Frontend Generation Tasks
Having a model generate an interface or interactive page is a special type of task. The output can be executed directly, but the evaluation criteria also involve subjective judgment. To reduce bias, use the following process:
- Standardize the requirements: Give every candidate model the same requirements document and design constraints.
- Generate multiple versions: Generate at least three versions for the same requirement to reduce the impact of random variation.
- Use blind evaluation: Reviewers should not know which model produced a page, avoiding bias caused by brand expectations or assumptions.
- Use multiple reviewers: Have at least three reviewers score the results independently. Calculate the average and discuss items with large disagreements.
Possible scoring dimensions include:
- Executability: Whether the page loads correctly and whether the console reports errors.
- Requirement coverage: Whether all requested modules and interactions are implemented.
- Visual design and layout: Whether the page remains aligned at common screen widths and whether colors and font sizes are consistent.
- Interaction completeness: Whether buttons, forms, navigation, and other interactive elements work correctly.
- Code maintainability: Whether the structure is clear and styles are managed in a centralized way.
Frontend evaluations should also track the number of editing rounds. A model that produces an acceptable result on the first attempt may save more debugging time than the difference in per-token prices.
7. Turn Model Selection into a Repeatable Process
A one-time comparison only describes the current situation. Model prices, versions, and service policies change continuously, so model selection should become a standardized process.
A recommended workflow is:
- Define the task set: Extract typical tasks from business logs and document the expected results.
- Standardize the evaluation protocol: Use consistent prompts, parameters, and scoring criteria, and record their version numbers.
- Run a small pilot: Use a limited amount of traffic to verify that the evaluation scripts work correctly.
- Calculate cost per successful task: Use it as the primary decision metric, while also considering latency and human editing rate.
- Roll out gradually: Migrate traffic in stages and keep a rollback path.
- Monitor continuously: Set alert thresholds for cost and success rate. Trigger conditions should include price changes, model version updates, and fluctuations in business metrics.
Scheduled batch-processing tasks also require engineering safeguards. Common practices include:
- Use a task queue to control concurrency and prevent excessive bursts of requests.
- Set a maximum retry count for each task to prevent failed tasks from consuming tokens indefinitely.
- Configure budget alerts and pause non-critical tasks when daily costs exceed a threshold.
- Write token usage for every call to a logging service for reconciliation and analysis.
These measures are not tied to any particular model and apply to large language model deployments in general. As long as the evaluation process and cost-accounting methods remain consistent, teams can make faster decisions when models change without relying on a single benchmark score or a simple price comparison.
