How to Evaluate the Real Cost of LLMs When Model Performance Is Close

    When two large language models reach similar output quality, token consumption, retries, and post-processing can make their real operating costs very different. This article explains how to measure token efficiency, latency, failure rates, and cost per valid task. It also covers how to optimize prompts, context, output formats, and model routing for accounting, coding, and data processing workloads.

    Model capability is not only about whether an answer is correct. It also depends on how many computing resources are needed to complete the same task. A recent media test found that a new-generation model and another mainstream model delivered largely similar final results on three types of tasks: custom accounting, coding, and data processing. However, the former consumed noticeably more tokens, and its overall cost was more than five times that of the latter.

    The result is useful less for declaring one model stronger than for reminding developers of something else. Once output quality reaches a similar range, token efficiency, call pipelines, task orchestration, and cost control may become the key factors in whether a system can run at scale.

    1. Why Similar Performance Does Not Mean Equal Usefulness

    Model evaluations usually focus on accuracy, pass rate, or human ratings. For coding tasks, you can check whether a program passes its tests. For data processing tasks, you can verify whether structured output matches expectations. For accounting tasks, you can judge result quality against standard answers, rule checks, and expert review.

    These metrics reflect the quality of the task result. They do not always reflect the cost of producing that result.

    Suppose two models achieve accuracy of 92 and 93 on a thousand tasks. The difference looks small. But if one model consumes an average of 10,000 tokens per task and the other only 2,000, their resource consumption can differ by an order of magnitude under high concurrency. This matters especially for batch report generation, intelligent customer service, code review, and contract parsing, where tens or even millions of calls may happen each day. Small per-call differences add up quickly.

    Therefore, when evaluating a model, enterprises should record at least the following metrics:

    1. Task quality: accuracy, recall, pass rate, format compliance rate, and human satisfaction.
    2. Token consumption: input tokens, output tokens, context tokens, and extra tokens from retries.
    3. Response latency: average latency, P95 latency, and stability during peak hours.
    4. Call success rate: the proportion of timeouts, rate limits, format errors, and service exceptions.
    5. Unit task cost: the average cost of completing one valid task.
    6. Post-processing cost: extra resources used for parsing, validation, human review, and failed retries.

    Only when these metrics appear in the same evaluation table can you draw conclusions that reflect production reality.

    2. Why Tokens Are the Main Source of Cost Differences

    A token is the basic unit of text that a model processes. Chinese characters, English words, numbers, punctuation, and code are split differently, so character count cannot be directly equated with token count.

    The actual consumption of a model call usually includes:

    • the task description from the user;
    • system prompts and role settings;
    • conversation history;
    • document snippets attached through retrieval augmentation;
    • results from tool calls;
    • intermediate reasoning or the final answer generated by the model;
    • failed retries and repeated context transmission.

    In a simple Q&A, input and output may both be short. In enterprise applications, however, systems often put large amounts of rules, business background, history, and document content into the context. Even if the final answer is only a few hundred words, the model may need to read tens of thousands of tokens first.

    Some models also generate longer analysis for complex tasks, or complete tasks through multiple rounds of internal planning, tool calls, and self-checking. These mechanisms help with complex problems. But if a task does not require many reasoning steps, they can waste significant resources.

    High token consumption does not necessarily mean a model is more capable. It may indicate:

    • overly long prompts;
    • conversation history that was not truncated in time;
    • retrieval results containing a lot of duplicate content;
    • output formats without length constraints;
    • the application layer sending the same request repeatedly;
    • the model using an overly complex reasoning path for simple tasks.

    Therefore, cost optimization should begin by examining the call pipeline, not by simply switching models.

    3. Evaluation Priorities for Three Typical Tasks

    1. Accounting and Rule-Based Tasks

    Accounting tasks typically include voucher classification, account matching, invoice field extraction, exception explanation, and report summarization. These tasks have clear rules, high accuracy requirements, and relatively fixed output formats.

    When evaluating them, do not only check whether the model’s explanation reads smoothly. Also check:

    • whether amounts, dates, tax rates, and other fields are accurate;
    • whether debit and credit directions follow business rules;
    • whether account names come from the defined scope;
    • whether decimal precision and totals are correct;
    • whether missing fields are correctly flagged;
    • whether the model clearly recommends manual review when it is uncertain.

    For these tasks, structured output is often more important than long natural language. The application can require the model to return only predefined fields. The program then performs amount checks, enumeration validation, and required-field checks. This reduces redundant text and the risk of error propagation.

    2. Coding and Code Review Tasks

    Correctness in coding tasks cannot be judged from surface text alone. Generated code may be syntactically complete yet still contain boundary condition errors, missing exception handling, resource leaks, or security risks.

    A more reliable evaluation process should include:

    1. having the model generate code from clear requirements;
    2. using automated tests to verify core functionality;
    3. adding boundary, exception, and empty-value cases;
    4. checking how dependencies, permissions, and sensitive information are handled;
    5. measuring the first-pass success rate and the number of revision rounds;
    6. recording total token consumption for each task.

    If one model produces a longer first response but passes more often on the first try, its actual cost may not be worse. Conversely, a short answer that needs several fixes may end up with higher cumulative consumption. For coding tasks, “the total cost to complete one working task” should therefore be the core metric, not a comparison of per-response prices.

    3. Data Processing and Information Extraction Tasks

    Data processing typically involves table parsing, field normalization, classification, deduplication, and summarization. These tasks are highly sensitive to input length, because raw data often contains duplicate columns, irrelevant notes, and formatting noise.

    Evaluation should focus on:

    • field extraction accuracy;
    • the proportion of structured results that can be parsed;
    • consistency of dates, amounts, and codes;
    • the effectiveness of duplicate record detection;
    • stability with large batch inputs;
    • average processing cost per record or per file.

    For large datasets, it is not advisable to submit all content to the model at once. A better approach is to let the program handle pagination, field filtering, basic cleaning, and deduplication first. Then send only the parts that require semantic judgment to the model.

    4. Designing a Fair Model Comparison

    The worst mistakes in model comparison are using a different prompt for each model or testing only a small number of samples. Build a fixed, reproducible test set and define the following clearly.

    Sample Design

    The test set should cover common tasks, difficult tasks, and exceptional cases. Samples should not all come from easy scenarios, or performance will be overestimated. For enterprise applications, add desensitized real business samples to reflect actual input length and data noise.

    Consistent Prompts

    Keep task descriptions, output requirements, context information, and the number of examples as consistent as possible. If a model requires a special prompting approach to work properly, record this difference separately rather than hiding it in the results.

    Automated Result Validation

    Whenever a program can judge the output, avoid relying entirely on manual scoring. JSON format, amount totals, code tests, field enumerations, and length limits can all be checked with automated rules. Human review should focus on semantic quality, explainability, and business usability.

    Record the Full Call Chain

    Experiment logs should store at least the task ID, input tokens, output tokens, response time, whether a retry occurred, error type, final result, and human score. This makes it possible to determine whether high cost comes from overly long output or from failed retries and repeated context.

    5. Engineering Methods for Reducing Token Costs

    Compress System Prompts

    System prompts should keep core information such as role, goal, constraints, and output format. Remove repeated background and decorative descriptions that do not affect results. For stable long-term rules, convert them into concise field constraints and decision flows.

    Reduce Ineffective Context

    A retrieval system should not concatenate all relevant original documents into the prompt. Filter first by keywords, permissions, time, and business type. Then apply snippet deduplication and summary compression. For frequently repeated policy clauses, consider building standardized knowledge snippets.

    Constrain the Output Structure

    If a task only needs a few fields, do not ask the model for a long explanation. A general constraint can look like this:

    ```text
    Return only the following fields:
    {
    “category”: “classification result”,
    “amount”: 0,
    “confidence”: 0,
    “need_review”: false
    }