Local LLM Inference Evaluation: Throughput, Latency, and SQL Generation Performance

    This article presents a local evaluation of a production-version large language model, covering both inference performance and task quality. On the performance side, it examines prefill throughput, concurrency degradation, and time-to-first-token (TTFT), showing that request queuing and batching limits—not raw compute—are the primary bottlenecks under high concurrency and long contexts. On the quality side, it analyzes SQL generation results where strict grading produced a low pass rate despite largely correct logic, with most failures caused by rounding precision, metric definition, and output formatting. The article also outlines a three-step bottleneck diagnosis method, practical tuning directions, and recommendations for building reproducible evaluation baselines.

    1. Evaluation Background and Goals: Why a Good Benchmark Score Does Not Mean Production-Ready

    As large language models move into production deployment, developers care less about whether a model can answer correctly in a single test and more about whether it can answer correctly, consistently, and predictably under fixed hardware and concurrency constraints. A recent local evaluation of a production-version model produced a representative finding: on the speed side, throughput degraded noticeably under high concurrency and long contexts; on the capability side, SQL generation showed “basically correct logic but lost points on formatting details,” resulting in a low overall pass rate. The takeaway is that evaluation must cover both performance and quality, and the grading methodology itself should be treated as a first-class concern.

    The evaluation had three goals:

    • Explainable performance: go beyond tok/s numbers to identify whether the bottleneck is compute, GPU memory, or scheduling/queuing.
    • Attributable quality: break failures down into logic errors, misinterpretation of metric definitions, and format mismatches.
    • Reproducible conclusions: fix the model version, prompts, grading scripts, and hardware parameters to form a regression baseline.

    2. Performance Evaluation: The Triangle of Throughput, Latency, and Concurrency

    2.1 Prefill Phase: Single-Stream Performance and Length Decay

    Single-concurrency prefill peaked at roughly 757 tok/s with 4k input and stayed within 629–758 tok/s from 2k to 32k, showing no significant length decay. This indicates that, under this hardware and inference framework configuration, prefill compute was well utilized and long contexts did not introduce a superlinear compute penalty.

    Engineering implication: if your workload is mainly “large documents submitted in one shot with low concurrency,” prefill performance is the main source of gains. Optimization effort should then focus on batching strategy and GPU memory budgeting rather than the model itself.

    2.2 Concurrency Decay: Scheduling Parameters Are the Invisible Ceiling

    As concurrency increased, prefill throughput dropped sharply: about 30%–45% at 2 concurrent requests, around 50% at 4, and at 6 concurrent requests with 2k input it fell from 688 to 228 tok/s, a drop of roughly 63%. Decode stayed stable at 23.8–28.7 tok/s with a single stream but fluctuated in the 8–18 range; long prompts (16k/32k) combined with 4–6 concurrent requests fell to a low of 8–11 tok/s, while the rebound to 20–28 tok/s at 32k more likely reflects data-point noise than a genuine recovery.

    Root cause analysis points to the inference service’s batching limit: when the maximum number of concurrent sequences is capped at 2, requests beyond that queue up, long prefills block one another, and the result is worse TTFT and amortized prefill throughput. The following illustrative config shows the tuning direction (illustrative only, not product-specific parameters):

    1. # Illustrative: increase concurrency capacity and batching budget
    2. scheduler:
    3. max_num_seqs: 8 # raise parallel sequences to reduce queuing
    4. max_num_batched_tokens: 32768 # raise per-batch token budget; trade off GPU memory
    5. gpu_memory_utilization: 0.88 # reserve KV and temporary buffers to avoid OOM

    2.3 TTFT: Queuing, Not Compute, Is the Main Cause

    Time to first token rose linearly with input length: at 32k input, single-concurrency TTFT was about 51.5 seconds, climbing to 186.4 seconds at 6 concurrent requests. The key conclusion is that queuing is the dominant factor. This means simply switching to faster GPUs may not improve experience linearly; adjusting scheduling and batching strategy and limiting the number of long requests per batch often yields more.

    2.4 A Methodology for Locating Bottlenecks

    A three-step approach is recommended:

    1. Fix the input length and sweep concurrency across 1/2/4/6/8 to find the throughput inflection point.
    2. Fix concurrency and sweep 2k/8k/16k/32k to observe the TTFT slope.
    3. Combine GPU memory usage and KV cache levels to determine whether the limit is compute or memory/scheduling.

    In this evaluation, GPU memory utilization was about 0.91 and the KV cache was near full, indicating that further raising the batching budget requires caution and a trade-off between higher throughput and OOM risk.

    3. Capability Evaluation: The “Formatting Point Loss” Trap in SQL Generation

    3.1 Overall Results

    Across 25 SQL problems, strict grading passed 9 (36%): trivial 8/8, easy 1/2, medium 0/2, hard 0/13. Relaxing numeric precision to 1e-6 raised the pass rate to roughly 22/25 (88%). This large gap shows that most failures were not an inability to solve the task but a failure to “submit according to the rules.”

    3.2 Strengths Worth Acknowledging

    The model completed the full tool-calling loop autonomously on all 25 problems: generate SQL, execute it in an embedded analytical database, validate, and return results. Complex multi-table JOINs and window functions (such as lag columns, row numbering, and cumulative share) were written correctly, indicating solid logical reasoning and SQL syntax skills.

    3.3 Main Sources of Point Loss

    • Precision and formatting: when a problem required two decimal places, the model often omitted the rounding function; since the official grader requires strict string matching on the first row, this produced “right logic, lost points on format.”
    • Metric definition: one problem expected share computed over a specific sales channel (about 73.3%), but the model used a different channel’s definition.
    • Structural mismatch: in a few problems, the returned column names did not match the requirement, or a window-function query returned 0 rows.

    3.4 Token Consumption and Steps

    Trivial/easy problems averaged about 2 steps (roughly 2.2k + 0.2k tokens); hard problems averaged 6.1 steps, with one reaching 17 steps and 55.5k tokens, reflecting the higher exploration cost of complex tasks.

    4. Recommendations: From “It Runs” to “It Runs Stably and Correctly”

    1. Performance: moderately raise the maximum number of concurrent sequences and the batching token budget, paired with GPU memory monitoring; use a separate queue for long prompts so long requests do not block short ones.
    2. Quality: reinforce in the system prompt the requirement to strictly follow the problem’s rounding and column-naming rules; provide example skeletons for window-function problems to reduce structural errors.
    3. Evaluation: report both strict and relaxed pass rates and publish the grading scripts so that “precision methodology” is not a black box.
    4. Engineering: when deploying in environments such as Baidu AI Cloud, connect model serving, the inference framework, monitoring/alerting, and logging into a closed loop of “load test → diagnose → tune → regress.”

    5. Conclusion

    The core lesson of this evaluation is that a large model’s engineering usability is determined jointly by the “performance triangle” and the “grading methodology.” Developers should treat evaluation as part of the product, replacing single-point benchmark scores with reproducible baselines, explainable bottleneck diagnosis, and attributable quality analysis. Only then can selection and tuning decisions remain sound in real production workloads.