Chinese LLM Evaluation and Inference Cost Optimization in Practice

    This article presents a practical framework for evaluating Chinese large language models (LLMs) by looking at both model quality and inference cost. It explains why a single benchmark score can be misleading, how the average cost per question is actually calculated (including input tokens, output tokens, retries, and context management), and the key principles for building a representative evaluation set. It then walks through engineering strategies for reducing inference cost—prompt compression, context trimming, output length control, request routing, semantic caching, and batching—alongside regression testing, production monitoring, cost governance, and how to turn evaluation results into model selection decisions. Developers and teams will learn to combine evaluation, cost analysis, and engineering governance into a repeatable method that supports real business decisions rather than guesswork.

    1. Why Chinese LLM Evaluation Must Look at Both Quality and Cost

    As large models are increasingly used in content generation, knowledge Q&A, code assistance, and document understanding, enterprises and developers face a practical question: how to judge whether a model truly fits a business need and how to balance quality, latency, stability, and cost. In the past, many teams chose models mainly by referencing public benchmark scores. Yet in real production, factors such as task distribution, input length, output length, call frequency, and failure retries all have a significant impact on the final cost. Building an evaluation and cost-optimization method oriented to actual business is therefore more valuable than simply chasing a single leaderboard.

    The purpose of Chinese LLM evaluation is not just to produce a ranking, but to help teams understand where a model is suitable within specific tasks. Different tasks place very different demands on a model: information extraction prioritizes structural stability and field accuracy; content generation prioritizes factuality, tone, and editability; code assistance prioritizes syntactic correctness and context consistency; and long-document understanding involves retrieval, summarization, multi-hop reasoning, and context compression.

    If you choose a model based on a single composite score, you tend to overlook three issues. First, whether the evaluation set matches the business distribution. Public evaluation sets usually cover general capabilities, but real business involves many long-tail questions. Second, whether the evaluation only focuses on accuracy. Many businesses also care about output format, compliance risk, user satisfaction, response latency, and retry rate. Third, whether the evaluation covers cost. Even when model quality is similar, different calling patterns can produce cost differences of several times.

    A more reasonable approach is to split evaluation into three layers: the capability layer, the engineering layer, and the business layer. The capability layer asks whether the model completes the task correctly. The engineering layer asks whether the call chain is stable, whether logs are complete, and whether timeouts are controllable. The business layer asks about user experience and conversion gains. Only when all three layers pass is a model genuinely ready for production.

    2. How the Average Cost per Question Changes: An Abstract Case

    During model version iteration, cost changes often affect business decisions more directly than quality improvements. Consider an abstracted evaluation case: on the same set of Chinese tasks, Model A has an average cost of about RMB 1.90 per question, roughly 87% lower than the previous generation; Model B has an average cost of about RMB 2.52 per question, roughly 28.5% lower than its preview version. Here, “average cost per question” is not a single billing unit price. It is the real consumption that combines input tokens, output tokens, number of retries, context length, and call success rate.

    This kind of data illustrates two points. First, a cost reduction may come from improved inference efficiency, or it may come from optimized calling strategies. Second, the cost gap between models cannot be attributed simply to differences in parameter size; it also depends on the task type and output length. For generation tasks, output tokens often matter more than input tokens, because the model must generate content segment by segment. For retrieval-based Q&A tasks, the input context may be very long, so input token cost dominates. For structured extraction tasks, the output is short but the format is strict, so retry and validation costs must also be counted.

    For this reason, an evaluation report should not only state a “price per thousand tokens.” It should give business-oriented metrics such as “average cost per question,” “cost per hundred successful calls,” and “cost per thousand business records.” Only then can a team judge whether a model is really a better fit for the current business, rather than making a decision based on the impression from a single test.

    3. Key Principles for Building a Chinese LLM Evaluation Set

    The design of the evaluation set determines whether the conclusions are trustworthy. A high-quality Chinese LLM evaluation set should be representative, stable, interpretable, and extensible.

    1. Representativeness

    Evaluation tasks should come from real business or something close to it. For example, knowledge Q&A tasks can cover policy interpretation, product documentation, and FAQs; generation tasks can cover headline writing, summarization, rewriting, and customer-service replies; extraction tasks can cover order information, form fields, and contract clauses. Tasks should not consist only of easy samples; they should include a certain proportion of edge cases and failure cases.

    If the evaluation set contains only easy questions, a model may look excellent, but its performance can drop noticeably in production when it encounters complex phrasings, ambiguous expressions, or multi-turn follow-ups. The task set therefore needs to cover high-frequency scenarios, low-frequency scenarios, and risk scenarios.

    2. Stability

    The evaluation set should stay on a stable version as much as possible, so that results before and after remain comparable. It also helps to maintain both a fixed regression set and a dynamic exploration set. The fixed regression set is used for comparisons between versions, while the dynamic exploration set is used to discover new scenarios and new problems.

    A fixed regression set works like a baseline test suite in software testing, giving a consistent reference after every model update. A dynamic exploration set works like a supplementary probe into the production environment, helping the team discover new business needs and potential issues.

    3. Interpretability

    Every question should have a reference answer, a scoring rule, and an error type. Scoring rules can include exact match, fuzzy match, and field extraction accuracy, and can also incorporate manual spot checks. For open-ended generation tasks, it is better to use multi-dimensional scoring—such as relevance, completeness, accuracy, tone, and format compliance—rather than judging only overall quality.

    The key to interpretability is making evaluation results actionable for optimization. If a model only has a lower composite score, the team cannot tell whether the problem comes from a comprehension error, an output-format error, or poor context organization. But if results are broken down by error type, the team can locate the improvement direction much faster.

    4. Extensibility

    Business needs keep changing, so the evaluation set must be able to add new questions, retire outdated ones, and mark difficulty levels. By tagging each question—for example, with business scenario, input length, output type, and risk level—you can later slice subsets on demand and observe how the model performs under different conditions.

    For instance, if the same set of models performs stably on short-text Q&A but omits information in long-document summarization, you need to build a dedicated long-text subset so that an overall average does not hide local problems.

    4. How Token Costs Are Calculated and Common Pitfalls

    When estimating LLM costs, many teams focus only on the model’s unit price and overlook the actual calling pattern. A more rigorous approach breaks cost down into input cost, output cost, failure-retry cost, context-management cost, and human-review cost.

    A simplified illustrative formula:

    Average cost per question = (total input tokens × input price + total output tokens × output price + retry tokens + auxiliary pipeline processing cost) ÷ number of successful questions

    The key here is that the numerator and denominator must use a consistent definition. If you count only successful requests but include failed retries in the denominator, you will underestimate cost; if you count all requests as successful questions, you will overestimate effectiveness. In real engineering, it is best to record the number of requests, successes, failures, retries, and final human confirmations at the same time.

    A simplified pseudocode example:

    1. function evaluate(cases, model_call, scorer):
    2. total_cost = 0
    3. total_score = 0
    4. success_count = 0
    5. for case in cases:
    6. result = model_call(case.prompt, case.config)
    7. cost = result.input_tokens * input_price
    8. + result.output_tokens * output_price
    9. + result.retry_tokens * retry_price
    10. if result.failed:
    11. record_failure(case.id, result.reason)
    12. continue
    13. score = scorer(case, result.output)
    14. total_score = total_score + score
    15. total_cost = total_cost + cost
    16. success_count = success_count + 1
    17. average_cost = total_cost / success_count
    18. average_score = total_score / success_count
    19. return report(average_cost, average_score, failure_rate)

    This pseudocode expresses a core principle: cost calculation must be analyzed together with successful samples, failed samples, and retry counts; otherwise, the real business expense cannot be explained.

    Common pitfalls include: looking only at input tokens and not output tokens; counting only successful calls and not failed retries; counting only model-call fees and not the cost of the surrounding pipeline; and evaluating a single request without accounting for the cumulative consumption of multi-turn conversations and long contexts. All of these distort cost estimates.

    5. Common Engineering Strategies for Reducing Inference Costs

    Without sacrificing business usability, cost optimization is usually not a single action but a combination of strategies.

    1. Prompt Compression

    Redundant explanations, repeated instructions, and overly long examples in a prompt increase input tokens. You can reduce natural-language filler with a structured prompt, splitting the task into five parts: role, goal, constraints, input, and output format. For high-frequency tasks, you can abstract the fixed instructions into system-level configuration to avoid passing them repeatedly each time.

    Prompt compression is not about simply cutting text shorter; it is about increasing information density. For example, rewriting “Please write, based on the following material, a summary in fairly professional but not overly complex language suitable for business readers, keeping it concise and objective” into “Role: business-summary assistant; Goal: generate a summary from the material; Constraints: objective, concise, avoid exaggeration; Output: within 150 words” reduces redundant phrasing and makes later maintenance easier.

    2. Context Trimming

    Long contexts can improve some tasks but also significantly increase input cost. A layered strategy can help: first narrow the scope through retrieval, then pass only the most relevant fragments to the model; or compress progressively by heading, paragraph, and summary. For contracts, reports, and knowledge-base Q&A, you should evaluate the cost-and-quality difference between using the “full original text” and using “retrieved fragments.”

    If the model has to read large amounts of full text every time, cost grows linearly with document length. Conversely, if you first filter relevant fragments with retrieval or rules and then let the model answer based on those fragments, you can usually reduce input cost and cut interference from irrelevant content.

    3. Output Length Control

    The longer the output, the higher the cost. Where the business allows, you can set limits on word count, number of paragraphs, or number of fields. For tasks such as customer-service replies, headline generation, and summarization, defining explicit output boundaries is often more effective than a vague request.

    Many teams pay attention only to whether the input is too long and overlook output bloat. If the model produces long explanations even for simple questions, it not only raises cost but also hurts the reading experience. Output length should therefore be treated as an evaluation metric in its own right, not a secondary concern.

    4. Routing and Tiered Model Calls

    Tasks differ in difficulty, and not all of them need an expensive model. Requests can be split into simple, medium, and complex: simple questions go to a lightweight model or a rules engine; medium questions go to a standard model; and only complex questions go to a higher-capability model. The routing policy can be designed based on question classification, confidence, input length, or user tier.

    The key to routing is accurately identifying task complexity. If the classifier is too conservative, it wrongly sends complex questions to the lightweight model, degrading quality; if it is too aggressive, it sends even simple questions to the expensive model, wasting budget. Routing rules therefore also need to be evaluated and optimized.

    5. Semantic Caching

    For repeated phrasings or similar requests, you can build a caching mechanism. The cache key should not rely on the original text alone; it should combine intent, scenario, and output format to avoid incorrect hits. For time-sensitive content, you need an expiration policy to prevent the cache from returning stale results.

    Semantic caching suits high-frequency, repetitive, stable-answer scenarios—for example, FAQs, standard explanations, and fixed-template generation. But caching is not suitable for every task. If business answers change over time, or if user inputs differ in subtle but critical ways, the hit rules need careful design.

    6. Batching and Asynchrony

    If the business tolerates some latency, batching can reduce call volatility and repeated initialization overhead. Tasks such as offline document summarization, batch tag generation, and historical data cleaning can use an asynchronous queue so the system processes work smoothly according to capacity. For real-time Q&A, you need to trade off latency against cost.

    The advantage of batching is higher resource utilization and lower peak pressure. But batching also introduces latency, so you must choose a synchronous, semi-asynchronous, or fully asynchronous mode according to the business SLA.

    6. Regression Testing Across Model Versions

    After a model version is updated, you cannot look only at the overall score; you must also watch for local regressions in specific metrics. Common regression issues include worse format adherence, omissions in long-text summarization, declining factuality, unstable sensitive-content detection, and abnormal output length.

    A recommended regression process:

    1. Fixed-version evaluation set

    Run the fixed evaluation set before each release, recording accuracy, format-compliance rate, average output length, average latency, and average cost.

    1. Layered comparison

    Compare by task type, difficulty, input length, and user scenario separately, so that an overall average does not hide local problems. For example, if overall accuracy improves by 1% but a high-risk scenario drops by 2%, the model may not be suitable for launch.

    1. Cost regression

    Beyond quality, record the token consumption and estimated cost of each call. If a model upgrade improves quality but raises the average cost too much, you need to assess whether the business gains cover the cost.

    1. Small-traffic validation

    Even if offline tests pass, you should observe real user behavior in a small-traffic environment. You can track business metrics such as clicks, adoptions, edits, complaints, and handoffs to human agents to judge whether the model’s output is genuinely valuable.

    The goal of regression testing is not to prove that a new version is definitely better, but to surface potential regressions and make the release decision more controllable.

    7. Production Monitoring and Cost Governance

    Evaluation is not a one-time action but an ongoing governance process. The production environment needs monitoring and alerting, covering at least call success rate, average latency, average output length, per-user cost, repeat-request rate, distribution of failure reasons, and the proportion of abnormal outputs.

    You can rely on general cloud capabilities for the underlying infrastructure. For example, a log service can record request summaries and error types, monitoring and alerting can observe call fluctuations, object storage can hold evaluation samples and reports, a message queue can enable asynchronous batch processing, and a container platform can host evaluation tasks or an inference gateway. For organizations deployed on platforms such as Baidu AI Cloud, a similar approach can be applied: unify evaluation data, the call chain, and monitoring metrics to form a traceable, reproducible, and auditable closed loop.

    For cost governance, it is advisable to set budget thresholds for different business lines. When daily call cost, per-scenario average cost, or the growth rate of output tokens exceeds a threshold, trigger an alert and move to manual review. This prevents a single misconfiguration or abnormal traffic spike from causing large waste.

    Cost governance should also pay attention to abnormal samples. For example, some inputs may trigger the model to generate extremely long content, or some complex tasks may raise the retry rate. Identifying these anomalies through monitoring lets you promptly optimize prompts, context strategies, or call parameters.

    8. Turning Evaluation Results into Model Selection Decisions

    After evaluation is complete, the team needs to turn results into executable decisions. A decision matrix can be built around four dimensions.

    1. Quality

    Look at task accuracy, format-compliance rate, human-adoption rate, and the rate of risky issues. For high-risk scenarios, do not look only at average accuracy; also check whether the worst case is controllable.

    2. Cost

    Look at average cost per question, per-user cost, cost per thousand successful calls, and peak cost. Lower cost is not always better; it should be as controllable as possible while still meeting business goals.

    3. Engineering

    Look at call success rate, average latency, timeout rate, retry rate, and log traceability. An LLM application is not a one-time call but a long-running system service, so engineering stability matters greatly.

    4. Business

    Look at user satisfaction, conversion rate, human-replacement rate, content edit rate, and service-complaint rate. Technical metrics ultimately serve business outcomes; if users need extensive edits before they can use the output, a high model score does not necessarily mean it is truly efficient.

    In practice, a model that is best on every dimension rarely exists. The key to the decision is therefore not to find an absolute champion, but to match the constraints of the current business. For high-frequency, low-risk, cost-sensitive scenarios, prefer a lightweight or low-cost model; for low-frequency, high-risk, complex-reasoning scenarios, keep a high-capability model and add human review.

    9. Common Pitfalls and Recommendations

    Pitfall 1: Looking only at the average score. Recommendation: add statistics broken down by scenario, difficulty, and input length.

    Pitfall 2: Evaluating only with easy questions. Recommendation: add edge-case, conflicting, long-text, and risk samples.

    Pitfall 3: Ignoring output length. Recommendation: bring output length into cost and quality analysis, and observe whether output bloat brings any benefit.

    Pitfall 4: Ignoring failure retries. Recommendation: treat failure rate, retry count, and timeout count as core engineering metrics.

    Pitfall 5: Treating one evaluation as final. Recommendation: establish version regression, online canary rollout, user feedback, and periodic re-evaluation.

    Pitfall 6: Equating model capability with product experience. Recommendation: evaluation should cover the full chain of prompt design, context organization, result validation, and human fallback.

    Pitfall 7: Focusing only on model fees and ignoring human cost. Recommendation: if the model output requires extensive human correction, the total cost may not actually be lower, so human-review time should be included in the assessment.

    10. Conclusion

    The core of Chinese LLM evaluation is not simply producing a ranking, but building an analytical system that can support business decisions. By designing a representative task set, establishing stable and comparable metrics, and breaking down token costs and the call chain, a team can more accurately judge whether model quality meets the need, whether cost is within a tolerable range, and whether the system is ready for stable launch.

    As the abstract case shows, a change in average cost per question from about RMB 2.52 to about RMB 1.90 may come from a combination of improvements in model efficiency, calling strategy, context management, or output control. For developers, what really matters is turning this kind of change into a reusable engineering method: evaluation must stay close to the business, cost must be broken down to tokens and requests, launch must be validated with canary rollouts, and operation must include monitoring and alerting.

    Only by combining evaluation, cost, and engineering governance can a large model truly move from “usable” to “good to use.”