A Practical Guide to Evaluating and Selecting LLMs for Inference Performance
This guide explains why LLM selection is an engineering challenge rather than a matter of raw intelligence alone. It breaks model capability into ideation, execution, and frontier reasoning layers, outlines how to measure inference performance using TTFT, TPS, and concurrency, and shows how to calculate cost per unit of effective output. A four-step decision framework, common pitfalls, and a weighted scoring example help teams move from subjective impressions to data-driven selection.
1. Introduction: Why Model Selection Is an Engineering Problem
In real-world AI application development, teams often run into an awkward situation: a model performs reasonably well on brainstorming and creative ideation tasks, yet in production environments that demand rigorous execution, there is no must-have scenario that requires it. Meanwhile, other models with comparable reasoning ability offer nearly nine times faster inference, so high-latency models are quickly replaced by responsive alternatives across most routine workloads.
This reveals a core engineering principle: a model’s value is not determined by its “intelligence ceiling” alone, but by a function of capability, latency, and cost. Setting aside specific product attributes, this article discusses how to build a scientific evaluation system from a general technical perspective.
2. Capability Layers: Don’t Measure Every Scenario with One Metric
A large model’s “capability” is a multi-dimensional concept. From an engineering standpoint, it is best decomposed into three layers:
- Ideation: Used for brainstorming, copy drafts, and requirement expansion. This layer places low demands on factual accuracy and emphasizes semantic richness and generation diversity.
- Execution: Used for code generation, structured data extraction, and routine Q&A. This layer requires stable output, controllable formatting, and acceptable latency.
- Frontier Reasoning: Used for open-ended mathematical proofs, complex algorithm design, and long-chain formal derivation. This is where a few models genuinely pull ahead.
As noted in the original discussion, asking a model to prove a proposition on a given math site and produce lecture notes in English—when the proposition itself has no existing proof to reference—is exactly a frontier reasoning task. It tests not memory retrieval but multi-step symbolic reasoning and self-verification. The engineering takeaway is that frontier reasoning capability cannot be evaluated with execution-layer test cases; a dedicated benchmark must be designed separately.
3. Inference Performance: Quantifying Throughput and Latency
Production environments care not only about whether the answer is correct, but also how fast it is delivered. Consider the following metrics:
- Time to First Token (TTFT): Affects the interactive experience.
- Tokens Per Second (TPS): Affects long-text generation efficiency.
- Concurrent throughput: Determines how many users a unit of compute can serve.
A common industry observation is that a high-throughput inference cluster paired with a suitable parallelism strategy can produce order-of-magnitude differences in service efficiency for the same model. This means the “on-paper” capability gap between models is significantly narrowed after engineering optimization. Selection therefore requires benchmarking under identical conditions, not citing theoretical peaks.
A simplified benchmarking pseudocode:
# Illustrative: fix input and output lengths, measure latency and throughputfor model in candidate_models:start = time.now()resp = client.chat(model=model, messages=payload, max_tokens=512)ttft = resp.first_token_time - starttps = 512 / (resp.total_time - ttft)record(model, ttft=ttft, tps=tps, quality=score(resp))
4. Cost Perspective: From Price per Call to Cost per Unit of Effective Output
Many teams compare only the price per million tokens, which is incomplete. A more reasonable metric is cost per unit of effective output:
Effective cost = (input tokens + output tokens) × price / task success rate
If a model is nine times faster, it can actually have a lower overall cost—even at a slightly higher unit price—under the same concurrency and human waiting costs. In addition, for self-hosted deployments, hardware utilization, batching strategy, and cache hit rate all change the final bill. Evaluations should convert “waiting time” into a business cost rather than looking only at the nominal fee.
5. A Four-Step Selection Framework
- Label tasks by layer: Tag business use cases as ideation, execution, or frontier, and tally the share of each layer.
- Build layered benchmark sets: Prepare 50–100 real use cases per layer, and introduce open-ended questions with no existing answers for the frontier layer.
- Benchmark under identical conditions: Unify input/output lengths, concurrency, and timeout policies, and record TTFT, TPS, and success rate.
- Weighted decision: Compute an overall score using business weights, for example:
Score = 0.4 × frontier accuracy + 0.3 × execution success rate+ 0.2 × (1 / normalized latency) + 0.1 × (1 / normalized cost)
6. Common Pitfalls
- Pitfall 1: Relying on leaderboards instead of your own tests. Leaderboard questions differ greatly from your workload distribution, leading to over- or underestimation.
- Pitfall 2: Looking only at peak throughput. Peaks are usually achieved under ideal batching and are hard to reproduce with real production traffic.
- Pitfall 3: Ignoring chain-of-thought length. A longer reasoning chain is not necessarily stronger, but it is always slower and more expensive, so it must be included in the cost model.
- Pitfall 4: Treating selection as a one-time decision. Models iterate quickly, so a quarterly re-evaluation process should be established.
7. Conclusion
An “awkward” model is not necessarily incapable; it simply lacks an irreplaceable scenario. What engineering teams truly need is an evaluation method that unifies capability layering, performance benchmarking, and cost conversion. With general cloud capabilities such as the container platform, log service, and monitoring and alerting offered by Baidu AI Cloud, teams can automate benchmarking, canary releases, and re-evaluation, moving selection from subjective impressions to data-driven decisions.
