How to Evaluate LLM Reasoning Capabilities and Choose the Right Model
This article explains how to turn subjective impressions of LLM performance into a reproducible evaluation pipeline, and how to make model selection decisions under real resource constraints. It covers building an evaluation set from real tasks, edge cases, and regression samples; defining weighted scoring dimensions such as code correctness, structured output compliance, long-context recall, multi-turn consistency, instruction following, and response stability; using pairwise comparison to verify tier differences; and applying tiered routing, caching, batching, and budget alerts to control cost. It also outlines an engineering workflow for reproducible experiments, common pitfalls to avoid, and a phased plan for putting evaluation into practice.
1. From Subjective Impressions to Reproducible Evaluation
In day-to-day engineering work, developers often judge model strength from fragmented hands-on experience: one model writes code more reliably, another handles long documents better, and another feels close to “flagship level” on complex reasoning. Such impressions are useful, but they cannot serve as a selection criterion on their own, because they lack three things: a fixed task set, a quantifiable scoring standard, and a reproducible runtime environment.
A reliable approach is to convert impressions into an evaluation set. An evaluation set typically contains three types of samples:
- High-frequency real tasks drawn from the team’s daily requirements.
- Edge cases, including ambiguous requirements, extremely long contexts, and missing constraints.
- Regression samples, used to confirm that capabilities have not degraded after a version upgrade.
A ratio of roughly 6
2 across these three categories is a reasonable starting point: it stays close to the real distribution while preserving the ability to surface problems.
It is worth stressing that model capability is not a single dimension. The industry usually breaks LLM capability into several directions: language understanding, code generation, structured output, long-context handling, tool calling, and multi-turn consistency. These directions involve trade-offs. A model that is stronger at code is not necessarily better at long-document summarization. Evaluation must therefore start by defining “what I care about,” and only then ask “who is stronger.”
2. Designing Evaluation Dimensions: Turning “Somewhere in Between” into Numbers
Subjective impressions often sound like “this version sits between two other versions” or “it reaches a higher tier.” Verifying such claims requires converting tier differences into comparable numbers.
The following dimensions and weights are a practical starting point and can be adjusted per business:
Dimension Weight Scoring methodCode correctness 0.30 Unit test pass rateStructured output compliance 0.20 JSON Schema validation pass rateLong-context recall 0.15 Key snippet localization accuracyMulti-turn consistency 0.15 Coreference and constraint retention rateInstruction following 0.10 Proportion of satisfied constraint itemsResponse stability 0.10 Inverse of timeout and truncation rates
When scoring, assign each sample a continuous score from 0 to 1 rather than a binary “good/bad” judgment. This reduces labeling noise. The final score is the weighted sum, while per-dimension subscores are retained. Keeping the breakdown avoids the misjudgment of “similar total scores but completely different suitable scenarios.”
For relative judgments such as tiers, pairwise comparison works well: run the same sample set on two models, decide the winner manually or by rule, and compute the win rate. A win rate near 50% means there is no significant difference on that task set; only a clear deviation indicates a tier gap. This method is more stable than assigning absolute scores directly, and it is easier to reuse across version iterations.
3. Selection Under Constraints: Credits, Queuing, and Cost
In real usage, the limiting factor is often not “the model is not strong enough” but resource constraints: limited available credits, noticeable queuing at peak times, and sensitivity to per-call cost. Under these conditions, the selection goal shifts from “pick the strongest” to “pick the best under constraints.”
A practical strategy is tiered routing: classify requests by difficulty, send simple requests to a lightweight configuration, and route complex requests to a high-capability configuration. Classification can be rule-based (input length, whether code is involved, whether multi-step reasoning is required) or based on a lightweight classification model.
Illustrative implementation (pseudocode):
def route(request):if request.is_trivial: # fixed template, single-sentence rewritereturn "light"if request.needs_reasoning: # multi-step reasoning, code generationreturn "strong"return "standard" # default tier
Combined with caching and batching, consumption can be reduced further: cache results for highly repetitive requests; merge deferrable tasks into batches to avoid peak hours. On the engineering side, set budget caps and alerts so that the system automatically downgrades when consumption approaches a threshold, preventing credits from being exhausted in one burst.
On cost, looking only at unit price is not advisable. A more reasonable metric is “cost per unit of effective output,” meaning the resources consumed to complete one task that passes acceptance. A configuration with a lower unit price but a high retry rate may end up costing more overall. Evaluation reports should therefore record both the first-pass rate and the average number of retries.
4. Engineering the Evaluation: A Reproducible Experiment Workflow
Evaluation should become infrastructure, not a one-off activity. The recommended workflow is:
- Fix the dataset and random seed, and version-control samples and expected outputs.
- Standardize inference parameters (temperature, max output length, context window); treat any parameter change as a new experiment.
- Record complete metadata for every run: sample ID, latency, consumption, and error type.
- Run validation scripts automatically to produce per-dimension scores and clustered failure samples.
- Run the regression set on version upgrades and output a diff report; block the release if the difference exceeds a threshold.
Clustering failure samples is critical. Grouping failures by cause (missing constraints, format errors, factual deviation, truncation) guides follow-up actions better than looking at the total score alone: format issues can be solved with prompting and post-validation, while factual deviations require additional retrieval or a knowledge base.
5. Common Pitfalls
- Replacing business evaluation with a single leaderboard score: leaderboard task distributions differ greatly from real business workloads, so use them as reference only, never as the sole basis.
- Ignoring the engineering cost of output formats: if structured output is unstable, downstream parsing and retries will consume most of the gains.
- Looking only at peak performance: stability (timeout and truncation rates) often affects production more than the average score.
- Ignoring version drift: a model with the same name may behave differently at different times, so the version must be pinned and regression-tested.
- Mistaking queuing and credit issues for capability problems: resource constraints significantly change the perceived experience and must be recorded separately from capability evaluation.
6. Implementation Recommendations
In the starting phase, build a minimal evaluation set with 50–100 real samples and get the “run–validate–report” loop working end to end. In the second phase, introduce pairwise comparison and tiered routing, and bring cost into the same report. In the third phase, integrate evaluation into continuous integration so that any configuration or version change automatically triggers a regression run.
In scenarios that require elastic compute and supporting capabilities, you can combine them with the general cloud capabilities offered by Baidu AI Cloud, such as a container platform to host evaluation jobs, object storage to keep samples and reports, a message queue to smooth out task spikes, and logging plus monitoring and alerting to track stability. This turns evaluation from a manual activity into a sustainable engineering pipeline, keeping selection decisions objective while maintaining stable delivery quality under resource constraints.
