LLM Cost-Effectiveness: How to Evaluate Architecture, Benchmarks, and Cost per Successful Task

    This article explains how to evaluate the cost-effectiveness of large language models beyond per-million-token pricing. It covers the difference between total and active parameters in sparse MoE models, two approaches to multimodal capabilities, nominal versus usable context windows, and how to interpret aggregate benchmark scores with statistical uncertainty. It also shows how to convert token prices into cost per successful task and how to build an internal evaluation set that tracks pass rate, latency, and unit cost.

    1. Define Cost-Effectiveness First

    Cost-effectiveness is the cost per unit of effective output. Looking only at the price per million tokens misses three things: how many tokens the model actually consumes, whether the output can be used directly, and how many retries are needed after a failure. Model selection should therefore be split into two quantities: cost and quality. They only become meaningful when compared together.

    2. Understanding Sparse-Activation MoE Architectures

    A Mixture of Experts (MoE) model contains multiple expert subnetworks and a router. When each token enters the model, the router selects only a few expert groups to participate in computation. This decouples the model’s total parameter count from the compute used per token.

    Two numbers need to be distinguished:

    • Total parameters: determine the model’s capacity and knowledge coverage, as well as the GPU memory or storage volume required for deployment.
    • Active parameters: the parameters that actually participate in each forward pass, directly related to inference latency and compute consumption.

    A conclusion follows: the deployer bears memory cost for the total parameters, while the user mainly bears compute cost for the active parameters. A model with a large total parameter count but a low active ratio may have a throughput advantage, but its memory requirements are still significant.

    1. def active_ratio(total_params_b, active_params_b):
    2. """Active ratio = active parameters / total parameters"""
    3. return active_params_b / total_params_b
    4. # The numbers below are arithmetic demonstrations only, not real parameters of any specific model
    5. print(f"Active ratio: {active_ratio(300, 20):.1%}")

    3. Two Paths to Multimodal Capabilities

    There are two common multimodal approaches.

    The first is a concatenated approach: train a text language model first, then attach an independent vision encoder and use an adapter layer to map image features into text space. This approach iterates quickly and reuses existing language model work.

    The second is native multimodal pretraining: images, video, and text are trained jointly in the same pretraining stage. The industry generally considers this approach to have better consistency in cross-modal reasoning, but training costs are higher and data engineering is more complex.

    Model selection can be based on the business shape. If the business only processes text, multimodal capability brings no benefit and there is no need to pay for it. If the business involves screenshots, documents, charts, or video, test three areas separately: chart understanding, text recognition, and temporal understanding. Do not rely only on a vendor’s capability list.

    4. Nominal vs. Effective Context Window

    The nominal context window is the upper limit of input a model can receive. It does not mean that information at every position can be used accurately. A common finding in long-text research is that recall for information in the middle is lower than for information at the beginning and end.

    The evaluation method is to insert known facts at different lengths and positions—the commonly called “needle in a haystack” test—and then record the curve of recall as length changes. The curve’s inflection point is usually the model’s practical usable length range.

    In addition, long context is billed by input tokens, and the charge repeats on every call. Stuffing an entire document into the context is not necessarily cheaper than retrieving first and then feeding the relevant parts. Retrieval-augmented generation (RAG) is a common alternative, and it requires a tradeoff between accuracy and cost.

    5. How to Interpret Aggregate Benchmark Scores

    A composite index is usually a weighted or averaged result of several sub-benchmarks. Two models with the same overall score do not necessarily have the same score on every sub-item. When interpreting scores, consider the following points.

    1. Look at sub-scores first. Among coding, mathematical reasoning, instruction following, long text, and multimodal sub-items, prioritize the one closest to your business.
    2. Calculate statistical error. With limited sample sizes, score differences may be only random fluctuation.
    3. Check evaluation conditions. The benchmark set version, prompt template, whether tool calling is allowed, sampling temperature, and other conditions can all change results. Comparisons must use the same settings.
    4. Distinguish “on par” from “better.” When scores are the same or differ only slightly, describe the result as “close,” not as evidence of a lead.

    Take the pass rate on 200 questions as an example. The statistical method is as follows.

    1. import math
    2. def pass_rate_ci(passed, total, z=1.96):
    3. """Calculate pass rate, standard error, and 95% confidence interval (normal approximation)"""
    4. p = passed / total
    5. se = math.sqrt(p * (1 - p) / total)
    6. return p, se, (p - z * se, p + z * se)
    7. p, se, (low, high) = pass_rate_ci(120, 200)
    8. print(f"Pass rate {p:.1%}, standard error {se:.1%}, 95% interval [{low:.1%}, {high:.1%}]")

    The results show that with a pass rate of 60%, the standard error is about 3.5 percentage points, and the 95% confidence interval is about 53% to 67%. If two models differ by 2 percentage points, they cannot be distinguished at this sample size.

    6. Convert Unit Price into Cost per Successful Task

    The formula for cost per call is:

    Cost per call = (input tokens × input price + output tokens × output price) / 1,000,000

    The formula for cost per successful task is:

    Cost per successful task = cost per call / success rate

    If a task requires multiple calls or human review, the review cost must also be included.

    1. def cost_per_success(price_in, price_out, avg_in, avg_out, success_rate):
    2. """price_in and price_out are prices per million tokens in the same currency; other parameters are illustrative assumptions"""
    3. call_cost = (avg_in * price_in + avg_out * price_out) / 1_000_000
    4. return call_cost / success_rate
    5. print(round(cost_per_success(2.0, 8.0, 3000, 800, 0.85), 5))

    Three points require attention. First, output token prices are usually higher than input prices, so tasks with longer outputs have a different cost structure from tasks with longer inputs. Second, billing rules for cache hits, batch calls, and similar mechanisms are subject to the provider’s documentation and should not be assumed from experience. Third, limited-time discounts represent prices only during a certain period; long-term model selection should use standard prices.

    7. Build Your Own Evaluation Set

    Public benchmark scores cannot replace internal business testing. An evaluation set can be built in the following steps.

    1. Sample 100 to 300 cases from real business scenarios, covering common cases and edge cases.
    2. Define automatically judgeable criteria for each sample, such as whether fields are correct, whether code passes unit tests, and whether the answer contains the required key points.
    3. Run candidate models with the same prompts and parameters, and record output content, token usage, and response latency.
    4. For tasks with strong subjectivity, use blind review and hide model names to reduce preference interference.
    5. Summarize pass rate, average latency, and cost per successful task, and evaluate all three together.

    Below is a basic skeleton for running an evaluation.

    1. import time
    2. def run_eval(model_call, cases, judge):
    3. """model_call returns (output_text, usage_dict); judge returns a boolean"""
    4. results = []
    5. for case in cases:
    6. start = time.perf_counter()
    7. output, usage = model_call(case["prompt"])
    8. latency = time.perf_counter() - start
    9. results.append({
    10. "passed": judge(case, output),
    11. "input_tokens": usage.get("input_tokens"),
    12. "output_tokens": usage.get("output_tokens"),
    13. "latency_seconds": latency,
    14. })
    15. return results