Evaluating LLM Cost-Effectiveness: From Cost Per Call to Task Completion

    This article redefines the cost-effectiveness of large language models as the cost per unit of effective output rather than the price per call. It explains how to control variables for reproducible model comparisons, design high-discrimination tasks with executable assertions, score results across five quantifiable dimensions, and build a cost model that stays stable when prices change. Readers will find a minimal evaluation skeleton, routing and budget strategies, common pitfalls, and a practical rollout process for turning model selection into a repeatable report instead of a debate.

    1. Redefining the Problem: Cost-Effectiveness Is Not the Unit Price, but the Cost per Unit of Effective Output

    When a class of LLM services changes its pricing significantly, many teams immediately recalculate their bills and conclude that “a certain model has become more expensive.” That conclusion is mathematically correct but offers almost no engineering guidance. The question that actually matters is: for a given task, what is the total cost of producing a result of the same quality?

    The total cost includes at least four parts: first, the cost of input and output tokens; second, the cost of repeated calls and iterations required to reach a usable result; third, the rework cost caused by failures, timeouts, and invalid formatting; and fourth, the human cost of integration, debugging, and operations on the engineering side. The unit price affects only the first item, while in real projects the second and third items are often the most volatile.

    This article therefore defines cost-effectiveness as:

    1. Cost-effectiveness = Task completion / (First-pass cost + Iteration cost + Rework cost + Integration and operations cost)

    This definition leads to two direct implications. First, a model with a lower unit price that needs three rounds to converge may be more expensive than a model with a higher unit price that passes in one round. Second, any “leaderboard-style” conclusion detached from a specific task is not transferable and must be remeasured in the context of the target scenario.

    2. Controlling Variables: Making Comparisons Reproducible

    The most common mistake in model comparisons is having too many variables. To reach a credible conclusion, you need to fix at least the following categories of variables.

    Use a unified prompt. All candidate models must receive exactly the same input, including system instructions, task description, and acceptance criteria. Once a prompt has been “adaptively tuned” for one model, the comparison is invalid.

    Use a unified runtime environment. The approach in the original article is worth borrowing: have multiple models execute the task under the same AI coding tool or the same scaffold, so that differences in the toolchain are not mistaken for differences in model capability. In engineering terms, this layer can be understood as an “execution shell” responsible for reading and writing files, executing commands, and returning runtime results.

    Use a unified acceptance method. The task must have objective pass conditions, such as “the page is accessible,” “a specified interaction can be triggered,” or “a metric value falls within a range,” rather than relying on subjective impressions.

    Use a unified budget cap. Give every model the same maximum number of rounds and the same maximum token budget, and observe which one converges within budget. A comparison without a budget constraint is equivalent to allowing unlimited rework, and its conclusion will inevitably be distorted.

    A minimal executable evaluation skeleton looks like this:

    1. def evaluate(model_client, prompt, verifier, max_rounds=3, budget_tokens=6_000_000):
    2. total_tokens, rounds = 0, 0
    3. history = []
    4. while rounds < max_rounds:
    5. rounds += 1
    6. resp = model_client.run(prompt, history)
    7. total_tokens += resp.usage.total_tokens
    8. history.append(resp)
    9. if verifier(resp.artifacts):
    10. return {"pass": True, "rounds": rounds, "tokens": total_tokens}
    11. return {"pass": False, "rounds": rounds, "tokens": total_tokens}

    With this table, model selection discussions shift from “I think” to “the data shows.”

    3. Task Design: Compressing Variables with a High-Discrimination Task

    To expose differences in capability across models, the task itself needs three characteristics: it can be automatically verified, it contains implicit constraints, and it requires multiple rounds of self-correction. The “interactive trading sandbox mini-game” used in the original article satisfies all three: it requires a runnable interface and interactions, it requires implementing several behavior patterns with explicit numerical goals, and it implicitly requires the basic correctness of market mechanics.

    Abstracted out, the structure of this kind of task is:

    • An interactive interface, used to verify end-to-end runnability;
    • Several numerical goals, used to verify logical correctness rather than visual correctness;
    • Multiple parameterized behavioral entities, used to verify abstract modeling and configuration capabilities;
    • Implicit domain constraints, used to verify whether the model proactively fills in common-sense premises.

    When designing the task, it is recommended to write acceptance conditions as executable assertions, for example:

    1. Assertion 1: No console errors appear after the page loads
    2. Assertion 2: A parameter panel exists, and parameter changes take effect immediately
    3. Assertion 3: The three types of behavioral entities exhibit distinguishable statistical characteristics under given parameters
    4. Assertion 4: A clear status feedback is provided when the target value is reached

    It is worth emphasizing that the task should retain only generic technical semantics and should not be bound to any specific product or tool name, so that it can be reused as an internal benchmark over the long term.

    4. Scoring Dimensions: Breaking “Usable” into Quantifiable Items

    Five dimensions are recommended, with weights adjusted according to actual business needs.

    Task completion. Whether all assertions pass, and the proportion of assertions passed. This is the first-priority item; if it is not passed, the other metrics have limited meaning.

    Iteration rounds. Passing in one round is optimal; every additional round must be multiplied by the actual consumption of that round. Rounds also indirectly reflect the model’s ability to recognize implicit constraints.

    Token efficiency. Focus on total consumption and cache hit rate. Stable parts of the prompt (system instructions, domain descriptions, interface conventions) should be placed at the prefix to increase reuse probability, while variable parts should be placed later. In engineering terms, the following structure can be used:

    1. [Stable prefix] Role, specifications, domain knowledge, interface conventions
    2. [Semi-stable section] Project structure and list of existing files
    3. [Volatile section] New requirements and error logs for the current round

    Failure recovery capability. When a runtime error occurs, can the model locate and fix the issue based on the logs instead of rewriting the entire codebase. This item has a major impact on total cost but is most often overlooked.

    Maintainability of the output. Whether the directory structure is clear, whether configuration is externalized, and whether there is basic validation. Poor maintainability keeps generating interest in subsequent iterations.

    5. Cost Model: Treating Price Fluctuations as the Normal Assumption

    Price adjustments are the norm, and what architects need to do is make the cost model insensitive to price. Three practices are relatively effective.

    First, tiered routing. Classify tasks by difficulty: simple and high-frequency requests go to a low-cost tier, while complex and low-frequency requests go to a high-capability tier. Routing can be based on observable features such as input length, whether code is included, and historical failure rate.

    1. def route(req):
    2. if req.is_simple and req.history_fail == 0:
    3. return "tier_low"
    4. if req.has_code or req.history_fail >= 1:
    5. return "tier_high"
    6. return "tier_mid"

    Second, budgets and circuit breaking. Set token and round limits for a single task; when a limit is exceeded, downgrade or hand off to a human to avoid long-tail tasks consuming the budget.

    Third, caching and prefix governance. Put stable content first and volatile content later, cache results for repeated calls, and persist reusable intermediate artifacts (such as interface definitions and data structures) to reduce repeated generation.

    Under this framework, the impact of a price increase for a certain class of services is diluted into a “minor adjustment of routing ratios” rather than a “complete redesign of the overall solution.”

    6. Common Pitfalls

    Looking only at the unit price. Ignoring rounds and rework often reverses the conclusion.

    Replacing assertions with subjective experience. A good-looking UI does not mean correct logic; automatic verification is required.

    Customizing prompts for a single model. This makes the comparison meaningless and also creates hidden lock-in during migration.

    Ignoring caching and context organization. With the same model, different context arrangements can cause several-fold differences in consumption.

    Treating one evaluation as a permanent conclusion. Both models and prices change, so the benchmark should be solidified into a pipeline and regression-tested regularly.

    Step one: build three to five internal benchmark tasks covering high-frequency scenarios such as code generation, data processing, and document extraction, and write automatic assertions for each task. Step two: integrate the evaluation scripts into continuous integration, automatically running a round whenever a candidate model or price changes, and output completion, rounds, tokens, and converted cost. Step three: set routing policies and budget thresholds based on the results. Step four: review the weights once per quarter, because business priorities shift.

    Once this process is in place, “which one is more cost-effective” is no longer a question that needs to be argued about, but a report that can be checked at any time.