Evaluating and Selecting LLMs for Production: A Practical Framework
This article explains how to replace ad hoc impressions of a large language model with a repeatable evaluation for production selection. It covers evaluation goals, task segmentation, the trade-offs between quality, latency, throughput, and cost, verification of math and reasoning output, deployment economics, a selection matrix with quality gates, and common pitfalls with governance practices.
When large language models move into production, a common mistake is treating a single hands-on experience as an engineering selection decision. Some people value the quality of associations when brainstorming. Others care about speed on execution tasks. Others focus on complex math reasoning and long-chain code generation. These observations are valuable, but without a unified evaluation framework, it is easy to fall into one-sided judgments: recommending a model because it performed well once, or rejecting it because it had high latency once. A better approach is to turn raw impressions into measurable dimensions, then reach reproducible selection conclusions through task layering, a metric system, and gating mechanisms.
1. Evaluation goals: from “can it be used” to “is it worth using”
Before evaluating a general-purpose LLM, define the evaluation goal. In early trials, teams usually only ask whether the model can complete the task. In production, the question changes to whether latency, throughput, cost, and stability are acceptable under a given quality constraint. The logic of these two stages is fundamentally different.
A production evaluation should cover at least five metric groups: task quality, response latency, throughput, unit cost, and operational stability. Task quality should not rest on whether one output looks impressive. Measure it with a fixed evaluation set, a human scoring rubric, and consistency checks across multiple runs. Separate time to first token from full response time, and look at percentiles rather than averages. Throughput depends on the concurrency scenario and the batching strategy. Cost should include inference resources, caching, retries, and human review. Stability means checking behavior in long sessions, with long contexts, with abnormal inputs, and under peak concurrency.
At the deployment level, the evaluation pipeline can run on Baidu AI Cloud’s container platform. Object storage keeps the evaluation sets and results, and log service with monitoring alerts keeps the process traceable. The key point is not any specific product. It is building evaluation as an engineering system instead of a one-time manual test.
2. Task layering: creative ideation, structured execution, and mathematical reasoning are different abilities
Different tasks place very different demands on a model. Evaluating them together leads to wrong conclusions.
The first group is creative ideation, such as brainstorming, solution enumeration, and risk list generation. These tasks prioritize coverage, association quality, and diversity. Use blind review by several people, and track a repetition rate and a miss rate.
The second group is structured execution, such as generating reports from templates, extracting fields, converting formats, and producing runnable code snippets. These tasks prioritize instruction following, format stability, and whether errors can be detected. Automated assertions combined with sampled human review fit this group well.
The third group is mathematical and formal reasoning, such as deriving propositions without given proofs, or writing English lecture notes with formula typesetting. For these tasks, the final answer is not enough. Check the reasoning steps, notation consistency, and whether the output looks complete while skipping key steps.
Mathematical tasks need particular care. A model may reproduce a proof it has seen before, or produce a plausible but wrong derivation. Evaluation should therefore use propositions that have not been published, variants of known problems, or problems that require multi-step constructions. Ask the model to show intermediate steps that can be checked. For formula typesetting, verify that symbol definitions and cross-references stay consistent. Only task layering shows whether a candidate model is strongest at creativity, execution, or reasoning.
3. Trade-offs between intelligence and speed: four dimensions linked together
Selection often involves a choice between a model with slightly better quality but slower responses, and a faster model with slightly weaker quality. The right approach is not to compare single response times. Build a linked model of four dimensions: a quality threshold, a latency ceiling, a throughput target, and a cost budget.
Start with a quality gate. A candidate model must reach a minimum quality level on the core evaluation set, or it does not move to later comparisons. After passing the gate, compare latency and cost. For interactive scenarios, time to first token and recovery from interruptions matter more. For batch scenarios, throughput per unit of time and cost per task matter more. For high-value, low-frequency tasks, weight quality much more heavily. If a task shows a clear speed difference but a small quality gap, the faster option can go into a low-priority queue or run asynchronously. If a quality gap would increase human review costs, do not decide based on inference speed alone.
Speed advantages must be measured across the full pipeline. A task may include retrieval, tool calls, retries, format validation, and human review. Model inference is only one step. If unstable output increases retries, the apparent speed advantage can disappear. Record end-to-end time, not only the model call time.
4. Math and complex reasoning evaluation: check verifiability, not just the score
Mathematics is one of the hardest dimensions in general-purpose model evaluation. A correct answer does not show stable reasoning, and a long derivation does not guarantee a correct one. A more reliable method combines four checks: correctness of the result, verifiability of each step, consistency of notation, and handling of boundary conditions.
Correctness can be judged against a reference answer or by expert review. Verifiability requires that each step can be checked independently. Notation consistency checks variable definitions, quantifier scopes, and cross-references. Boundary handling checks whether the model misses special cases. For tasks such as writing English lecture notes, also assess the accuracy of terminology, the paragraph structure, and the quality of the formula typesetting. These tasks suit small-sample deep evaluation rather than large-scale shallow evaluation. High-quality math samples are expensive to build, and a small set of well-designed problems often separates models better than many simple ones.
Be wary of memorization. If the problems come from public question banks, a model may produce answers from memory. A safer approach uses variant problems, combined problems, and unpublished propositions, and requires the model to show checkable intermediate steps. Report results as “performance on this evaluation set under these scoring rules,” not as a broad claim that a model has the “strongest math ability.”
5. High-throughput inference and deployment economics: from single-machine experience to system benefit
Once a model enters production, inference throughput and deployment economics become key variables. High throughput usually depends on batching, continuous batching, quantization, caching, parallel scheduling, and specialized accelerator hardware. Each method affects quality, latency, and cost differently, so evaluate them together.
For example, batching raises throughput but can increase tail latency. Quantization lowers memory use and unit cost, but may affect stability on complex reasoning. Caching reduces the cost of repeated requests, but requires handling invalidation and consistency. Specialized accelerators raise throughput, but change deployment complexity and operations requirements. A deployment evaluation should therefore answer three questions: Does quality still meet the target at the desired throughput? Is tail latency acceptable at peak concurrency? Is the cost per valid task within budget?
For self-hosted and externally served scenarios, also consider license compliance, data isolation, version upgrades, failure recovery, and capacity planning. High throughput matters only within quality gates and cost constraints. Build the load test set from the real business request distribution. Record success rate, retry rate, human intervention rate, and end-to-end cost. Do not rely only on peak throughput numbers.
6. Selection matrix and decision process
Use a matrix to structure the selection. Rows are candidate models. Columns are evaluation dimensions. Each cell holds the measured result and its confidence level. Dimensions can include creative quality, execution stability, mathematical reasoning, long-context performance, time to first token, tail latency, throughput, unit cost, deployment complexity, and compliance and operability. Assign weights to each dimension, and adjust the weights to fit the business scenario.
A practical process works like this. First, define the task layers for the business. Next, build a fixed evaluation set and scoring rubric. Then run small-sample deep evaluation and large-sample automated evaluation. After that, run concurrency tests and cost calculations. Finally, apply gating rules to produce a shortlist of candidates. The following illustrative pseudo-configuration only shows the structure of the evaluation. It does not correspond to any real interface:
evaluation_plan:task_groups:- ideation_tasks- structured_execution_tasks- math_proof_tasksmetrics:quality: rubric_reviewlatency: p50_p95throughput: effective_tasks_per_secondcost: cost_per_valid_taskstability: retry_rate_and_failure_rategates:- quality >= quality_threshold- p95_latency <= latency_target- cost_per_valid_task <= budget- failure_rate <= failure_threshold
This configuration turns “experience” into task groups, metrics, and gates. Only candidates that pass the quality gate move on to latency and cost comparisons. Only options that pass the stability check move on to a production pilot.
7. Common pitfalls and governance recommendations
Common pitfalls include using a single case in place of statistical evaluation, using averages that hide tail latency, measuring only model call time and ignoring the end-to-end pipeline, treating public question bank scores as proof of real reasoning ability, overlooking the cost of retries and human review, and self-hosting without a compliance assessment.
For governance, set up a continuous evaluation process. Version the evaluation sets, and include every model upgrade in regression testing. Keep human review for high-risk tasks. Set alerts for changes in cost and quality. Run capacity and failure drills for the deployment plan.
In short, evaluating a general-purpose LLM should not stop at subjective experience or one-off comparisons. Build an engineering system with task layering, quantified metrics, gated decisions, and ongoing regression testing. Creative ideation, structured execution, mathematical reasoning, throughput and cost, and deployment governance each need their own evaluation methods. Only by weighing intelligence, speed, cost, stability, and verifiability in one framework can a team reach technology selection conclusions that are reproducible, auditable, and practical to deploy.
