LLM Evaluation and Model Selection: From Parameter Count to Generation Quality

    This article explains how to evaluate and select large language models and generative vision models for production use. It clarifies why parameter count, context-window length, and multimodal labels can be misleading, shows how to read public leaderboards critically, and walks through building a reproducible, business-specific evaluation set using automated rule checks, LLM-as-a-judge with bias control, and human review. It then extends the discussion to image and video generation quality and latency, cost considerations, and the engineering practices of canary release and continuous regression.

    In today’s environment, where open-source models and multimodal generative models iterate rapidly, developers routinely encounter two kinds of headlines. One announces that “a trillion-parameter model has been open-sourced and now approaches the capabilities of leading closed-source models.” The other boasts that it can “generate a high-resolution image in seconds.” As releases become more frequent, parameter counts grow larger, and reported metrics look better and better, a practical question emerges: what do these numbers actually mean, and how should you use them to make technical decisions?

    1. Clarify the concepts first: parameter count is not capability

    Parameter count has limited reference value. Modern large models commonly use sparse architectures (mixture of experts, MoE), where only a small subset of experts is activated for each input. As a result, “total parameters” mainly determine knowledge capacity and training cost, while “activated parameters per token” more directly affect inference compute and latency. Looking only at total parameters tends to overestimate deployment barriers and misjudge capability. Actual usable capability is shaped jointly by model architecture, data quality and mixture, training compute, and post-training and alignment strategies—and training dynamics can also significantly affect the final result.

    Don’t judge the context window by the number alone. Advertising “support for ultra-long context” does not mean the model can effectively use information at any position within the window. Developers need to care about the effective context length and verify it with position-based tests that place key information at the beginning, middle, and end—rather than running a single total-length metric.

    Break down multimodal capability for evaluation. “Can see images” is only the starting point. More important questions include:

    • Whether visual input can be correctly used at inference time;
    • How well image detail fidelity is preserved;
    • Whether long documents can be parsed reliably;
    • How well the model follows prompts and instructions.

    2. Leaderboards are informative, but don’t copy them blindly

    Public benchmark leaderboards, aggregate rankings from independent third-party evaluators, and community evaluations are all useful first-pass signals. When reading them, watch out for several issues:

    1. Contamination: evaluation sets may appear in training data, inflating scores.
    2. Benchmark-chasing: models can overfit to public questions, which may not match your business distribution.
    3. Score semantics: an aggregate score is a weighted combination of different tasks, and the weights may not match your scenario.
    4. Latency differences: leaderboards usually measure quality only and do not compare latency or cost, whereas production services must balance both.

    The takeaway: use leaderboards to “rule out clearly unsuitable candidates,” but the final decision must come back to your own evaluation set.

    3. Engineering evaluation: build your own business evaluation set

    3.1 Build the evaluation set from real requests

    • Source: sample from real production traffic, prioritizing high-frequency, high-risk, and poorly performing categories.
    • Cleaning: deduplicate, anonymize, and fill in reference answers and scoring criteria.
    • Stratified coverage: intent, domain, difficulty (single-step vs. multi-step tasks), language, and context length.
    • Size: the scale depends on the scenario; aim for at least a few dozen samples per key category to avoid unstable conclusions from small samples.

    3.2 Evaluation methods: automated rules, model judging, and human review

    Automated rule checks. Format-based and structured-output tasks are well suited to direct validation—for example, whether JSON parses, whether fields are complete, whether a regex matches, and whether execution results match expectations.

    Model judging (LLM-as-a-Judge). This is suitable for evaluating “quality”-type tasks that are hard to describe with rules. Bias control is essential when using it:

    • Position bias: re-judge after swapping the order of two candidates, then average the two results or require an agreement.
    • Length bias: explicitly instruct the judge that “longer does not mean better.”
    • Self-preference: the judging model may favor answers similar in style to its own, so it is best to use a model different from the candidate models.
    • Rubric: provide clear dimensions, levels, and anchor examples in advance.
    • Consistency calibration: use human-labeled samples to check the agreement rate between the judge and humans; if agreement is too low, calibrate the criteria first.

    Human review. High-value, high-risk scenarios should rely on human review, using blind tests and randomized order:

    • Reviewers do not know which model an answer came from and score strictly against the criteria;
    • Present answers in alternating order to avoid position-driven preference.

    Whichever method you use, record the scorer, model version, random seed, and prompt version to keep results reproducible.

    3.3 Illustration: pairwise comparison with bias control

    1. import random
    2. JUDGE_PROMPT = """You are a strict reviewer. Compare two answers (A and B) based on the following criteria:
    3. 1. Correctness: Is the conclusion accurate and is the reasoning free of obvious errors?
    4. 2. Completeness: Does it cover all the points required by the question?
    5. 3. Usability: Is it clearly structured and directly actionable or adoptable?
    6. Output only JSON: {"better": "A" | "B" | "tie", "reason": "..."}"""
    7. def pairwise(model, question, a, b, rng):
    8. # Randomly swap the order to remove position bias: judge once before and once after the swap
    9. order = rng.random() < 0.5
    10. pair1 = ("A", a, "B", b) if order else ("A", b, "B", a)
    11. pair2 = (pair1[2], pair1[3], pair1[0], pair1[1])
    12. votes = []
    13. for la, ta, lb, tb in (pair1, pair2):
    14. resp = model.chat(
    15. messages=[
    16. {"role": "system", "content": JUDGE_PROMPT},
    17. {"role": "user",
    18. "content": f"Question: {question}\n\n{la}'s answer:\n{ta}\n\n{lb}'s answer:\n{tb}"},
    19. ],
    20. response_format={"type": "json_object"},
    21. )
    22. better = resp.json()["better"]
    23. # Normalize to a win/loss relative to candidate A
    24. votes.append({"A": 1, "B": -1, "tie": 0}[better] * (1 if order else -1))
    25. return sum(votes) # 2 means A won both times; 0 means a tie or an unstable verdict
    1. import time, json
    2. def judge_consistency(history):
    3. """Estimate the trustworthiness of the model-based judge using human-labeled samples."""
    4. agree = sum(1 for x in history if x["judge_vote"] == x["human_vote"])
    5. return {"n": len(history), "agreement": agree / max(len(history), 1)}
    6. class Model:
    7. def chat(self, messages, **kw): ... # Connect to your model-calling wrapper
    8. def json(self): ...
    1. # Unified model-calling interface that hides differences between providers for easy parallel comparison
    2. import asyncio, time
    3. class Model:
    4. async def chat(self, messages, **kw): ... # Implement the concrete model-calling logic
    5. async def run(model, case, sem):
    6. async with sem: # Concurrency cap to avoid triggering rate limits
    7. t0 = time.perf_counter()
    8. try:
    9. resp = await model.chat(
    10. messages=case["messages"], temperature=0, max_tokens=case["max_tokens"])
    11. text, err = resp.text, None
    12. except Exception as e:
    13. text, err = "", repr(e)
    14. return {
    15. "case_id": case["id"],
    16. "input_tokens": resp.usage.prompt_tokens if resp else None,
    17. "output_tokens": resp.usage.completion_tokens if resp else None,
    18. "ttft": resp.ttft if resp else None, # Time to first token
    19. "latency": time.perf_counter() - t0, # End-to-end latency
    20. "text": text, "error": err,
    21. }
    22. async def evaluate(model, cases, concurrency=16):
    23. sem = asyncio.Semaphore(concurrency)
    24. results = await asyncio.gather(*(run(model, c, sem) for c in cases))
    25. # Aggregate by error rate, average score, and P95 latency, and keep each record for later review
    26. return results

    4. Image quality and speed of generative vision models

    Evaluating image and video generation models must answer two questions at once: “how good does it look” and “how fast does it run.”

    Quality and semantic consistency.

    • Common automated metrics: FID, CLIP Score, aesthetic scores, VBench, and others.
    • Limitations of automated metrics: they serve only as trend references and cannot replace human judgment of details such as text rendering, fingers and limb structure, and physical plausibility.
    • Text rendering: layout-oriented artwork should be evaluated separately.
    • Video generation: beyond single-frame quality, examine temporal consistency, subject stability, motion plausibility, and flicker or jumps.
    • Human evaluation: use pairwise comparison, measure win rates, and report 95% confidence intervals.

    End-to-end latency and throughput.

    • Staged timing: record the time for each segment—“request sent → task queued → inference starts → first image/frame returned → all completed”—to locate bottlenecks.
    • Full-pipeline cost: under high concurrency, queuing time is often more critical than single-inference time.
    • Common optimizations: resolution tiering, batching, caching, distillation, model quantization, and load-based elastic autoscaling.

    When assessing capabilities like “generate an image in tens of seconds,” record the test conditions—resolution, concurrency, and whether it is a cold start—otherwise the numbers are not comparable.

    5. An underrated dimension: cost

    Cost is not the same as unit price; focus on the total overhead per thousand requests or per thousand tokens:

    • Input and output tokens are billed separately;
    • The longer the context, the higher the cost per request;
    • Vision tasks must account for image tokenization and resolution tiers;
    • High concurrency requires additional elastic capacity and quota costs.

    As a strategy, consider a tiered approach: route simple tasks to small models and reserve large models for complex tasks, while making good use of result caching and batch jobs. During evaluation, put quality, latency, and cost into the same comparison table rather than treating them in isolation.

    6. Engineering rollout: canary release and continuous regression

    1. Establish a baseline: keep the current production model as a reference.
    2. Small-traffic canary: split traffic by percentage and observe P95/P99 latency, error rate, and user feedback (thumbs up/down, follow-up question rate) on real traffic.
    3. Continuous regression: business data and prompts drift, so periodically expand the evaluation set with hard cases; after every model or prompt change, run automated regression to prevent quality regressions.
    4. Keep a fallback path: configure backup models and timeout retries, and avoid single points of dependency on critical paths.

    Platforming these capabilities is exactly where cloud services can help. On Baidu AI Cloud, for example, you can store evaluation sets and call logs in object storage, run inference services on a container platform with elastic scaling, and continuously monitor production quality with log services and monitoring alerts. On the model-calling side, model service platforms such as Qianfan can offer unified access, reducing the operational burden of self-hosted model services.

    7. Conclusion

    Parameter count is the starting point and leaderboards are a reference, but what truly determines a project’s success is whether it is “usable, stable, and affordable in your scenario.” Building a reproducible, regression-capable, and cost-controlled evaluation process delivers more long-term value than chasing any single release. How is your team currently evaluating large-model performance? Feel free to share in the comments.