Selecting Chinese Large Language Models: An Evaluation Framework from Use Case to Engineering

    This article offers a vendor-neutral framework for evaluating Chinese large language models for production use. It covers how to define workloads and task cards, test capability boundaries, combine engineering and business metrics, calculate end-to-end cost, build reproducible evaluation pipelines, apply security gates, and roll out changes behind a swappable architecture. The framework applies to in-house applications, enterprise knowledge Q&A, code assistance, customer service summarization, and pre-screening for content moderation.

    Yesterday morning, a discussion in a technical community noted that an overseas inference acceleration catalog had added two entries for Chinese models. The specific source matters less than what it signals. Chinese general-purpose large language models have entered a stage of many candidates, rapid iteration, and tight coupling with engineering systems. In this stage, choosing a model based on screenshots, benchmark scores, or a single conversation can easily cause problems in real workloads. A safer approach is to shift the question from “which model seems smartest” to “which workload, at what cost, and under which risk thresholds.” The framework below is neutral and applies to common scenarios such as in-house applications, enterprise knowledge Q&A, code assistance, customer service summarization, and pre-screening for content moderation.

    1. Define Workloads Before Listing Models

    The first step in model selection is to translate requirements into measurable workloads. Split them into at least five types: Chinese long-document understanding and rewriting, retrieval-augmented generation (RAG) Q&A, structured information extraction, code generation and repair, and tool-orchestrated tasks. Each workload favors different model capabilities.

    • Long-document summarization depends on context window size, factual consistency, and instruction hierarchy.
    • Retrieval Q&A depends on citation faithfulness, refusal policy, and resistance to noisy context.
    • Structured extraction depends on format stability, field completeness, and error recoverability.
    • Code tasks depend on executability, unit test pass rate, and minimal patch size.
    • Tool orchestration depends on the validity rate of function call arguments, multi-turn planning, and retry handling for exceptions.

    To avoid vague comparisons, write a task card for each workload. A task card describes the input distribution, expected output, maximum latency, acceptable error rate, data sensitivity level, and fallback behavior when the task fails.

    For example, a task card for internal knowledge base Q&A could specify the following. The input is document snippets carrying permission labels. The output must include source IDs. When a question cannot be answered, the model returns a fixed marker. Average time to first token must stay below an internal threshold. High-permission snippets must never be exposed to a session with low permissions. Once the task card is clear, candidate models can be compared on the same basis.

    2. Evaluate Boundaries, Not Just Peak Performance

    A common misleading point with general-purpose large language models is that they can show strong peak capability while their boundaries remain unstable. Evaluation should cover three layers.

    1. Basic language ability: Chinese semantics, long-context localization, terminology consistency, and understanding of numbers and tables.
    2. Domain adaptation ability: whether the model follows industry vocabulary, compliance wording, and internal templates.
    3. System engineering ability: whether outputs are easy to parse, whether deterministic sampling is supported, whether latency stays stable under concurrency, and whether the model is sensitive to prompt perturbations.

    In practice, three tiers of inputs can probe these boundaries. Clean samples establish the upper bound. Perturbed samples add typos, colloquial phrasing, irrelevant context, and conflicts between documents to check robustness. Adversarial samples test unauthorized requests, attempts to induce data leakage, format escape, and forged authority references. A model suitable for production is not necessarily the one that gives the most polished answer every time. It is the one whose errors are easier to detect, block, and downgrade.

    3. Put Engineering Metrics and Business Metrics in the Same Table

    Many evaluations measure only accuracy and ignore engineering constraints. As a result, a model may fail on cost or stability after launch. Record the following metrics consistently:

    • Task success rate
    • Format validity rate
    • Factual consistency rate
    • Human review pass rate
    • Average and percentile latency
    • Throughput
    • Input and output token cost
    • Cache hit rate
    • Retry rate
    • Timeout rate
    • Content safety interception rate
    • Unauthorized access block rate

    On the business side, add resolution rate, human handoff rate, the extent of user edits, conversation turns, and complaint risk.

    Percentile latency and long-tail requests deserve special attention. A good average does not guarantee a good user experience. Long-context inputs can reduce overall throughput during peak hours. The test set should include short, medium, and long inputs, mixed in realistic proportions.

    If you use a cloud-hosted model, you can build a load testing environment with service categories such as general compute, log services, monitoring and alerting, and object storage. Enterprises using Baidu AI Cloud or other cloud providers should base decisions on internal service-level objectives (SLOs) rather than on figures listed on marketing pages.

    4. Cost Is Not the Unit Price, but the Cost of One Correct Task

    Model cost is often reduced to price per million tokens. Real cost is closer to the end-to-end cost of producing one acceptable result. The formula is:

    Effective cost per task = (input tokens + output tokens + tokens consumed by retries + retrieval and tool call costs) × unit price ÷ human review pass rate

    If a candidate model has a low unit price but needs more retries, longer prompts, and more human review, its total cost can be higher.

    Common optimization methods include:

    • Shortening system prompts
    • Reusing session prefixes
    • Enabling semantic caching
    • Preprocessing long documents into structured indexes
    • Using rules or small models for front-end routing
    • Downgrading simple tasks to lightweight inference
    • Escalating high-risk tasks to stronger models with human gates

    Routing strategy matters more than sending every request to the strongest model. A common design uses three layers. A rule layer handles deterministic problems. A lightweight model handles classification and extraction. A high-capability model handles open-ended generation. Each layer’s output carries a confidence flag, and low-confidence results escalate automatically.

    5. Build a Reproducible Evaluation Pipeline

    The evaluation pipeline should be automated as much as possible. It should track dataset versions, prompt versions, decoding parameters, random seeds, environment snapshots, and result signatures. The core principle is the same data, the same prompts, the same parameters, and the same quota.

    For generation quality, combine programmatic checks with human review. Programmatic checks verify valid JSON or XML, required fields, existing citations, sensitive terms, and length ranges. Human reviewers assess facts, tone, usability, and risk. Do not rely entirely on automated scoring models, because the evaluator itself introduces preferences.

    The following sample code is neutral. It illustrates an evaluation record structure and is not tied to any specific platform.

    1. from dataclasses import dataclass, asdict
    2. import hashlib, json, time
    3. @dataclass
    4. class CaseResult:
    5. case_id: str
    6. candidate: str # Candidate ID, no brand names
    7. prompt_hash: str
    8. ok_schema: bool
    9. fact_pass: bool
    10. latency_ms: int
    11. in_tokens: int
    12. out_tokens: int
    13. retries: int
    14. risk_flag: bool
    15. def digest(text: str) -> str:
    16. return hashlib.sha256(text.encode("utf-8")).hexdigest()[:16]
    17. def run_case(client, case):
    18. t0 = time.time()
    19. resp = client.chat(messages=case["messages"], temperature=case.get("temperature", 0))
    20. latency = int((time.time() - t0) * 1000)
    21. text = resp.get("text", "")
    22. usage = resp.get("usage", {})
    23. result = CaseResult(
    24. case_id=case["id"],
    25. candidate=client.name,
    26. prompt_hash=digest(json.dumps(case["messages"], ensure_ascii=False)),
    27. ok_schema=case["schema_check"](text),
    28. fact_pass=case["fact_check"](text, case.get("evidence")),
    29. latency_ms=latency,
    30. in_tokens=usage.get("input", 0),
    31. out_tokens=usage.get("output", 0),
    32. retries=resp.get("retries", 0),
    33. risk_flag=case["risk_check"](text),
    34. )
    35. return asdict(result)

    The key point of this code is not the call pattern. It turns each evaluation into a traceable record. When comparing candidates, fix the case set and produce layered reports: overall score, scores by workload, scores by risk level, and scores by cost. Do not report only averages. Also report the worst 5% of cases, because production incidents often come from the long tail.

    6. Address Security, Compliance