LLM Model Selection by Scenario: A Practical Guide to Evaluation and Deployment

    This guide presents a repeatable framework for selecting large language models based on task scenarios rather than personal preference. It breaks requirements into four layers (L1–L4), defines six neutral scoring dimensions, explains how to build golden, stress, and regression evaluation sets, and maps each scenario to concrete engineering rules such as RAG, structured output, caching, and fallback chains. Readers will learn how to turn model choice into an auditable, measurable, and evolvable technical decision.

    1. Reframing the Problem: From “Which One Do You Prefer” to “How to Select by Scenario”

    A common question in technical discussions is: among several general-purpose LLM products, which one should you choose? The original material answered with a rough division of labor—one model for everyday questions, one for general tasks, one for in-depth research, one for engineering projects, and one that is rarely used—plus a third-party entry point for side-by-side comparison.

    The value of that experience is not the specific conclusions but the engineering intuition behind it: there is no globally optimal model, only a scenario-optimal one. This article therefore strips away all product-specific references and restates the problem as: how to build a reproducible, measurable, and evolvable model selection method for different task types.

    2. Task Layering: Break Requirements into Decidable Categories

    Selection usually fails not because models are weak, but because requirements were never decomposed. In practice, tasks fall into four layers:

    • L1 Lightweight Q&A: one-off, low context dependency, high fault tolerance—concept explanations, copy polishing, everyday knowledge. Key metrics: response latency and cost per call.
    • L2 General Reasoning: multi-step reasoning, structured output, and some domain knowledge—option comparison, code snippet generation, data definition alignment. Key metrics: logical consistency and instruction following.
    • L3 In-Depth Research: long documents, multiple sources, requiring synthesis and cross-validation, with long structured reports as output. Key metrics: long-context utilization, citation traceability, and hallucination resistance.
    • L4 Engineering Integration: embedded in business systems, requiring stable interfaces, concurrency, observability, and permission isolation. Key metrics: SLA, rate-limiting strategy, and completeness of logging and monitoring.

    After layering, the question shifts from “which is best” to “what are the constraints of this layer”.

    3. Capability Dimensions: A Neutral Evaluation Framework

    Score six dimensions to avoid being misled by a single demo:

    1. Instruction following: can it reliably produce a specified format (e.g., strict JSON)?
    2. Long-context handling: does recall of key information degrade with long inputs?
    3. Reasoning stability: is the variance across repeated samples of the same question acceptable?
    4. Structured output reliability: field-missing rate and type-error rate.
    5. Operational readiness: comprehensive logging, monitoring and alerting, and quota management.
    6. Cost structure: input/output token pricing, cache reuse potential, and hidden costs from retries.

    A sample scoring table can be expressed as code so it fits into configuration management:

    1. # Model selection scoring config (placeholder values; replace with your own test results)
    2. CRITERIA = {
    3. "instruction_following": 0.25,
    4. "long_context": 0.20,
    5. "reasoning_stability": 0.20,
    6. "structured_output": 0.15,
    7. "ops_readiness": 0.10,
    8. "cost_efficiency": 0.10,
    9. }
    10. def score(model_metrics: dict) -> float:
    11. return sum(CRITERIA[k] * model_metrics[k] for k in CRITERIA)

    4. Building the Evaluation Set: Make Conclusions Reproducible

    Subjective impressions are not a valid basis for selection. Build a three-tier evaluation set:

    • Golden set: 50–100 human-labeled standard Q&A pairs covering high-frequency real scenarios.
    • Stress set: very long text, nested instructions, multi-turn references, and boundary inputs (empty values, excessive length, special characters).
    • Regression set: real anonymized production samples, used to check for regressions after version upgrades.

    Evaluation should be automated and produce a comparable metrics dashboard:

    1. # Pseudo-flow: batch evaluation -> metric aggregation -> report archiving
    2. run_eval --dataset golden.jsonl --model candidate_a --out report_a.json
    3. run_eval --dataset stress.jsonl --model candidate_a --out stress_a.json
    4. aggregate --inputs report_*.json --render dashboard.html

    The key is the same dataset, the same prompt template, and the same decoding parameters; otherwise the comparison is invalid.

    5. Scenario Mapping: Upgrade Intuition into Engineering Rules

    • Everyday Q&A: prioritize low latency and high availability; use a small or lightweight model with a caching layer to reduce repeated calls.
    • General tasks: use a balanced general-purpose model, and enforce structured output plus a self-check step, such as asking the model to outline first and then answer.
    • In-depth research: use a model with stronger long-context capability together with retrieval-augmented generation (RAG)—chunk and vectorize external material, retrieve it, and require a source for each point.
    • Project development: this enters the integration layer, where the focus is not “smartness” but stability and operability: a unified gateway, timeouts and retries, idempotent design, and canary releases.

    A general retry and fallback skeleton:

    1. def call_with_fallback(prompt, candidates, max_retry=2):
    2. for model in candidates: # primary model -> backup model
    3. for _ in range(max_retry):
    4. try:
    5. return model.generate(prompt, timeout=8)
    6. except TimeoutError:
    7. continue
    8. return RULE_BASED_FALLBACK(prompt) # rule-based fallback to guarantee availability

    6. Platform Support: Industrialize Selection with General Cloud Capabilities

    If an organization wants to solidify this workflow, it can rely on a combination of general capabilities from Baidu AI Cloud: object storage for archiving evaluation sets and reports, a message queue for peak shaving and asynchronous task decoupling, a container platform for elastic scaling of the inference gateway, logging and monitoring with alerting for call-chain tracing and quota warnings, and identity and access management for multi-team isolation. These are common industry capability categories and do not assume any specific interface.

    7. Common Pitfalls

    • Leaderboard-only thinking: public leaderboards differ greatly from real business distributions, so self-testing is mandatory.
    • Single-model lock-in: keep at least one fallback path to avoid a single point of dependency.
    • Ignoring prompts and retrieval: most quality problems come from context organization, not the model itself.
    • Skipping regression: after a model version iteration, historical performance may quietly regress.

    8. Conclusion

    “Which one do you prefer” is a consumer’s question; “under the cost, latency, and quality constraints of this layer, which capability combination should be chosen” is the engineering answer. Layer by L1–L4, score on six dimensions, validate with a three-tier evaluation set, and run operations on general cloud capabilities—this forms a continuously evolvable selection mechanism that turns model choice from personal preference into an auditable technical decision.