Benchmarking LLM Inference Performance and SQL Generation Capability: A Practical Evaluation Framework

    Evaluating whether a general-purpose LLM release is production-ready requires more than subjective impressions of single-turn Q&A. This article presents a reusable evaluation framework covering two dimensions: inference performance under local deployment (prefill/decode throughput, TTFT, concurrency degradation, GPU memory) and SQL generation quality with tool-calling loops. Real test results show stable single-concurrency inference but significant queuing and throughput decay at high concurrency with long inputs, and a complete SQL tool-calling loop with low strict-format pass rates. Tuning recommendations and output contract design are discussed.

    Benchmarking LLM Inference Performance and SQL Generation Capability: A Practical Evaluation Framework

    When evaluating whether a general-purpose LLM release is truly usable in production, subjective impressions from single-turn Q&A are not enough. A credible assessment must cover three aspects at once: inference performance under local deployment, service stability under concurrency, and executable capability on structured-data tasks. In one internal evaluation, the model demonstrated a fairly complete tool-calling and self-verification loop on SQL generation tasks, but its pass rate under strict format matching was low. Single-concurrency local inference was stable, while high concurrency and long-input scenarios showed pronounced queuing and throughput decay. This article lays out a reusable technical framework across three layers: evaluation methodology, observation analysis, and tuning recommendations.

    1. Evaluation Goals and Methodology

    The evaluation should be split into two tracks. The first is inference service performance, focusing on prefill throughput, decode throughput, time to first token (TTFT), concurrency degradation, and GPU memory usage. The second is task quality: whether the model can autonomously generate SQL within a tool-calling loop, execute and validate it, correct errors, and ultimately satisfy the row count, column count, column names, first-row values, and rounding precision specified in the task.

    To avoid the coarse judgment of “final answer right or wrong,” a tiered task set is recommended: simple tasks verify basic syntax and single-table queries; easy tasks verify aggregation and filtering; medium tasks verify multi-table joins; hard tasks verify multi-table JOINs, window functions, cumulative shares, period-over-period calculations, and complex business definitions. Judging rules should be fixed in advance, and results should be split into “logically correct” versus “strict format match”—otherwise model capability is easily underestimated or overestimated.

    An example benchmark configuration can be abstracted as follows:

    1. benchmark_plan:
    2. input_lengths: [2048, 4096, 8192, 16384, 32768]
    3. concurrency: [1, 2, 4, 6]
    4. metrics:
    5. - prefill_tokens_per_second
    6. - decode_tokens_per_second
    7. - time_to_first_token
    8. - success_rate
    9. judge_policy:
    10. strict: [row_count, column_count, column_name, first_row_value, round_precision]
    11. relaxed_numeric_tolerance: 1e-6

    2. Inference Performance: Stable at Single Concurrency, Queuing Dominates at High Concurrency

    In one local deployment test, single-concurrency prefill peaked at about 757.7 Tok/s (4K input), staying roughly between 629 and 758 Tok/s across the 2K–32K range with no obvious length-related decay, indicating good linear processing capability in the prefill stage itself. Single-concurrency decode ran stably at about 23.8–28.7 Tok/s. Problems emerged as concurrency rose: at 2 concurrent requests, prefill throughput dropped about 30%–45%; at 4, about 50%; at 6 with 2K input, it fell from roughly 688 to 228 Tok/s—a drop of about 63%. Decode throughput fluctuated between 8 and 18 Tok/s, hitting lows of 8–11 Tok/s when long inputs combined with 4–6 concurrent requests.

    TTFT rose linearly with input length: with 32K input, it climbed from about 51.5 seconds at 1 concurrency to about 186.4 seconds at 6. The main cause was not model computation itself but request queuing: when the maximum number of concurrent sequences was set to 2, additional requests entered a waiting queue, long-prefill requests blocked each other, TTFT degraded, and prefill throughput was amortized across waiting requests. GPU memory utilization of about 0.91 and a nearly saturated KV cache also limited the headroom for simply raising concurrency.

    Tuning should follow a two-dimensional sweep—concurrency × input length—to identify the inflection points of throughput and TTFT. Raising the maximum concurrent sequence count and maximum batched tokens can help, but must be evaluated together with GPU memory headroom, KV cache capacity, and the share of long requests. A more robust approach is to introduce admission control, separate pools for long and short requests, dedicated queues for ultra-long inputs, and monitoring alerts on queue wait time and memory levels—rather than chasing peak throughput alone.

    3. SQL Generation Quality: Complete Tool-Calling Loop, Notable Losses Under Strict Format Matching

    Across 25 tiered SQL tasks, the model autonomously completed the full loop—“generate SQL → submit to the analytical database → read results → validate → correct”—in every case. Complex constructs such as multi-table JOINs, window functions, and cumulative shares were generally organized correctly, showing that its structured query generation has an engineering-ready foundation. Under strict judging, it passed 9/25 (about 36.0%): simple 8/8, easy 1/2, medium 0/2, hard 0/13. When numeric precision tolerance was relaxed to 1e-6, the pass rate rose to about 22/25 (about 88%).

    The main losses centered on format contracts: when the task required ROUND(…,2), the model often omitted the precision constraint, causing first-row string mismatches; about 15 of the 25 tasks fell into the “logically right, off by format” category. Structural failures included: a multi-table discount CTE returning non-compliant column names; a period-over-period window function returning 0 rows with wrong column names; and a channel-definition error that computed the distribution-channel share as the internet-channel share. In terms of token consumption, simple tasks averaged about 2 steps and roughly 2.2K + 0.2K tokens; hard tasks averaged about 6.1 steps, with individual tasks reaching up to 17 steps and 55.5K tokens—indicating that complex tasks need more explicit output contracts and example guidance.

    It is recommended to fix the output contract in the system prompt: column names, column order, row count, first-row format, ROUND decimal places, null representation, and sorting rules must each be declared explicitly. Provide a small number of example SQL snippets for complex patterns such as window functions, CTEs, and multi-table discounts—but examples should convey structure only, not replace the task’s business definitions. On the evaluation side, report both the strict pass rate and the pass rate with relaxed numeric tolerance, so that format issues are not misread as a lack of logical capability.

    1. SELECT
    2. channel,
    3. ROUND(SUM(sales) * 100.0 / SUM(SUM(sales)) OVER (), 2) AS share_pct
    4. FROM orders
    5. GROUP BY channel
    6. ORDER BY share_pct DESC;

    4. Overall Optimization and Conclusion

    In summary, this general-purpose LLM release is usable in single-concurrency inference and SQL tool-calling loops, but its high-concurrency serving capacity is clearly constrained by queuing and GPU memory, and strict format compliance remains its quality weakness. For production adoption: first, establish a dual-dimension baseline of “performance + quality” with fixed input lengths, concurrency levels, judging rules, and random seeds; second, apply admission control and pooled scheduling for long inputs and high concurrency; third, reinforce the output contract through system prompts and example SQL; fourth, report strict and relaxed judging results in parallel to separate genuine logic errors from format errors; fifth, continuously monitor TTFT, decode throughput, GPU memory levels, and KV cache usage. Only by aligning evaluation methodology, tuning parameters, and business SLAs can you form an objective, reproducible engineering assessment of a model release.