LLM Selection Guide: Scenario-Based Evaluation and Engineering Practices

    A practical guide to selecting large language models beyond benchmark scores. It covers a weighted decision framework, seven abstract model archetypes, a three-layer mapping from business needs to model requirements, prompt and context engineering patterns, RAG and tool-calling safeguards, a three-tier evaluation system, cost and compliance trade-offs, common anti-patterns, and a four-week rollout roadmap.

    1. Why Model Comparisons Should Not Rely on Benchmarks Alone

    Once generative AI moves into the engineering phase, the most common mistake teams make is reducing selection to a capability leaderboard. The kind of side-by-side comparison organized around “best-fit scenarios, typical use cases, core strengths, and pro tips” is essentially a decision-support tool. But if you copy it without accounting for business constraints, you often end up with conclusions that look reasonable and turn out to be unusable.

    Four variables actually determine results: task type, context conditions, system constraints, and evaluation method. Task type determines whether a model needs to lean toward reasoning, generation, or structured extraction. Context conditions determine long-document handling and retrieval strategy. System constraints cover latency, throughput, cost, and data compliance. The evaluation method determines whether you can catch regressions before launch. Talking about “which one is stronger” without these four points has almost no engineering meaning.

    A better approach is to model selection as a weighted decision problem:

    1. score = (
    2. 0.35 * task_fit # Task fit (score on your own eval set)
    3. + 0.20 * context_fit # Long-context and retrieval compatibility
    4. + 0.15 * latency_score # P95 latency target attainment
    5. + 0.15 * cost_score # Cost per successful request
    6. + 0.15 * compliance # Data and compliance requirement coverage
    7. )

    Weights should be reordered per business. For consumer-facing real-time interaction, the latency weight should be significantly higher than cost; for offline document batch processing, the reverse applies.

    2. Capability Positioning of Seven Mainstream Model Archetypes

    To avoid pointing at any specific product, the common general-purpose LLMs on the market can be abstracted into seven typical positions based on capability shape. These map one-to-one to the seven tools in the source material, but only technical attributes are discussed here.

    1. General-purpose conversational assistant: broad coverage, stable instruction following, suitable as the default entry point and as a dispatcher for complex tasks.
    2. Multimodal-native model: unified encoding of text, image, and audio, suitable for visual question answering, image-text moderation, and cross-modal retrieval.
    3. Long-context and code-reasoning model: emphasizes long-dependency modeling and structured output, suitable for contract review, codebase understanding, and refactoring suggestions.
    4. Cost-efficient open-weight model: can be deployed privately and fine-tuned, suitable for data-sensitive and cost-sensitive scenarios.
    5. Ecosystem-integrated model: tightly coupled with office suites, search, and cloud infrastructure, suitable for enterprise knowledge bases and process automation.
    6. Lightweight low-latency model: aimed at on-device use or high-concurrency short requests, suitable for classification, rewriting, and intent recognition as front-end pipeline stages.
    7. Real-time information-augmented model: tightly integrated with public information channels, suitable for time-sensitive tasks such as sentiment tracking and market summaries.

    Note that these positions are a summary of capability shapes. They do not refer to any specific implementation and do not constitute a recommendation for any product. In engineering practice, “routing plus composition” is far more common than choosing one or the other.

    3. Mapping Scenarios to Capabilities

    Translating business requirements into model requirements is the most valuable step in selection. A three-layer mapping is recommended.

    The first layer is output shape. If the downstream consumer is a database or business system, strict structured output is mandatory, and a model’s “controllability” matters far more than its “writing flair.” A controlled prompt plus a validation layer can serve as a fallback:

    1. {
    2. "task": "invoice_extract",
    3. "schema": {
    4. "vendor": "string",
    5. "amount": "number",
    6. "currency": "string",
    7. "due_date": "string|null"
    8. },
    9. "on_violation": "retry_with_error_feedback"
    10. }

    The second layer is context shape. Long-document tasks require chunking and indexing first, then a decision between reading long context directly and retrieval augmentation. The rule of thumb: prefer long context when global reasoning across sections is needed; prefer retrieval when precise location and traceable citations are needed.

    The third layer is interaction shape. High-concurrency short requests go to lightweight models, complex multi-step tasks go to models with stronger reasoning, and the scheduling layer splits traffic by confidence and rules.

    4. General Patterns for Prompt and Context Engineering

    Regardless of which model category you use, four practices hold up reliably.

    Put role and constraints first: place output format, prohibitions, and the glossary at the front of the prompt to reduce the cost of correction later.

    Drive with examples, not adjectives: replace vague requirements like “be professional, be concise” with two or three examples that cover edge cases.

    Externalize the reasoning process: for complex reasoning, ask the model to produce structured intermediate artifacts first (such as a list of assumptions or numbered evidence), then the conclusion, which makes errors easier to locate.

    Budget the context: set quotas for retrieved snippets, conversation history, and system instructions so that critical instructions are not diluted.

    1. [System] You are an extractor. Output JSON only, no explanation.
    2. [Glossary] "party_a" = service_provider in the contract
    3. [Evidence] E1: ... E2: ...
    4. [Output] Append evidence_id after each field

    5. Engineering Essentials for RAG and Tool Calling

    The core of retrieval-augmented generation is not the vector store but data governance. Chunk granularity, metadata design, permission filtering, and update freshness determine the upper bound of recall quality. In practice, keep source location information so every conclusion can be traced back.

    For tool calling, treat the model as a dispatcher rather than an executor. All side-effecting operations should pass through an allowlist, an idempotency key, and an audit log:

    1. def guarded_call(tool, args, ctx):
    2. assert tool in ALLOWED_TOOLS
    3. key = idem_key(tool, args) # Idempotent, prevents duplicate orders
    4. if not ctx.has_permission(tool):
    5. return {"error": "forbidden"}
    6. return audit(tool, args, key)

    In general engineering practice on cloud platforms such as Baidu AI Cloud, these capabilities are typically provided by object storage for raw corpora, message queues for peak shaving, container platforms for inference services, and logging plus monitoring and alerting for observability. This is a common industry-standard combination of service categories, not a proprietary interface.

    6. Evaluation Systems: Turning “Feels Better” into Something Measurable

    Without evaluation there is no iteration. A three-tier evaluation setup is recommended:

    • Unit level: fixed input-output pairs covering format compliance rate and field accuracy.
    • Scenario level: sampling from real business traffic, with human annotation of satisfaction and factual consistency.
    • Regression level: automatically run the full suite on every model or prompt version change, producing a comparison report.

    Key metrics should include task success rate, structured parsing failure rate, citation traceability rate, P95 latency, and cost per successful request. Version changes must be archived to avoid “silent regression.”

    7. Balancing Cost, Latency, and Compliance

    There are four mature paths to cost optimization: tiered routing (simple requests go to lightweight models), cache reuse (semantic caching and result caching), batching (merging requests for offline tasks), and distillation plus fine-tuning (using smaller models to固化 high-frequency capabilities).

    For compliance, stick to data minimization, encryption in transit and at rest, regional deployment, and audit trails. Sensitive data should prefer private deployment or dedicated instances, and public-information augmentation capabilities should be used only for non-sensitive tasks.

    8. Common Anti-Patterns

    One is treating prompts as patches, repeatedly solving problems by adding sentences. Two is switching models without evaluation, drawing conclusions from a few individual cases. Three is abusing long context, which raises cost while diluting key information. Four is letting the model directly execute high-risk side-effecting operations. Five is ignoring version drift, where production quality silently declines over time.

    9. Implementation Roadmap

    Week one: define tasks and acceptance metrics, and build an evaluation set of more than two hundred cases. Week two: stand up the retrieval and structured-output baseline. Week three: introduce routing and caching, and load-test latency and cost. Week four: complete auditing, permissions, and the regression pipeline, then enter a canary release. With “measurable, rollback-capable, auditable” as the end state, model selection turns from a one-time decision into a continuously operated engineering capability.