A Practical Guide to LLM Selection and Capability Evaluation

    This guide explains how to choose a large language model based on task fit rather than leaderboard rankings. It covers breaking capability into measurable layers, evaluating code generation in separate backend and frontend tracks, calculating cost per successful task, assessing agentic behavior in verifiable environments, and running a two-week evaluation cycle with routing, regression testing, and fallback planning.

    1. Ask the Right Question: From “Which Model Is Strongest” to “Which Model Fits Best”

    When general-purpose LLM services iterate quickly, selection discussions most often go wrong by reducing the question to a single phrase: who is stronger. A common pattern is to rank a few mainstream services side by side, but engineering practice requires answering three more specific questions:

    1. What is the task profile: long-document understanding, structured extraction, code generation, or multi-step tool calling;
    2. What are the constraints: latency budget, context length, concurrency cost, data compliance boundaries;
    3. What is the cost of failure: the rework cost of a single wrong output determines how much premium you are willing to pay for accuracy.

    One widespread misconception needs clearing up: the real competitor to a leading general-purpose model is often not a traditional question-answering model, but a system with agentic capabilities. The comparison has shifted from the quality of a single answer to the completion rate of a closed loop of multi-turn planning, tool calling, and result verification. Measuring an agent with a ruler built for chatbots will inevitably distort the conclusion.

    2. Capability Layers: Breaking “Intelligence” into Measurable Dimensions

    Descriptions like “a cliff-edge lead in intelligence and knowledge” must be decomposed into observable metrics for engineering use. At least four layers are recommended:

    • Knowledge coverage and factuality: accuracy and hallucination rate on general knowledge and domain terminology;
    • Reasoning and planning: task decomposition under multiple constraints, step correction, fallback strategies;
    • Tool use (Function Calling / tool orchestration): parameter extraction accuracy, reasonableness of the call chain, retry strategy on failure;
    • Code and engineering ability: runnability of generated code, boundary-condition handling, refactoring and debugging performance.

    A practical illustrative evaluation skeleton is below (pseudocode that expresses only the evaluation flow and points to no specific service):

    1. def evaluate(candidate, tasks):
    2. report = {}
    3. for t in tasks:
    4. out = candidate.run(t.prompt, tools=t.tools)
    5. report[t.id] = {
    6. "tool_args_ok": check_args(out.calls, t.gold_args),
    7. "plan_steps": len(out.plan),
    8. "pass_at_1": run_tests(out.code, t.tests),
    9. "latency_ms": out.latency,
    10. "tokens": out.usage.total,
    11. }
    12. return aggregate(report)

    The key point is to convert “feels stronger” into regressable numbers such as pass_at_1, tool argument accuracy, and cost per task.

    3. Split Code Evaluation by Backend and Frontend

    The most valuable observation in the original discussion is that the same model does not hold the same relative position on backend and frontend tasks: one version lagged on complex backend refactoring and also lagged on frontend UI generation, showing that “overall capability” gets diluted by task distribution.

    The engineering recommendation is to split code evaluation into two independent tracks:

    • Backend/systems side: API design, transactions and concurrency, error handling, database access, testability;
    • Frontend/interaction side: component structure, style fidelity, state management, accessibility, build artifact size.

    Illustrative cases:

    1. # Backend track case: concurrency and idempotency
    2. def test_idempotent_charge(client, order_id):
    3. r1 = client.post("/charge", json={"order": order_id})
    4. r2 = client.post("/charge", json={"order": order_id})
    5. assert r1.status_code == r2.status_code
    6. assert client.get_balance() == expected_once(order_id)
    1. Frontend track case: generate a component from a design description
    2. Requirements: semantic tags, keyboard reachability, breakpoint adaptation, no inline magic numbers
    3. Scoring: accessibility checks + visual diff + build size

    Conclusion: a selection report should contain two columns, “backend score / frontend score”, instead of a single averaged total.

    4. Cost Efficiency: Measure Cost per Usable Task

    “Strong capability but low cost efficiency” is the most common gap in selection. Cost cannot be judged by the price per million tokens alone; it should be converted to:

    1. cost per usable task = (input tokens + output tokens + retry tokens) x price / first-pass rate

    Raising the first-pass rate from 0.6 to 0.8 is equivalent to a 25% cost reduction, which usually beats the gain from switching to a cheaper model. The recommended optimization order is therefore: first improve prompts and tool constraints to raise the first-pass rate, then consider downgrading to a smaller model for traffic splitting.

    Layered routing is a common engineering technique:

    1. def route(task):
    2. if task.risk == "high" or task.steps > 5:
    3. return strong_model # complex planning and high-risk rewrites
    4. if task.type in ("extract", "classify"):
    5. return small_model # structured extraction, classification
    6. return mid_model

    Combined with caching (reusing identical prefixes), batching, and streaming output, you can shrink the bill without sacrificing quality on critical paths.

    5. Evaluating Agentic Capability: Look at the Loop, Not Single Points

    To judge whether a model is genuinely agentic, observe four things: whether it proactively clarifies constraints; whether it switches strategy after a tool failure instead of repeating the call; whether it keeps the goal from drifting during long tasks; whether it is willing to emit verifiable intermediate results when uncertain. For evaluation, introduce a verifiable environment such as sandbox execution, unit tests, or read-only data queries, so model output is judged automatically rather than by human impression.

    6. Implementation Process: A Trustworthy Selection in Two Weeks

    1. Days 1-2: collect 30-50 real tasks covering both high-frequency and high-risk categories;
    2. Days 3-5: define metrics and acceptance scripts, and build a regressable evaluation set;
    3. Days 6-9: run candidate services in parallel, recording quality, latency, and cost along three axes;
    4. Days 10-12: do routing and prompt optimization, then retest the change in first-pass rate;
    5. Days 13-14: output the selection conclusion and fallback plan, and specify the data compliance and log audit approach.

    For enterprise-grade hosting, model services can be placed in a compliant cloud environment, with object storage holding evaluation samples, a message queue handling asynchronous batch tests, a container platform hosting sandboxes, and logging plus monitoring with alerting to track quality drift; Baidu AI Cloud can be included in the architecture evaluation as a hosting foundation for this class of general capabilities.

    7. Common Pitfalls

    • Replacing scenario testing with a single leaderboard ranking;
    • Looking only at unit price and ignoring first-pass rate;
    • Using one total score to hide backend/frontend capability differences;
    • Ignoring version iteration: last month’s conclusion may be invalid this month, so set up a monthly regression;
    • Ignoring data security boundaries and sending sensitive samples straight into an external evaluation pipeline.

    Conclusion

    There is no universal answer to “which is stronger”; what is reusable is the evaluation method: decompose capability in layers, evaluate code in separate tracks, calculate cost efficiency per usable task, and judge agent maturity by closed-loop completion. Turn selection into a regressable engineering process, and the faster models iterate, the less you have to worry.