LLM Inference Performance Evaluation and Model Selection: A Practical Guide

    LLM capability evaluation is shifting from benchmark rankings to scenario fit. This guide presents a practical methodology for evaluating inference performance and selecting models, covering task layering, throughput and latency benchmarking, verifiable task success rates, cost per effective output, and a step-by-step selection workflow to help developers make data-driven decisions.

    LLM capability evaluation is shifting from benchmark rankings to scenario fit. The same model can excel at creative ideation yet struggle with long-chain rigorous reasoning or high-concurrency online serving. This guide presents a practical methodology for evaluating inference performance and selecting models, helping developers make decisions based on data rather than impressions.

    1. Why Model Rankings Do Not Directly Guide Selection

    Two types of discussion are common in the community: subjective, experience-based comparisons, and lists of single-point performance metrics. Neither is sufficient for engineering adoption. Model service quality is determined by multiple dimensions, and no single dimension can represent the whole:

    • Effectiveness: task completion rate, factual consistency, long-context retention, structured output compliance rate;
    • Efficiency: time to first token, inter-token output interval, end-to-end throughput, performance degradation curve under concurrency;
    • Cost: cost per task, cost per unit of effective output, resource utilization;
    • Engineering: API stability, rate-limiting strategy, observability, feasibility of private deployment.

    A common misconception is extrapolating “good brainstorming performance” into “optimal engineering execution.” In reality, creative ideation tasks impose loose factual constraints and tolerate divergence, while production tasks such as extraction, rewriting, code generation, and mathematical or logical reasoning demand high accuracy and determinism. The optimal model for the two is often not the same.

    2. Scenario Layering: Define the Task Before Choosing the Model

    It is advisable to first classify business tasks into three layers, then set evaluation criteria for each.

    1. Creative ideation layer: brainstorming, copy alternatives, draft proposals. Focus on diversity and readability; some factual noise is acceptable; latency is usually not critical, and offline batch processing is possible.
    2. Rigorous reasoning layer: mathematical proofs, complex code refactoring, long-document consistency checks. Focus on completeness of the reasoning chain and verifiability of conclusions; typically requires longer outputs and a higher compute budget.
    3. High-concurrency execution layer: classification, extraction, formatting, short-text rewriting. Focus on throughput and unit cost; speed is often the decisive factor.

    A valuable observation from the original discussion is that when the effectiveness gap between models on a class of general execution tasks falls into a “perceptually indistinguishable” range while throughput differs by several times, the selection balance clearly tilts toward the higher-throughput option. This holds in engineering, but the premise is that you must first prove the effectiveness gap actually falls within a business-acceptable threshold.

    3. Evaluation Method 1: Throughput and Latency Benchmarking

    Do not use vendor-promoted data; build your own load tests. Core metric definitions are as follows:

    • TTFT (time to first token): time from request submission to the return of the first output chunk;
    • TPOT (inter-output-chunk interval): time difference between adjacent output chunks in steady state; its reciprocal approximates single-stream generation speed;
    • System throughput: sum of output produced by all concurrent streams per unit time;
    • Tail latency: P95/P99, which determines capacity planning and timeout settings.

    Illustrative load-testing script (pseudocode, expressing measurement logic only):

    1. # Pseudocode: concurrent load testing and metric collection
    2. async def one_request(client, prompt, stats):
    3. t0 = now()
    4. first = None
    5. async for chunk in client.stream(prompt):
    6. if first is None:
    7. first = now()
    8. stats.ttft.append(first - t0)
    9. stats.chunks += 1
    10. t1 = now()
    11. stats.total_time.append(t1 - t0)
    12. stats.output_tokens += stats.chunks
    13. async def run(concurrency, prompts):
    14. stats = Stats()
    15. await gather(*[one_request(client, p, stats)
    16. for p in repeat(prompts, concurrency)])
    17. report(p95(stats.ttft), p95(stats.total_time),
    18. stats.output_tokens / total_wall_time(stats))

    Key practices: fix the input and output length distribution, fix concurrency gradients (e.g., 1/8/32/128), record P95 rather than the mean, and plot a “throughput-latency” curve to find the inflection point. Beyond that point, further load only pushes up tail latency, and capacity planning should stop there.

    4. Evaluation Method 2: Task Success Rate and Verifiability

    For the rigorous reasoning layer, replace subjective scoring with automatically判定 metrics:

    • Structured output compliance rate: JSON parsing success rate, field completeness rate, schema validation pass rate;
    • Verifiable correctness: use unit tests, symbolic verification, or answer comparison for math and code tasks;
    • Long-context consistency: embed several locatable fact points in a long document and measure recall and mismatch;
    • Stability: consistency rate of conclusions across multiple samples of the same input, measuring determinism.

    Illustrative judgment logic:

    1. def judge(sample, rubric):
    2. if not schema_valid(sample, rubric.schema):
    3. return 0.0
    4. if rubric.tests:
    5. return 1.0 if all(run_test(t, sample) for t in rubric.tests) else 0.0
    6. return rubric.matcher(sample)

    The evaluation set should come from desensitized sampling of real business logs, covering long-tail and boundary inputs. When the sample size is insufficient, conclusions lack statistical significance; it is recommended to provide confidence intervals for key metrics.

    5. Evaluation Method 3: Cost per Unit of Effective Output

    Convert cost to a business-level measure rather than a unit-price measure:

    1. Cost per task = (input volume × input unit price + output volume × output unit price) / number of successful tasks
    2. Effective cost ratio = cost per task of option A / cost per task of option B

    If an option has a lower unit price but a lower success rate, retries from failures will eat up the cost advantage. Including the number of retries in the denominator is what reflects the true cost. Private or self-hosted scenarios must also account for resource usage and operations manpower; when evaluating, “compute required per unit of throughput” should be treated as a core variable.

    6. Selection Decision Workflow

    1. Build a scenario list and hard constraints (latency ceiling, compliance requirements, data-must-not-leave-domain requirements);
    2. Run a unified evaluation set on candidate options, producing three tables: effectiveness, efficiency, and cost;
    3. Set elimination rules: any unmet hard constraint leads to direct elimination;
    4. For those that pass, compute the “effective cost ratio” and determine capacity in combination with tail latency;
    5. Roll out gradually, continuously collect real metrics via monitoring, alerting, and log services, and re-evaluate monthly.

    It is recommended to adopt a switchable abstraction layer to isolate the concrete implementation and avoid tight coupling between business code and a specific model:

    1. class ModelClient:
    2. def generate(self, prompt, **kw): ...
    3. class Router:
    4. def __init__(self, clients): self.clients = clients
    5. def pick(self, task_type):
    6. return self.clients[task_type] # route to different backends by scenario

    7. Common Pitfalls

    • Using averages to mask tail latency, leading to frequent online timeouts;
    • Evaluation sets that exclude long-tail inputs, causing conclusions to fail immediately after launch;
    • Ignoring output length differences, making speed comparisons unfair;
    • Comparing only unit price without success rate, distorting cost estimates;
    • Lacking observability, so problem diagnosis relies on manual reproduction.

    8. Conclusion

    The right approach to model evaluation is “scenario first, verifiable metrics, recomputable cost.” Evaluate brainstorming, rigorous reasoning, and high-concurrency execution separately, and replace subjective impressions with self-built load tests and automated judgment. Only then can you find the current optimum among effectiveness, speed, and cost for your business, while retaining the ability to switch smoothly as technology evolves.