A Practical Guide to LLM Selection and Scenario-Based Implementation

    Choosing a large language model is not just about leaderboard rankings. This guide explains how to reframe model selection around scenario profiling, six core evaluation dimensions, and four engineering techniques such as prompt engineering and retrieval-augmented generation. It also covers three levers for cost control and how to build a replaceable model abstraction layer so business code stays decoupled from any specific model.

    1. Why Model Comparisons Should Not Rely on Leaderboards

    In technical selection meetings, the most common debate is “which model is the strongest.” However, engineering practice repeatedly shows that there is no stable linear relationship between general-purpose benchmark scores and business success rates. There are three reasons:

    1. Task distribution differences: Benchmark questions are mostly standardized Q&A and reasoning tasks, while real business scenarios are full of long documents, dirty data, multi-turn context, and format constraints.
    2. Cost structure differences: A cheap single call does not mean low overall cost. Retries, context expansion, and manual review can all amplify total costs.
    3. Compliance and deployment differences: Whether data can leave a region, whether private deployment is required, and how audit logs are retained often determine the viability of a solution more than a few percentage points of accuracy.

    Therefore, the right approach is to reframe “selecting a model” as “defining the scenario + defining the constraints + defining the evaluation.”

    2. Scenario Profiling: Classify First, Then Discuss Capabilities

    Grouping business requirements into the following four categories can significantly narrow down the candidate pool:

    • Knowledge-intensive: Document Q&A, customer service knowledge bases, regulatory retrieval. Focus on long-context stability and citation traceability.
    • Generation-intensive: Marketing copy, coding assistance, summarization and rewriting. Focus on instruction following, style control, and structured output.
    • Reasoning-intensive: Data analysis, multi-step planning, math and logic. Focus on chain-of-thought quality and self-verification ability.
    • Interaction-intensive: Companion-style dialogue, voice assistants. Focus on time to first token, multi-turn consistency, and safety policies.

    Illustrative scenario scoring code:

    1. weights = {"knowledge": 0.35, "generation": 0.25, "reasoning": 0.30, "interaction": 0.10}
    2. def score(candidate, profile):
    3. return sum(weights[k] * candidate[k] * profile[k] for k in weights)

    3. Six Core Evaluation Dimensions

    1. Instruction following and structured output: Whether it can reliably produce valid JSON and comply with field and length constraints.
    2. Long-context effectiveness: Not “how long it supports,” but “whether it can still recall key information in the middle of a long text.”
    3. Multimodal and tool calling: Image understanding, function calling, and orchestration of parallel tools.
    4. Latency and throughput: Time to first token determines interaction experience, while throughput determines unit cost.
    5. Security and compliance: Content filtering, protection against privilege-escalation prompts, and options to keep data within a region.
    6. Ecosystem and operability: Whether monitoring and alerting, logging services, canary releases, and version rollback are complete.

    4. Four Engineering Enhancement Techniques

    • Prompt engineering: Use a three-part structure of role setting, few-shot examples, and output contracts to constrain model behavior.
    • Retrieval-augmented generation: Place authoritative knowledge in an external knowledge base, retrieve before generating, and require the model to provide citation snippets to reduce hallucinations.
    • Multi-tier routing: Send simple requests to smaller models and escalate complex requests to larger models, balancing cost and quality.
    • Evaluation loop: Build a regression set that includes edge cases, and run it every time the prompt or model version changes.
    1. {"task":"classify","labels":["billing","bug","feature"],"fallback":"human"}

    5. Three Levers for Cost Control

    Context trimming, cache reuse, and batching are the three most effective techniques. Caching results for high-frequency, stable Q&A, segmenting and summarizing long documents before adding them to prompts, and using batch APIs in offline scenarios can typically deliver order-of-magnitude cost reductions.

    6. Neutral Selection Recommendations

    On cloud platforms such as Baidu AI Cloud, enterprises can combine solutions by general capability category: use object storage to hold raw knowledge base files, use a container platform to deploy inference services, and use logging services and monitoring alerts to build an observability system. When selecting, there is no need to pursue a single “strongest model.” Instead, build a replaceable model abstraction layer that decouples business code from any specific model, enabling free switching and continuous evolution across multiple models.