LLM Model Selection and Scenario Implementation: A Practical Guide

    This guide explains how to move beyond static LLM comparison tables and build a repeatable selection process based on verifiable evaluation. It covers a five-layer capability model, mapping business scenarios to capability weights, building a unified evaluation set, prompt and context engineering practices, cost and capacity planning, observability, and common pitfalls. Readers will get a vendor-neutral methodology they can apply directly to internal model selection reviews.

    1. Why Model Comparisons Must Return to Technical Fundamentals

    Early model selection discussions often arranged several mainstream LLMs into a table, comparing “best-fit scenarios, typical use cases, core strengths, and usage tips” item by item. That format was useful when information was scarce, but it is no longer sufficient today. Model capabilities now iterate on a monthly cycle, so any static ranking expires quickly. At the same time, a phrase like “good results” means very different things across business contexts: summarization tasks care about information coverage and factual consistency, extraction tasks care about field-level accuracy and format stability, and conversational tasks care about multi-turn consistency and refusal boundaries.

    A more rigorous approach is to turn “comparison” into “verifiable evaluation.” Define the task and acceptance metrics first, measure candidate models horizontally on a unified test set, then make the decision by factoring in cost, latency, compliance, and operational complexity. The methodology below does not depend on any specific vendor and can be applied directly to internal selection reviews.

    2. Building a Neutral Capability Layer Model

    To avoid being pulled by marketing language, split LLM capability into five layers and score each one separately:

    1. Base language and knowledge layer: terminology understanding, long-document compression, cross-language consistency.
    2. Instruction-following layer: output stability under multiple constraints, especially for JSON, tables, and fixed templates.
    3. Reasoning and tool-use layer: multi-step decomposition, function calling, citing and aligning with external retrieval results.
    4. Long-context layer: effective context length is not the same as usable length, so “middle-of-context recall” must be tested.
    5. Engineering and governance layer: rate-limiting policy, log observability, data residency, and audit capability.

    Use a 1–5 scoring scale and require “evidence” for every score, for example a model’s field-level F1 across 200 extraction samples, or the number of instruction violations across 50 multi-turn conversations. Scores without evidence do not enter the decision.

    3. Mapping Scenarios to Capabilities

    Different businesses weight the capability layers very differently. The following mapping works as a starting point:

    • Knowledge Q&A and customer support: knowledge layer plus instruction following, requiring low hallucination and explicit refusal.
    • Document extraction and structuring: instruction following plus long context, requiring strict schema adherence.
    • Code and operations assistance: reasoning and tool use, requiring explainable intermediate steps.
    • Content production and rewriting: language layer, requiring controllable style and deduplication.
    • Data analysis and report interpretation: tool use plus numerical consistency, requiring traceable computation.

    In practice, write the weights as configuration so that switching models changes only the configuration and not the business code. This keeps later replacement costs at the lowest level.

    4. Unified Evaluation Set and Illustrative Code

    The evaluation set should contain four sample types: regular samples, boundary samples, adversarial samples, and long-document samples, at a ratio of roughly 5:2:2:1. Keep the calling side abstracted behind an interface, as shown below:

    1. # Pseudocode: unified model adapter layer that hides vendor differences
    2. def call_model(prompt, schema, cfg):
    3. client = build_client(cfg.provider) # backend chosen by configuration
    4. resp = client.chat(
    5. model=cfg.model_name,
    6. messages=[{"role": "system", "content": SYS},
    7. {"role": "user", "content": prompt}],
    8. temperature=cfg.temperature, # 0-0.2 recommended for extraction
    9. max_tokens=cfg.max_tokens,
    10. )
    11. return validate(resp, schema) # retry if structure validation fails

    The key point is that temperature and retry strategy should be layered by task: use low temperature for extraction and classification, and high temperature for creative work. When structure validation fails, use “degraded retry plus field-level patching” rather than starting the whole thing over.

    5. Prompt and Context Engineering Practices

    The core of prompt engineering is not polished wording but verifiable constraints. Four recommendations:

    1. Give the schema before the content, and specify required fields, optional fields, and enum ranges.
    2. Split long documents into segments with paragraph numbers, and require citations by number for traceability.
    3. Explicitly state refusal conditions and the output format to use when uncertain, reducing the chance of fabrication.
    4. In few-shot examples, include only “boundary cases”; regular examples instead push the model to overfit to the example style.

    On the context side, introduce retrieval augmentation: first use hybrid keyword and vector recall, then rerank and keep the top few fragments, and finally cap the length of each fragment to avoid diluting middle-of-context information.

    6. Cost, Latency, and Capacity Planning

    Cost cannot be judged by unit price alone; look at “cost per unit of business output.” A suggested calculation is: average tokens consumed per task × task volume × unit price + retry overhead + manual review cost. In practice, retry overhead is often underestimated and can amplify by 20%–40% when structure validation is strict.

    For capacity planning, split traffic into two channels: online interaction and offline batch processing. Online uses a low-latency configuration with queuing and degradation; offline uses large-batch concurrency with sharding and resume-from-checkpoint. Adding a cache layer (returning directly on identical prompt hits) and writing results to object storage can significantly reduce repeated computation.

    7. Observability and Continuous Iteration

    After launch, establish three categories of metrics: quality metrics (field accuracy, refusal accuracy), performance metrics (time to first token, overall latency), and cost metrics (consumption per thousand calls). Logs should record only necessary fields and be desensitized. Run the evaluation regression every time the model or prompt changes, and maintain a version comparison table.

    If an organization already has general cloud capabilities such as a container platform, message queue, logging service, and monitoring and alerting, these can be combined into a closed loop of “evaluation pipeline + canary release + automatic rollback.” Baidu AI Cloud has mature practices in these general engineering components and can serve as an architectural reference, but the actual selection should still be based on your own evaluation results.

    8. Common Pitfalls and How to Avoid Them

    • Looking only at ranking tables: ignores task differences and causes metrics to drop after launch.
    • Assuming longer context is always better: ignores middle-context recall decay and rising cost.
    • Assuming more complex prompts are always better: too many constraints conflict with each other.
    • Missing a degradation path: rate limiting or timeouts directly make the business unavailable.
    • No regression mechanism: a single prompt change triggers full-scale quality fluctuation.

    9. Conclusion

    The right approach to model selection is “task definition → capability layering → unified evaluation → canary launch → continuous regression.” Treat comparison tables as clues rather than conclusions, and maintain the evaluation set as a long-term asset. Only then can you sustain stable engineering returns in a fast-iterating environment.