How to Evaluate LLM Cost-Effectiveness After a Price Increase
This article explains how to assess large language model cost-effectiveness after pricing changes by shifting from per-token prices to the cost per successful business task. It covers task definition, a unit-cost model, reasoning-depth tiers, routing rules, custom evaluation sets, cost monitoring, common pitfalls, and a deployment checklist.
1. After a Price Change, Model Selection Changes
When model prices rise, many teams first compare price tables. That comparison looks only at unit price and ignores two critical factors: different models consume different numbers of tokens for the same task, and different models have different success rates. A model may have a higher unit price but produce a usable result in one call. Another model may have a lower unit price but often require retries or manual correction. The former can have a lower overall cost.
Model selection should therefore shift from “how much does one million tokens cost” to “how much does it cost to complete one business task.”
2. Define Tasks Before Comparing Models
Before choosing a model, break the business scenario down clearly. At minimum, answer three questions.
- Task type: Classification, information extraction, text rewriting, code generation, and multi-step reasoning place very different demands on model capability. Using a high-end model for simple tasks is often wasteful.
- Quality threshold: What error rate can the business tolerate? Customer service Q&A and financial data extraction have very different tolerance levels. The threshold should be quantified, for example, “extraction accuracy must be no lower than 98%.”
- Latency and concurrency requirements: Are users waiting for a real-time response? How many requests must be processed per second? In latency-sensitive scenarios, a slow model can hurt the experience even if its unit price is suitable.
The answers to these questions determine the evaluation metrics and budget ceiling for the next steps.
3. Build a Cost-per-Task Model
The cost of a single call is determined by the number of input and output tokens and their prices. If a task requires retries, the actual cost must also be divided by the success rate to obtain the average cost per successful task.
The following illustrative code uses placeholder prices. Replace them with current price-list data in actual use.
from dataclasses import dataclass@dataclassclass ModelPrice:name: strinput_per_million: float # Price per million input tokens (CNY)output_per_million: float # Price per million output tokens (CNY)def cost_per_call(price: ModelPrice, input_tokens: int, output_tokens: int) -> float:"""Calculate the cost of a single call."""return (input_tokens * price.input_per_million+ output_tokens * price.output_per_million) / 1_000_000def cost_per_success(price: ModelPrice, input_tokens: int,output_tokens: int, success_rate: float) -> float:"""Calculate the expected cost per successful task."""if not 0 < success_rate <= 1:raise ValueError("success_rate must be in (0, 1]")return cost_per_call(price, input_tokens, output_tokens) / success_rate
With this model, comparing two models cannot rely on unit price alone. Raising the success rate from 70% to 95% often reduces total cost more than a 20% drop in unit price.
4. Tier Reasoning Depth by Task
Some models support switching between deep reasoning mode and lightweight mode, with different trade-offs in cost and quality.
- Deep reasoning mode: The model performs more intermediate derivation and self-checking. It is suitable for multi-step logic, complex code debugging, and math or rule-based judgments that require strict validation. The cost is more output tokens and longer response times. Output token prices are usually higher than input token prices, so this cost is amplified.
- Lightweight mode: The model gives conclusions directly. It is suitable for clear tasks such as classification, summarization, format conversion, and keyword extraction. Cost is lower and latency is smaller, but complex reasoning is more error-prone.
In practice, test both modes on a small batch of samples, create a mapping of which task types suit which mode, and then codify it as routing rules. Switching conditions should be explainable and auditable rather than based on intuition.
5. Use Task Routing to Control Overall Cost
The goal of routing is to send simple requests through low-cost channels and send only difficult requests to high-capability models. Routing rules can be keyword rules, length rules, or a small classifier model. Below is a simplified example.
from typing import CallableCOMPLEX_HINTS = ("proof", "debug", "derive", "multi-step", "consistency check")def classify_task(prompt: str) -> str:"""Example rule: replace with a classifier model or a more complete rule set in real projects."""if len(prompt) > 2000 or any(hint in prompt for hint in COMPLEX_HINTS):return "complex"return "simple"ROUTES = {"simple": {"model": "light-model", "reasoning": False},"complex": {"model": "strong-model", "reasoning": True},}def route_and_call(prompt: str, call_model: Callable[..., str]) -> str:route = ROUTES[classify_task(prompt)]return call_model(model=route["model"],prompt=prompt,reasoning=route["reasoning"])
A fallback mechanism should also be set up outside routing. For example, when the lightweight model’s output fails format validation or a confidence check, automatically escalate to a high-capability model for reprocessing. This controls average cost while preserving quality for long-tail requests.
6. Replace Subjective Judgment with Your Own Evaluation Set
Many model-selection debates come from subjective impressions based on a small number of examples. A more reliable approach is to build an evaluation set that reflects real traffic.
- Sample: Draw 100 to 300 samples from online logs, covering common requests and boundary cases.
- Annotate: Provide a standard answer for each sample or write scoring rules, such as whether fields are complete and whether semantics are consistent.
- Test consistently: Run the same batch of samples on multiple candidate models with the same prompts and parameters.
- Record metrics: Look at success rate, average input and output tokens, and latency percentiles together.
The following illustrative code shows the evaluation process.
import statisticsimport timedef evaluate(model_name, samples, call_model, check):results = []for sample in samples:start = time.perf_counter()output = call_model(model=model_name, prompt=sample["prompt"])latency = time.perf_counter() - startresults.append({"ok": check(output, sample["expected"]),"latency": latency,})success_rate = sum(r["ok"] for r in results) / len(results)p50_latency = statistics.median(r["latency"] for r in results)return {"model": model_name,"success_rate": round(success_rate, 4),"p50_latency_s": round(p50_latency, 3),}
The evaluation set needs to be updated regularly. Changes in the business and in how users ask questions can make old samples unrepresentative. After a model version update, rerun the evaluation as well.
7. Cost Monitoring and Optimization
Model selection is only the starting point. After launch, spending must be controlled continuously.
- Result caching: Reuse results for identical or highly similar requests. This suits common questions and fixed-template tasks.
- Trim context: Remove repeated system prompts and conversation history, and keep only the fields required for the current task. Longer context means more input tokens.
- Limit output length: Set a reasonable maximum output token count based on the task. A task that asks for “JSON only” should not allow the model to produce long explanations.
- Structured output: Fix the output format to reduce redundant text and make downstream parsing easier.
- Usage monitoring: Record token usage by feature module, model, and caller. Set daily budgets and anomaly alerts to catch sudden growth in a feature.
8. Common Pitfalls
- Looking only at unit price: This ignores the hidden costs of retries, manual correction, and failed requests.
- Using one model for every scenario: Mixing simple and complex tasks usually makes the system both more expensive and slower.
- Judging quality from a few samples: Too few samples make conclusions easy to mislead.
- Ignoring latency: Slow responses can reduce user retention and conversion, and this loss is hard to see directly on the bill.
- Never revisiting model selection: Prices, versions, and capabilities all change. Review model selection quarterly.
9. Deployment Checklist
- Break the business down into specific task types, and set quality thresholds and latency limits for each type.
- Build a cost-per-task model and use “cost per successful task” as the core comparison metric.
- Configure reasoning depth for tasks and define the switching conditions between deep reasoning and lightweight mode.
- Design routing rules and a fallback escalation mechanism, and log where each type of request is sent.
- Build an evaluation set that covers real traffic, test candidate models consistently, and save the results.
- Launch caching, context trimming, and output-length limits, and configure usage monitoring and budget alerts.
- Review prices, versions, and evaluation results on a fixed schedule, and adjust routing and model combinations in time.
