Cost per Task: A Practical Metric for Evaluating LLM Cost-Effectiveness

    Comparing LLMs by token price alone can be misleading. This article introduces cost per task as a more accurate metric for model selection, explains how to combine it with capability scores using Pareto frontier analysis, and walks through a five-step enterprise selection process including internal benchmarks, cost measurement, model routing, and continuous monitoring, along with common pitfalls to avoid.

    1. Why Token Price Alone Is Not Enough

    Many teams start model selection by comparing API token prices. This approach has obvious flaws. A smaller model usually has a lower price per thousand tokens, but completing the same task may require multiple calls, longer prompts, and more output tokens. A larger model has a higher unit price, yet it may produce the correct result in a single call, ending up cheaper overall. Unit price only tells you “how much one token costs.” What the business actually cares about is “how much it costs to get one thing done.”

    2. Defining Cost per Task

    Cost per task refers to the total model invocation cost incurred to complete one full task. It includes input tokens, output tokens, and the extra requests caused by failed retries and tool calls. The formula is:

    C_task = Σ (N_in,i × p_in + N_out,i × p_out), summed over all calls i within the task

    Here, N_in and N_out are the input and output token counts of the i-th call, and p_in and p_out are the corresponding unit prices. Averaging across a batch of tasks gives the average cost per task for that batch.

    The value of this metric is that it converts the model’s billing unit into a business unit. Even if two models differ greatly in unit price, as long as their total consumption per task is similar, their actual costs are similar.

    3. A Two-Dimensional View of Capability and Cost

    Cost alone is not enough; you also need a capability metric. A common practice is to select a broad evaluation suite covering math reasoning, code generation, and general knowledge Q&A, then aggregate the scores into an overall capability score. Each model is then plotted on a two-dimensional plane: the horizontal axis is cost per task, and the vertical axis is the overall capability score.

    Because costs across models can differ by tens of times, the horizontal axis usually uses a logarithmic scale. With a linear scale, the low-cost region would be compressed into an indistinguishable cluster.

    On this chart, models in the upper left have low cost and strong capability, while models in the lower right have high cost and weak capability. Connecting all points that are not simultaneously dominated by another model on both dimensions yields the Pareto frontier. Models on the frontier each have their own advantages; models off the frontier are inferior on both dimensions.

    When selecting a model, judge in this order. First, set the capability floor, i.e., the minimum accuracy the business can accept. Then, among the models that meet this floor, choose the one with the lowest cost. This avoids two types of mistakes: sacrificing quality to save money, or paying unnecessary costs to chase benchmark scores.

    4. The Relationship Between Parameter Scale and Performance

    Parameter scale is strongly correlated with the amount of knowledge a model can store. Knowledge-intensive questions, such as obscure fact lookups and cross-domain encyclopedic Q&A, typically depend more on large parameter counts.

    However, in many business tasks, the main factor determining performance is post-training quality. Post-training includes instruction-following training, preference alignment, and reinforcement learning targeting reasoning and code. A well-post-trained mid-sized model can approach a much larger model on structured tasks while costing less to run. Therefore, parameter scale only indicates a model’s knowledge ceiling; it does not directly represent its performance on a specific task.

    Another easily overlooked factor is reasoning length. Facing the same question, one model may give a direct conclusion, while another generates a large amount of intermediate reasoning. Since output tokens are usually priced higher than input tokens, longer reasoning amplifies cost per task significantly.

    5. Two Common Technical Directions

    Current model optimization broadly advances along two directions.

    The first direction is reducing the cost of a single call. Approaches include model architecture optimization, batching and caching in inference serving, quantization, and distillation, all aimed at lowering the compute overhead per call.

    The second direction is improving post-training effectiveness. With similar parameter scale, raising the task completion rate means fewer calls are needed per task.

    Both directions share the same goal: reducing the total consumption required to complete a task. For users, neither direction is inherently superior. Scenarios requiring broad knowledge coverage and open-ended questions suit larger models. High-frequency, well-structured scenarios suit optimized small and mid-sized models.

    6. A Practical Selection Process for Enterprises

    Step 1: Inventory business tasks. Layer tasks by complexity, latency requirements, and accuracy requirements, such as text classification, information extraction, content rewriting, multi-step reasoning, and code repair.

    Step 2: Build an internal evaluation set. Use real business data, prepare tens to hundreds of samples per task type, and label them with ground-truth answers or scoring rubrics. Public leaderboards can serve as a reference but cannot replace business evaluation, because leaderboard question distributions usually differ from business scenarios.

    Step 3: Measure cost per task. During evaluation, record token counts, retry counts, and latency for each call. Compute the average cost per task type using the formula, then plot it together with accuracy.

    Step 4: Design a routing strategy. Send simple tasks to small models, complex tasks to large models, and escalate when results fail validation. Example code:

    1. def choose_model(task):
    2. if task.complexity == "low" and task.accuracy_need <= 0.9:
    3. return "small"
    4. if task.needs_long_reasoning or task.high_risk:
    5. return "large"
    6. return "medium"
    7. def run_with_fallback(task):
    8. model = choose_model(task)
    9. result = call_model(model, task.prompt)
    10. if not result.passed_check:
    11. result = call_model("large", task.prompt)
    12. return result

    The business side needs to implement call_model and passed_check. The key to routing is defining clear escalation conditions, so that not every request goes to the most expensive model.

    Step 5: Monitor continuously. Track daily call volume, token consumption, failure rate, and cost per task. Collect call records through a logging service and set cost thresholds with monitoring alerts, notifying owners promptly when budgets are exceeded.

    7. Common Pitfalls

    Pitfall 1: Looking only at unit price. A low unit price does not mean a low cost per task, for the reasons explained above.

    Pitfall 2: Looking only at leaderboard scores. Leaderboard questions may differ substantially from business scenarios; decisions should be based on internal evaluation.

    Pitfall 3: Ignoring retries and context length. Repeatedly sending long documents to the model causes input tokens to grow rapidly, and retries multiply the cost.

    Pitfall 4: Ignoring latency and stability. If a low-cost model responds slowly or is frequently rate-limited, the cost of human waiting and system timeouts can offset part of the savings.

    Pitfall 5: Ignoring differences in billing rules. Different services have different billing units, caching discounts, and tiered pricing. Normalize everything to the same basis before comparing.

    8. Conclusion

    Model selection is fundamentally a multi-objective trade-off. Cost per task unifies parameter scale, post-training quality, and reasoning length onto a single cost scale, making comparisons closer to real business consumption.

    Enterprises can first build an internal evaluation, then observe the capability-cost frontier on a logarithmic axis, and finally assign the right tasks to the right models through a routing strategy. As long as the measurement methodology is consistent and the data is reproducible, teams can make verifiable decisions within budget constraints.