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

    This article presents a local benchmark of an open-source large language model release, evaluating both inference performance and SQL generation capability. On the performance side, it breaks down prefill throughput, decode speed, and time-to-first-token across concurrency levels, showing how low max concurrent sequences settings cause queuing and severe degradation under load. On the capability side, it explains why SQL answers can be logically correct yet score low due to strict formatting and numeric precision requirements. It also covers tuning order, observability, prompt-level output contracts, and model selection guidance for reproducible deployment decisions.

    1. Why a “Release Version” Is Not Necessarily Stronger Across the Board

    A local test of a stable release of an open-source large language model showed below-expectation results on both inference speed and answer quality, with some metrics even trailing lighter variants in the same series. This conclusion seems counterintuitive but is quite typical: release versions usually expand capability dimensions, while inference cost, concurrent scheduling, and output format stability are amplified at the same time. Therefore, evaluating a model version should not rely on a single leaderboard; “serving performance” and “task completion” should be viewed in the same table.

    It is worth emphasizing that such conclusions depend heavily on the local environment: VRAM capacity, batching parameters, quantization method, and context length can all significantly change results. The data below should be treated as a methodology example, not a universal baseline.

    2. Performance Evaluation: Separating Throughput, Latency, and Queuing

    1. Prefill Stage: Strong at Single Concurrency, Collapses at High Concurrency

    In testing, single-concurrency prefill peaked at about 757 tok/s (4k input) and stayed at 629–758 tok/s across the 2k to 32k range, showing almost no noticeable decay as length grows, which indicates full compute utilization. However, performance degraded markedly once concurrency increased: about 30%–45% at 2 concurrent requests, about 50% at 4, and at 6 concurrent requests with 2k input, throughput dropped from 688 tok/s to 228 tok/s, a decline of about 63%.

    This kind of “concurrency collapse” is usually not a model issue but rather queuing and mutual blocking caused by scheduling configuration.

    2. Decode Stage: Stable but Low, Worst with Long Context Plus High Concurrency

    Single-concurrency decode stayed stable at 23.8–28.7 tok/s; with concurrency above 8, it fell to around 18 tok/s; when 16k/32k long prompts were combined with 4–6 concurrent requests, it dropped to a low of 8–11 tok/s. The rebound observed at 32k is more likely sampling-point noise than a real optimization.

    3. Time to First Token: Queuing Is the Main Cause

    Time to first token rose nearly linearly with input length: at 32k input, single concurrency was about 51.5 seconds, rising to 186.4 seconds at 6 concurrent requests. The core reason is that the inference service set the maximum number of concurrent sequences too low (such as 2); the excess enters a queue, long prefill tasks block each other, throughput is averaged out, and latency is amplified.

    4. Bottleneck Identification and Tuning Order

    It is recommended to follow the order of “locate first, tune parameters next, scale out last”:

    1. 1) Observe queue length and wait time to confirm whether it is a queuing issue
    2. 2) Moderately increase max concurrent sequences and max tokens per batch
    3. 3) Monitor VRAM水位 (e.g., utilization already at 0.91, KV cache nearly full)
    4. 4) When VRAM is insufficient, trade space via quantization, shorter context, or layered caching
    5. 5) If targets are still not met, consider horizontal scaling and load balancing

    The key point is that increasing concurrency parameters can improve high-concurrency throughput, but it must trade VRAM for space; otherwise, a throughput problem turns into a VRAM overflow problem.

    3. Capability Evaluation: Why SQL Generation Is “Logically Correct but Low-Scoring”

    1. Overall Results

    Among 25 structured query questions, only 9 passed under strict judgment (36%), distributed as: easy 8/8, relatively easy 1/2, medium 0/2, hard 0/13. If numeric precision is relaxed to 1e-6, the pass rate can rise to about 22/25 (88%).

    2. Highlight: Complete Tool-Calling Loop

    All 25 questions autonomously completed the multi-step loop of “generate statement → execute in an embedded analytical database → validate → determine result”; complex multi-table joins and window functions (such as lag retrieval, ranking, and cumulative share) were basically correct, with only two questions showing structural errors.

    3. Main Loss Points: Format and Precision

    Most failures were not logic errors but omitted the two-decimal rounding required by the prompt, while the official judgment requires the first-line string to match strictly, resulting in 15 questions that were “logically correct but one point short on format.” Another three were structural failures: mismatched return column names, empty results, and channel-caliber misunderstanding (calculating distribution channel share as online channel).

    4. Cost Observation

    Easy questions converged in an average of two steps and about 2.4k tokens; hard questions averaged 6.1 steps, with individual questions reaching 14–17 steps and around 55k tokens. Step count and token consumption can serve as important metrics for evaluating “inference economy.”

    4. Actionable Optimization Recommendations

    • Prompt level: Explicitly reinforce in the system prompt that “rounding and field naming must strictly follow the prompt requirements,” and provide an output contract example.
    • Evaluation level: Distinguish two sets of metrics, “logic correctness rate” and “format strictness rate,” to avoid misjudging format issues as capability issues.
    • Service level: Make max concurrent sequences, batch token limits, and VRAM utilization into an observable dashboard, and record queue wait time synchronously during stress testing.
    • Selection level: Lightweight variants are more stable in some scenarios, while release versions suit scenarios with higher capability-ceiling requirements and sufficient VRAM and concurrency configuration.
    • Cloud practice: Combine container platforms to host inference services, object storage for models and data, and monitoring/alerting to track latency and VRAM水位, forming closed-loop operations.

    5. Conclusion

    The takeaway from this test is that model version evaluation must adopt a “dual-track system of performance and quality.” On the performance side, rule out queuing and VRAM bottlenecks before tuning parameters; on the quality side, write format contracts into prompts and evaluation so that true capability can surface. In environments with complete cloud-native capabilities such as Baidu AI Cloud, combining stress testing, observability, and prompt engineering is necessary to make robust and reproducible deployment decisions.