Benchmarking Local LLM Inference and Task Accuracy: A Practical Guide to Throughput, Latency, and Strict Scoring

    This article explains how to evaluate locally deployed large language models with two independent test tracks: service-side throughput and latency, and task-side pass rates under fixed scoring rules. It shows how to separate prefill and decode performance, measure concurrency and TTFT effects, diagnose scheduling and KV-cache limits, evaluate tool-loop capability, and apply strict output contracts. Readers learn how to classify failures into precision, structure, and definition errors and turn evaluation into an executable protocol so benchmark results lead to targeted fixes.

    Why a Single Correct Answer Is Not Enough

    When deploying a large language model locally, developers and enterprise users often treat “it answered one question correctly” as the launch criterion. What actually determines usability is two independent sets of metrics: throughput and latency on the service side, and pass rate on the task side under fixed judging rules. The first answers “will it remain stable when many people use it at once?” The second answers “does it count as correct under business rules?” Running only subjective chat tests reveals neither long-context queueing nor batch failures caused by ignored format constraints.

    The following sections split speed testing and capability testing along the lines of a reproducible experiment. The order-of-magnitude figures come from a summary of one single-machine inference service load test. They illustrate phenomena and how to read measurements; they are not official specifications for any particular model. Results change with hardware, context length, and batch limits.

    Four Quantities to Separate in Speed Testing

    An inference request usually has two phases. Prefill computes the entire prompt at once and produces the first decodable state. Decode then generates tokens one by one. Mixing both into a single “average tok/s” number hides the bottleneck.

    At minimum, record the following:

    • Prefill throughput: Under a fixed prompt length, measure single-request peak and whether throughput drops significantly from 2K to 32K. In one observation, the single-concurrency peak near 4K was around 700+ tokens per second; from 2K to 32K, throughput roughly stayed in the 600–700+ range. Length itself was not the main cause.
    • Prefill degradation under concurrency: At 2-way concurrency, a drop of 30–40% is common; at 4-way concurrency, about half; at 6-way concurrency, more than 60%. For example, a 2K prompt fell from about 688 tok/s to about 228 tok/s. This indicates that compute is being shared across requests, not that the model suddenly became slower.
    • Decode speed: Single-concurrency decode is often stable at 20+ tokens per second. At medium concurrency, especially with 16K or 32K long prompts added, it may fall to single digits or the low teens. Occasional rebounds at long-context points are usually sampling noise or a scheduling moment when compute slots happen to be free; they should not be interpreted as “longer is faster.”
    • Time to first token (TTFT): TTFT usually degrades roughly linearly with prompt length. At 32K and single concurrency, it can reach the tens of seconds; at the same length with 6-way concurrency, it can reach the minutes level. In that case, the main cause is often queueing, not decode itself.

    When reading these numbers, keep these controls fixed: batch limit, GPU memory utilization, whether continuous batching is enabled, and whether prompts share a repeated prefix or are completely different. Otherwise, two experiments are not comparable.

    When Concurrency Degrades, Check Scheduling Before Blaming the Model

    When the service configuration sets the number of simultaneously processed sequences very low—for example, a limit of 2—the third and later requests can only wait in the queue. Long prefills also occupy compute for a long time, extending TTFT for later requests and spreading prefill throughput across multiple paths. This is not the same issue as “the model cannot handle long text.”

    The usual improvement direction is to increase the number of simultaneous sequences or raise the token limit that can be batched in a single step, so short requests do not have to wait indefinitely behind long prefills. The cost is that KV cache and activation memory both grow. If GPU memory utilization is already around 90% and the cache is nearly full, increasing concurrency further will only trigger swapping, recomputation, or outright failure. A reasonable approach is to build a table of prompt length × concurrency × memory usage × TTFT × prefill throughput, and find the narrow gap between “queueing disappears” and “cache is full,” rather than maxing out both limits at once.

    For enterprise deployment, timeout, retry, and user-perceived wait should also be designed separately. When TTFT is already measured in minutes, a frontend that still expects a few-second wait like a chat product will misclassify the service as failed. Monitoring should include at least queue depth, number of tokens currently in prefill, and cache hit or occupancy rate—not just GPU utilization.

    Capability Testing: Tool Loops and Strict Judging Are Different

    Another type of evaluation lets the model write queries, execute them, inspect results, and revise in a restricted environment until it submits. In one 25-question structured task, the model could autonomously complete the full loop of “generate statement → execute → validate → confirm result,” showing that the tool-calling path works. For complex multi-table joins, lagged values, row numbers, and window calculations such as cumulative share, it could also write syntactically correct statements in most cases. That proves it can act, but not that it has passed under the scoring rules.

    If the official judging requires exact agreement on row count, column count, column names, and the first-row string, the overall pass rate may be only about one third: the simplest questions all pass, medium questions begin to fail, and hard questions fail broadly. After loosening numeric tolerance to a very small relative error, the pass rate can rise to nearly 90%. The gap is mainly not a broken reasoning chain; it is that the output contract was not treated as a first-class constraint.

    Common failures fall into three categories, and the troubleshooting order should not be reversed.

    1. Precision and format. The prompt requires the result to keep two decimal places, but the model omits rounding. The logic is correct, yet the first-row string does not match. Under strict matching, this accounts for most “almost right” questions. Statistically, this often applies to more than ten out of twenty-plus questions.
    2. Structural mismatch. The final result set’s column names or row count differ from the reference answer. For example, a multi-table discount calculation uses a common table expression, but the final projection writes the column name for “all rows” incorrectly; or a period-over-period window calculation returns zero rows, or the column names do not match expectations. This category cannot be rescued by loosening floating-point tolerance.
    3. Definition mismatch. The filter conditions misunderstand the channel, time window, or entity, so the calculated share is attributed to the wrong subject. Even if the numbers look good, the answer is wrong. This should be listed separately as a requirement-understanding issue, not a format issue.

    Token consumption can also serve as a diagnostic signal. Simple questions often finish in about two steps, with modest prompt and generation volume. Hard questions show a clear increase in average steps; some require more than ten steps and tens of thousands of tokens. A surge in steps usually means the model is looping between execution errors and self-correction. If the error message does not return column names and sample rows, it will repeatedly modify irrelevant clauses, increasing cost while structural errors remain.

    Write the Evaluation Protocol as an Executable Specification

    Write each question in four parts, none optional.

    • Input: table schema, sample rows, and business definitions (channel, time, tax inclusion).
    • Process constraints: the model must call the executor and must not merely “pretend to query” in text. On failure, it must rewrite based on the error, not repeat the same statement.
    • Output contract: column names, types, ordering, decimal places, and null representation. When rounding is required, specify the function and number of digits, and require the final projection to match the contract literally.
    • Judging: use full strict matching by default. Store a separate “numeric tolerance” result only to distinguish format issues from logic issues; it does not replace the acceptance line.

    The system prompt should state explicitly that decimal places, column names, and ordering in the prompt are part of acceptance, and omission means failure. For error-prone windows such as period-over-period and cumulative share, provide a short example in the prompt that is structurally similar but uses different data, reducing the chance of “writing the function correctly but projecting the wrong column.” The example must be short to avoid leaking the answer structure as something to memorize.

    A schematic result check can be very simple; the contract matters more than the framework:

    1. -- Acceptance projection: column names, order, and decimal places match the prompt
    2. SELECT
    3. channel,
    4. ROUND(share, 2) AS share
    5. FROM final_metrics
    6. ORDER BY channel;

    When the executor returns zero rows, feed back “zero rows + actual column names” to the model instead of only saying it failed. Otherwise, when a window condition is reversed, the model cannot distinguish “no data” from “the filter is wrong.”

    How to Read a Disappointing Report

    If decode is stable and single-request prefill is not bad, but TTFT rises sharply as soon as concurrency is added, prioritize scheduling and cache budget changes rather than switching to a larger model. If the tool loop completes every time but strict pass rate is low, and pass rate jumps after loosening precision, prioritize fixing the prompt contract and judging layers rather than concluding that the model “cannot write queries.” Only when structural errors and definition errors dominate should you add examples, tighten schema descriptions, or split hard questions into verifiable subqueries.

    For enterprise users, define the launch bar as two independent gates: service level (TTFT and decode lower bounds at concurrency N and context L), and task level (strict pass rate, with tolerance pass rate attached for diagnosis). Scale only after both pass. If cloud resources such as Baidu AI Cloud are used to scale inference or store evaluation logs, accept them against the same metrics as well, instead of looking only at instance specifications and ignoring queues and cache.

    The value of evaluation is not a single broad score for the model. It is to break “queueing, memory, format, and definition” into problems that can be fixed separately. Rerun the same suite under the protocol above, and the speed curves and failure types will stabilize, giving subsequent optimization a reliable baseline.