LLM Selection and Evaluation: A Practical Guide to Benchmarking and Model Choice

    This article presents a vendor-neutral approach to selecting and evaluating large language models when call cost is the primary constraint. It breaks model capability into measurable dimensions, outlines a reproducible evaluation pipeline with a versioned question set, a unified calling layer, a judging layer, and an aggregation layer, and shows how to read results beyond the overall score. A sample version comparison illustrates how domain-level divergence matters more than the total, why agent and tool-calling scores must be tested in a sandbox close to your own toolchain, and how to turn metrics into deployment rules. It also lists common pitfalls and the practices needed to keep selection decisions reliable as model versions iterate quickly.

    1. Background: When Call Cost Becomes the First Constraint

    In real projects, model selection is rarely driven by “which model is smarter.” It is driven by “which model can deliver reliably within budget.” When the usage cost of expensive overseas closed-source models exceeds what a team can afford, engineering teams usually take one of three paths: reduce call frequency and reserve the large model for the most critical steps; adopt a cheaper general-purpose model as the primary choice and keep the expensive model as a fallback; or build an in-house evaluation system that uses data to determine whether candidate models are actually good enough.

    The third path is the easiest to skip, yet it has the most long-term value. Model versions iterate quickly, and there is often a gap between the capability gains claimed in official announcements and the actual business benefit. Without a stable evaluation baseline, a team ends up switching models “by feel” at every upgrade. This article describes a vendor-neutral, practical method for evaluating and selecting large language models.

    2. Break “Capability” into Measurable Dimensions

    The first step in evaluation is not finding questions but defining the capability under test. The capabilities of a general-purpose LLM can be abstracted into the following observable dimensions:

    • Context window and long-text handling: the maximum token scale that can be handled stably, and the ability to retain information when approaching that limit. Common window sizes in the industry range from 128K to 200K tokens, and a larger window directly benefits agent tasks, long-document understanding, and cross-file code analysis.
    • Coding ability: completion quality in intelligent coding tools, cross-file modification ability, and instruction following. Evaluation should focus on the “first-pass success rate” rather than single-point accuracy.
    • Agents and tool calling: whether the model can correctly select tools, parse return values, and issue calls mid-reasoning in multi-turn, multi-tool scenarios.
    • Reasoning and math: the stability of multi-step derivation and the ability to self-correct.
    • Domain knowledge: accuracy differences across verticals such as legal and administrative affairs, education, finance, healthcare, and mental health are usually far larger than the difference in overall scores.
    • Language and instruction compliance: compliance rates for output format, length constraints, and structured output.
    • Engineering metrics: average latency, average token consumption, and cost per thousand calls.

    Turning these dimensions into a metrics table is the foundation for all subsequent comparisons. Any specific numbers must come from your own testing, not from external marketing claims.

    3. Build a Reproducible Evaluation Pipeline

    The credibility of an evaluation depends on reproducibility. A minimal implementation has four layers:

    1. Question set layer: bucket questions by dimension, with a recommended scale in the tens of thousands (for example, about 15,000 questions), each labeled with its domain, difficulty, and expected output form. The question set must be version-controlled to avoid score drift caused by editing questions.
    2. Calling layer: wrap requests uniformly, fix sampling parameters such as temperature, and record time to first token, total elapsed time, and input/output token counts. Sample code:
    1. def evaluate(client, case, cfg):
    2. resp = client.chat(
    3. model=cfg.model,
    4. messages=case.messages,
    5. temperature=cfg.temperature, # Fixed sampling parameters to ensure comparability
    6. max_tokens=cfg.max_tokens,
    7. )
    8. return {
    9. "case_id": case.id,
    10. "domain": case.domain,
    11. "correct": judge(resp.text, case.answer),
    12. "latency": resp.elapsed,
    13. "tokens": resp.usage.total_tokens,
    14. }
    1. Judging layer: objective questions use exact matching or rule-based checks; subjective questions use manual spot checks plus model-assisted review, with the review prompt and sampling ratio fixed.
    2. Aggregation layer: output the overall score, per-domain scores, latency percentiles, and mean token usage, and convert to cost per thousand calls.

    On the engineering side, evaluation jobs are well suited to containerized, concurrent batch execution. Task status and raw responses are written to object storage, and metrics go into logging and monitoring/alerting systems so that regressions can be compared automatically.

    4. Reading Results: Divergence Beyond the Total Score Matters More

    Take a typical version comparison as an example (data is for method demonstration only): the new version’s overall accuracy rose from 66.6% to 68.7%, an increase of 2.1 percentage points, and its overall ranking moved from 20th to 10th; average latency dropped from 98 seconds to 59 seconds, an improvement of about 39.8%; average token consumption fell from 2944 to 2851, a decrease of about 3.2%; and cost per thousand calls dropped from CNY 38.8 to CNY 37.6, a decrease of about 3.1%.

    More informative than the total score is the per-domain divergence:

    • Legal and administrative affairs rose from 72.7% to 80.3%, a gain of 7.6 percentage points, the largest improvement in this comparison;
    • Education rose from 41.2% to 46.9%; finance rose 0.8 percentage points to 77.7%; healthcare and mental health rose 3.7 percentage points to 77.6%; reasoning and math rose 3.6 percentage points to 65.8%;
    • Language and instruction compliance fell from 66.2% to 64.6%, and agents and tool calling fell from 72.7% to 69.9%.

    The last two declines are especially worth attention: the official messaging emphasized improved agent and tool-calling ability, yet the in-house test showed a decrease. This does not necessarily mean the claims are misleading; a more common reason is that the tool environment and return-value formats in the evaluation set differ from real business usage. The conclusion is therefore that agent capability must be evaluated separately in a sandbox close to your own toolchain, and generic leaderboards should not be taken at face value.

    5. Turn Metrics into Decisions

    The endpoint of evaluation is a decision rule, not a report. The following logic can be used:

    1. if accuracy >= business threshold and latency P90 <= interaction limit:
    2. include as a primary candidate
    3. elif accuracy meets the bar but cost exceeds budget:
    4. use for offline batch processing, and route the online path to a small-parameter model
    5. else:
    6. keep only as a domain-specific model (e.g., legal documents)

    It is also advisable to establish three routine mechanisms: run the same question set for regression at every candidate model upgrade; tie cost per thousand calls to business gross margin to form an explainable cost-performance curve; and keep version records of prompts and post-processing logic so that engineering optimizations are not mistaken for model capability gains.

    6. Common Pitfalls

    • Looking only at the total score: a 2-point overall gain may hide negative growth in a critical domain.
    • Ignoring the latency distribution: a 59-second average is still slow for interactive scenarios, so look at P90 and time to first token.
    • Inconsistent token accounting: whether input and output include the system prompt, and whether retries are counted, can distort cost comparisons.
    • One-off evaluation: both models and question sets drift, and data without a regression mechanism has no long-term value.

    7. Conclusion

    Under cost constraints, the rational approach is not to find the “strongest model” but to build your own reproducible evaluation and decision system. Breaking capability into dimensions, turning evaluation into a pipeline, and converting metrics into launch rules are what allow you to keep making correct selection decisions in an environment of rapid version iteration. If you need elastic compute along with supporting data storage, logging, and monitoring capabilities, you can build the evaluation infrastructure on the relevant general-purpose cloud products from Baidu AI Cloud.