Multi-Model Evaluation: How to Balance Token Costs and Performance Gains

    When integrating multiple large language models into enterprise workflows, billing rates can vary significantly. This article explores a reproducible evaluation method to compare the trade-off between model costs and output quality. It covers controlling variables during testing, designing tasks for long-text extraction and content generation, normalizing quality metrics to calculate actual costs including retries and manual rework, and implementing a routing strategy that prioritizes safety over cost.

    When enterprises integrate multiple large language models into internal workflows or AI-assisted workbenches, the differences in billing rates can be substantial. For instance, the rate for a lightweight model might be as low as 0.01x, while a high-performance flagship model could reach 0.08x or higher. These numbers are merely examples of relative rates; different platforms have varying pricing models, so actual selection should be based on your own billing data.

    The real question is: how much does the delivery quality differ when the same business requirement is met using models with different rates? Answering this requires a reproducible evaluation method. Below, we explain this from four perspectives: evaluation premises, task design, cost calculation, and routing strategy.

    1. Control Variables Before Comparing Models

    The most common mistake in multi-model comparison is changing both the model and the test questions simultaneously. If each model receives different materials or prompts, the output variance cannot be attributed to the model itself. Before evaluation, the following must be fixed:

    1. Consistent Input Materials: In the same test round, all models must read the exact same reference documents, datasets, and RAG retrieval fragments. Retrieval results should be recorded to prevent retrieval fluctuations from interfering with the conclusions.
    2. Unified Prompts: All models use the same instruction template without individual optimization for any specific model. The template version number must be written into the evaluation record.
    3. Fixed Runtime Parameters: Temperature should be set to the same low value, maximum output length should be consistent, and platforms supporting random seeds should have the seed fixed. The specific version number of each model should also be recorded.
    4. Sufficient Sample Size: Prepare at least 30 samples per task category, covering short text, long text, and edge cases. With too few samples, one or two anomalous outputs can change the ranking.

    2. Design and Acceptance of Two Typical Tasks

    Enterprise daily applications can generally be divided into two types of tasks, which have very different acceptance methods.

    Task 1: Long-Text Information Extraction

    Input a document containing complex business rules, uniformly slice it according to rules, and hand it to the model to extract entities, time nodes, and operation instructions according to a predefined JSON Schema. The acceptance checklist includes:

    • Key Information Recall Rate: The proportion of standard answers manually annotated that are extracted.
    • Field Accuracy: Whether the value of each field matches the standard answer.
    • JSON Parse Rate: Whether the output can be read by a standard parser.
    • Factual Consistency: Whether the output contains content not in the original text, i.e., the hallucination rate.

    JSON parsing and field comparison are automatically completed by scripts. Semantic fields are independently scored by two annotators, and disputed samples are arbitrated by a third person. Failed samples are archived by type, including format errors, missed extractions, wrong extractions, hallucinations, and omissions in the latter parts of long texts. Counting the proportion of each failure type provides better guidance for subsequent optimization than just looking at the total score.

    Task 2: Professional Copywriting Generation

    Give the model a set of scattered data, a core theme, and an industry glossary, requiring it to generate a report that complies with industry standards. Such tasks are difficult to fully judge with scripts, so acceptance can be broken down into the following items:

    • Term Hit Rate: Whether the words required by the glossary appear and whether there is misuse.
    • Data Citation Consistency: Whether the numbers in the text match the input data.
    • Structural Integrity: Whether the agreed-upon sections are included.
    • Manual Blind Evaluation Score: Hide the model names, have three reviewers score from 1 to 5 each, and take the median.
    • Rework Duration: The number of minutes editors spend modifying it to a deliverable state.

    Rework duration is the most important cost metric for this type of task because it directly reflects manual labor costs.

    3. Normalize Before Calculating Costs

    Some people use “quality score divided by billing rate” to compare models, but this approach has two problems. First, accuracy, format compliance rate, and fluency score have different dimensions, so adding them directly is meaningless. Second, it ignores retry costs and manual rework costs after failure. A more reasonable approach is divided into two steps: first, normalize the quality metrics to a value between 0 and 1 and set weights, then calculate the total cost per qualified output.

    The quality score can be written as:

    Quality Score = 0.5 × Key Metric Score + 0.3 × Format Compliance Rate + 0.2 × Normalized Manual Blind Evaluation Score

    The weights are just examples and should be determined by the business party based on their tolerance for errors.

    The cost per qualified output can be written as:

    Cost per Qualified Output = (API Fee + Retry Fee + Manual Rework Cost) / Number of Qualified Outputs

    Below is a set of hypothetical numbers to illustrate the calculation method, which does not represent any actual test results. Assume the lightweight model is billed at 1 unit per call, with a rate of 0.01x corresponding to 0.01, and the high-performance model corresponds to 0.08.

    In the information extraction task, the qualified rate of the lightweight model is 85%, and that of the high-performance model is 95%. The failed results of the lightweight model can be repaired by rule scripts, and the repair cost is very low. The API cost per qualified output for both is approximately 0.0118 and 0.084 respectively, making the lightweight model about 7 times cheaper.

    In the copywriting generation task, suppose only 30% of the lightweight model’s outputs are directly deliverable, requiring an average of 20 minutes of manual modification per article; the high-performance model has a deliverable rate of 80%, with an average of 5 minutes of modification per article. The API difference between the two is 0.07 units, and the manual time difference is 15 minutes. The lightweight model is only more cost-effective if the converted cost of one minute of manual time is less than 0.07 divided by 15, which is about 0.0047 units. The value of manual time is usually much higher than this number, so the high-performance model is often more cost-effective.

    This example shows that the selection conclusion depends on the manual cost standard in the business. Without manual cost data, one cannot conclude that “low-rate models are always more economical.”

    4. Routing Dispatch: Safety Strategy Prioritizes Cost Strategy

    Based on the evaluation results, a routing mechanism categorized by task can be established. The routing rules should follow one premise: safety strategy prioritizes cost strategy.

    1. Task Classifier: Before the request enters the model, a lightweight classifier first determines the task type and gives a complexity score. The cost and accuracy of the classifier itself must also be included in the evaluation.
    2. Tiered Routing: Tasks with clear intentions and high error tolerance, such as structured extraction and data cleaning, are routed to low-rate models. Open-ended generation, complex reasoning, and long-text writing are routed to high-rate models.
    3. Failure Handling:
      • Content Safety Block: Immediately terminate generation and do not switch to another model for retry. Record the audit log, transfer to manual review, and return a unified prompt to the user according to platform regulations. Downgrading a safety block to a low-rate model is equivalent to bypassing safety judgment, which is unacceptable.
      • Timeout, Rate Limiting, or Temporary Service Error: Retry a limited number of times, e.g., up to twice, using exponential backoff. If it still fails, downgrade to a backup model.
      • Non-safety Format Validation Failure: First attempt to repair using rule scripts; if repair fails, retry once; if it still fails, transfer to manual processing.
    4. Audit and Logging: Each call should record the model name, version number, prompt version, input and output token counts, and routing reason. Avoid saving sensitive original text in logs that exceeds policy scope.

    Below is the pseudocode for routing and failure handling. The threshold of 0.7 is a hypothetical value and should be calibrated with evaluation data:

    1. MAX_RETRY = 2
    2. SAFETY_BLOCKED = "content_safety_blocked"
    3. RETRYABLE = ("timeout", "rate_limited")
    4. def route_model(task_type, complexity_score):
    5. # complexity_score ranges from 0 to 1, the 0.7 threshold needs calibration with evaluation data
    6. if task_type in ("extraction", "cleaning") and complexity_score < 0.7:
    7. return "lite_model_0.01x"
    8. if task_type in ("creative_writing", "complex_reasoning") or complexity_score >= 0.7:
    9. return "advanced_model_0.08x"
    10. return "default_model"
    11. def call_with_policy(task_type, complexity_score, call_model):
    12. model = route_model(task_type, complexity_score)
    13. for attempt in range(MAX_RETRY + 1):
    14. result = call_model(model)
    15. if result.error == SAFETY_BLOCKED:
    16. write_audit_log(model, task_type, reason=SAFETY_BLOCKED)
    17. return escalate_to_human() # No downgrade, no model switching
    18. if result.error in RETRYABLE:
    19. sleep_with_backoff(attempt)
    20. continue
    21. if result.error is None and not result.format_valid:
    22. repaired = repair_by_rules(result)
    23. if repaired.format_valid:
    24. return repaired
    25. if result.error is None:
    26. return result
    27. return escalate_to_human()

    5. Conclusion

    The core of multi-model selection is to compare cost and quality on the same standard. During evaluation, control inputs and prompts; during acceptance, break down quality into measurable metrics; when calculating costs, include retries and manual rework. Conclusions drawn using this method are only valid under the specific data, tasks, and cost standards used. Changing a batch of business data or a set of manual cost standards may change the conclusion, so the evaluation should be repeated after every model or price adjustment.