Evaluating LLM Inference Performance and Output Quality

    A useful LLM evaluation separates serving performance from task quality. Measure prefill and decode throughput, time to first token, and how those metrics change with prompt length and concurrency, then score automatically checkable tasks by difficulty instead of relying on a single chat impression or one overall score.

    After a large language model is running locally, the easiest mistake is to judge it by whether one chat “feels fast” or whether one question is answered correctly. A complete evaluation needs at least two independent tracks: throughput and latency of the inference service across context lengths and concurrency levels, and completion quality on tasks that can be checked automatically. Speed does not mean hard problems are solved correctly, and stable answers do not mean the service still returns on time under high concurrency.

    Separate the metrics before drawing conclusions

    Generative inference usually has two stages. Prefill sends the full prompt through the model at once and computes the first decodable state. It is dominated by compute and memory bandwidth, and it is commonly described as prompt tokens processed per second. Decode then generates tokens autoregressively, one at a time. It is often an order of magnitude slower and is more easily limited by key-value cache occupancy. Folding both stages into one “average speed” hides the real bottleneck.

    Record at least these quantities:

    • Single-request prefill throughput, split into short, medium, and long prompts, to see whether speed drops sharply as length grows.
    • Single-request decode throughput, to see whether generation is stable rather than reporting only a peak.
    • Time to first token: from request arrival to the first returned token. A roughly linear rise with prompt length is expected. A steep jump as soon as concurrency rises usually means queueing, not a sudden loss of compute.
    • Concurrency curves: how much prefill and decode each drop at 2, 4, 6, or more concurrent requests. The size of the drop is more diagnostic than the absolute number.

    If single-stream prefill throughput changes little from short prompts to very long ones, the single-request compute path is relatively healthy. If two-way concurrency already drops by about 30% to nearly half, four-way concurrency is close to a 50% cut, and six-way concurrency leaves only about one third, suspect that the service is not truly filling the device in parallel and is stuck on sequence count or batch size, with long prompts blocking one another. Decode that stays in the low twenties of tokens per second at low concurrency, then falls to single digits or the low teens when high concurrency and long context overlap, matches the common pattern of cache being spread thinner across GPU memory. If an occasional very long point suddenly rebounds, treat it as noise and recheck it; do not change the architecture because of it.

    When time to first token gets worse, check the queue first

    Time to first token rising with prompt length is the natural result of more prefill work. At the same length, tens of seconds on one stream becoming several minutes at six streams is mostly waiting, not a slower single computation. Inference engines usually limit how many sequences can be in compute at once and how many tokens a batch may hold. While an earlier long prompt is still in prefill, later requests can only queue, so the user sees a long wait before the first token.

    Do not blame the model weights first. Check whether three configuration choices conflict:

    • The maximum number of concurrent sequences is too small, for example only a very low concurrency limit, so extra requests wait in the queue.
    • The per-batch token cap is too low, so long prompts cannot be batched efficiently and the device waits to fill a batch or processes oversized sequences serially.
    • Memory utilization is already high and the key-value cache is nearly full. Raising concurrency further only causes eviction, rejection, or worse mutual blocking.

    The direction of improvement is to raise the number of sequences that can be processed together and the batch token limit, but only together with remaining memory. Cache budget, maximum context, and concurrency form a triangle: longer context or higher concurrency leaves less cache per stream, decode slows, and in extreme cases requests fail outright. A load-test report should state all three settings; otherwise numbers from different machines cannot be compared.

    How to load-test so the results are readable

    Use the same prompt-length bands—for example about 2,000, 4,000, 16,000, and 32,000 tokens—for both single-stream and multi-stream runs. Repeat each band several times, report the median, and note the spread. For prefill, look at the peak and the decay with length; for decode, look at stability; for time to first token, look at how much concurrency multiplies it. If a band has only one or two samples and contradicts its neighbors, mark it for review and keep it out of the conclusion.

    A local single-machine result also cannot be extrapolated directly to production. Production adds gateway timeouts, load balancing, request-body size limits, and cold starts. Write the conclusion as “under this device, these service parameters, and this context distribution,” not “this model is fast” or “this model is slow.” If the workload is mostly short questions and short answers, decode and low-concurrency time to first token matter more. If the workload ingests long documents, prefill and cache capacity are the main constraint.

    A plain record is enough. Reproducibility matters more than a crowded dashboard:

    1. prompt_tokens, concurrency, prefill_tok_s, decode_tok_s, ttft_s, kv_full

    If rerunning the same fields on another day changes results by an order of magnitude after only the batch size changed, write that configuration difference into the notes so an environment change is not later mistaken for model regression.

    Score capability by difficulty

    Once speed is acceptable, use tasks that can be scored automatically to see whether the model can do the work. Open chat is hard to score objectively. Prefer items with a known answer or an executable check—for example, generating a query from a table schema, calling a tool to fetch data, and judging correctness from the execution result.

    Tiers are more useful than one total score. Split items into introductory, easy, medium, and hard. If introductory items almost all pass, easy items start to fail, and medium and hard items fail broadly, the model can handle format and short workflows but cannot yet hold multi-step constraints. A result with a pass rate of about one third, concentrated in the easiest tier, should not be packaged as broadly usable. Nor should total failure on hard items erase its value on simple tasks that stay within a defined pattern.

    For data-query tasks, do not stop at whether the final sentence looks like a query. Check whether the full loop runs on its own: generate the statement, execute it in a controlled environment, read the error or the result, and revise if needed until the result is acceptable or the failure is explicit. If multi-table joins, ordered window functions, and cumulative shares are written correctly and consistently, syntactic coverage is reasonable. If failures cluster on misunderstanding the problem structure rather than omitting a function name, the gap is task modeling and constraint following, not “not knowing the syntax.” Count structural errors and execution errors separately. The former can be addressed with prompts and examples; the latter can also be retried from execution feedback.

    Three cautions apply to automatic scoring. First, finishing a tool loop is not the same as being correct for the business; the validation rules decide. Second, when hard items are few, one item carries a large weight, so report sample size and tier rather than one total that misleads model selection. Third, temperature, maximum generation length, and whether retries are allowed all change the pass rate, so the report must fix those conditions.

    Turn the two result sets into a decision

    A practical reading is four quadrants, not a ranking.

    • Fast on one stream and stable on hard problems: suitable as a core inference path, with high-concurrency capacity planned separately.
    • Acceptable on one stream but queueing as soon as concurrency rises: tune service parameters and cache budget first, and split short and long request queues if needed, rather than switching models immediately.
    • Simple tasks pass and complex tasks fail systematically: limit use to templated scenarios, and turn complex flows into stepwise constraints or human review. Do not hide this behind an overall average.
    • Time to first token on long context is unacceptable: shorten the prompt that enters the model, or compress retrieval before generation, and check whether long prefills are blocking the whole queue.

    For capacity planning, work backward from the real prompt-length distribution and the acceptable time to first token to a concurrency limit. Do not divide an idle peak throughput by average output length. When memory is already nearly full, raising concurrency often only moves the wait from the queue into cache thrashing. If throughput must increase, leave cache headroom first, then raise sequence count and the batch token limit step by step, rerunning the same length bands after each step.

    A minimum checklist for the write-up

    An evaluation report should at least include hardware and memory use, service-side concurrency and batch size, prompt-length bands, prefill and decode throughput, how time to first token changes with concurrency, pass rates by capability tier, and whether failures are structural or execution errors. With that, you can tell whether to tune the service, shorten context, or narrow the task scope. Numbers are comparable only under the same configuration. After a device or parameter change, rerun the full table instead of reusing the old conclusion.