High-Throughput LLM Inference Explained: TTFT, TPS, and Speculative Decoding

    This article breaks down what "high-throughput LLM inference" actually means, using a set of community-measured results for a lightweight model as a starting point rather than a performance promise. It separates the two metrics that most experience debates conflate—time to first token (TTFT) and output speed in tokens per second (TPS)—and explains why they are governed by different bottlenecks. It then walks through the common engineering techniques behind high throughput: lighter model architectures, speculative decoding, continuous batching with paged memory management, and prefix caching. Finally, it covers how high throughput reshapes product positioning, how to build a repeatable load-testing methodology with comparable numbers, a quality checklist for code-generation tasks, and a reference cloud architecture with layered model routing.

    1. From “This Model Is Fast” to “High-Throughput Inference”

    A set of community-measured results circulating recently reports that a new-generation lightweight large model sustains output rates in the range of hundreds to over a thousand tokens per second, with higher peaks on code-generation tasks. Because the numbers come from community gray-release testing rather than an official release, the measurement conditions are not consistent. The more useful move is not to memorize a specific figure but to abstract the engineering question it points to: what happens to model positioning, system architecture, and interaction design when inference throughput is pushed to an extreme level.

    These figures are typically sampled on the client side and are heavily influenced by network conditions, concurrency, context length, output length, and sampling parameters. They are not equivalent to standardized benchmark conclusions. Treating them as a trend signal rather than a performance commitment is the starting point for a rational analysis.

    2. Splitting “Fast” Apart: Two Metrics That Must Be Measured Separately

    Most experience disputes come from conflating metrics. The perceived feel of a single request is made up of two segments:

    • Time to first token (TTFT): the time from sending the request to receiving the first token, determined mainly by queue wait, prompt length, and prefill computation.
    • Output speed (TPS): the number of tokens generated per second after the first token, determined by decode-stage compute, memory bandwidth, and batching strategy.

    One interesting pattern in the data above is that TTFT fluctuated between 3.6s and 7.5s while output speed ranged from hundreds to over a thousand tokens per second. This shows the two are governed by different bottlenecks—a long prompt pushes TTFT up without necessarily lowering TPS, while high-concurrency batching raises overall throughput but may push up per-request TTFT.

    Conclusions should therefore be written as a triple rather than a single number:

    1. experience profile = (TTFT, TPS, stability/variance)

    An evaluation that reports only TPS has limited reference value.

    3. Where High Throughput Comes From: Common Decode-Layer Techniques

    The acceleration paths broadly accepted in the industry fall into four categories, usually stacked together:

    1. Lighter model architecture: fewer parameters, shallower layers, and more efficient attention implementations directly reduce the cost of a single decode step.
    2. Speculative decoding: a small model or draft mechanism proposes several tokens at once, and the target model verifies them in a batch, substantially improving effective TPS when the acceptance rate is high.
    3. Continuous batching and paged memory management: token-level scheduling across different requests keeps compute saturated and raises cluster-wide throughput, at the cost of possible jitter in per-request latency.
    4. Cache reuse: prefix caching pays off clearly for fixed system prompts and repeated questions over long documents, lowering both TTFT and cost at the same time.

    Illustrative pseudocode expressing the “draft—verify—accept” loop:

    1. draft = draft_model.propose(target, k=4) # propose k candidates at once
    2. accepted = target.verify(draft) # target model verifies in parallel
    3. emit(accepted) # emit all accepted tokens at once
    4. if len(accepted) == 0:
    5. emit(target.sample_one()) # fall back so generation never stalls

    The key point is that the gains from speculative decoding depend heavily on draft quality: the more predictable the task (boilerplate code, structured output), the higher the acceptance rate and the more visible the speedup—which also explains why coding scenarios more easily produce high TPS.

    4. Why High Throughput Changes Product Positioning

    Once output speed reaches the hundreds-of-tokens-per-second range, the interaction paradigm shifts:

    • From “wait-based” to “streaming”: token-by-token rendering makes waiting feel like progress, and perceived-latency optimization is often more valuable than another 20% of raw speed.
    • AI coding tools become a default capability: long-file refactoring, bulk unit-test generation, and cross-file rewrites—uses previously abandoned because the wait was too long—become practical.
    • Agent loop costs are restructured: in multi-turn tool-calling scenarios, decode time often dominates end-to-end latency, so higher throughput directly shortens task completion time.
    • Cost structure changes: a lightweight, high-speed tier is well suited to high-frequency, low-complexity requests, forming a tiered routing setup alongside stronger reasoning tiers.

    5. A Reusable Load-Testing Methodology: Making Numbers Comparable

    When testing on your own, fix the following variables, otherwise the numbers are meaningless:

    • Prompt length (three tiers such as 512 / 2k / 8k tokens) and output length cap;
    • Concurrency (1 / 8 / 32) and whether streaming is enabled;
    • Sampling parameters (temperature, top-p) held constant;
    • Record P50/P95 for TTFT and P50/P5 for TPS separately (use the low percentile to see the worst-case experience).
    1. const t0 = performance.now();
    2. let firstTokenAt = null, tokens = 0;
    3. for await (const chunk of stream) { // read the stream chunk by chunk
    4. if (firstTokenAt === null) firstTokenAt = performance.now();
    5. tokens += countTokens(chunk);
    6. }
    7. console.log({
    8. ttft_ms: firstTokenAt - t0,
    9. tps: tokens / ((performance.now() - firstTokenAt) / 1000)
    10. });

    6. Speed Is Not the Whole Story: A Quality Checklist

    Throughput is a necessary condition, not a sufficient one. For code tasks, use a fixed question set to check: runnability rate, unit-test pass rate, handling of cross-file dependencies, instruction following in long contexts, and stability in the latter half of long outputs (repetition, truncation, format drift). Ranking “speed—quality—cost” in a single table is what makes a conclusion engineering-usable.

    7. Implementation Notes and a Cloud Architecture

    When building this kind of high-throughput application on Baidu AI Cloud, a general capability combination can be used: a container platform to host the inference service and scale it elastically, load balancing and message queues to smooth out traffic peaks and troughs, object storage to accumulate datasets and artifacts, and logging plus monitoring and alerting to observe TTFT, TPS, and error rates—forming an “observable—load-testable—rollback-capable” loop. The model access layer should be abstracted so business code is not tightly coupled to a single model:

    1. client → access gateway (auth/rate limit/routing) → model adapter layer → multiple model tiers
    2. ↓
    3. logging + monitoring & alerting + cost dashboard

    Routing can be tiered by task complexity: simple completions go to the high-speed tier, complex reasoning goes to the stronger-capability tier, and cache reuse is enabled for fixed prefixes.

    8. Conclusion

    The extremely high TPS figures circulating in the community point to three things. First, an evaluation must report TTFT, output speed, and variance together. Second, speculative decoding, continuous batching, and prefix caching are the main sources of throughput gains, with the largest benefit on structured, predictable tasks. Third, speed only carries engineering meaning when assessed together with quality and cost. A unified load-testing methodology, well-built streaming interaction, and tiered routing are what let you consistently get a “fast without losing accuracy” experience in high-frequency call scenarios.