LLM Inference Speed: TTFT and TPS Metrics and a Model Selection Guide

    As large language models move from demos into large-scale production, inference compute often lags behind demand. This guide breaks down the two metrics that matter most for inference performance—time to first token (TTFT) and generation throughput (TPS)—explains how to measure them reproducibly, and shows how to right-size model choice by task complexity. It also covers the "overthinking" tradeoff in reasoning modes, engineering optimizations such as streaming and semantic caching, and a step-by-step selection workflow.

    Introduction: Why Inference Slows Down Under Compute Constraints

    As large language models move from technical demos into large-scale production, the gap between inference compute supply and demand growth is becoming increasingly visible. When inference resources tighten, some services may throttle requests or adjust concurrency quotas (see official announcements for specifics). This is a reminder that we should not blindly chase the “most powerful model.” Instead, we need to understand the essence of inference performance: separate the two core metrics—time to first token (TTFT) and generation throughput (TPS)—and spend every unit of compute where it counts.

    A common real-world impression among developers is that the strongest, largest models are often the slowest (on the same hardware and at the same precision), while most everyday tasks can be handled perfectly well by a mid-size model. This is not merely a question of cost, but an engineering tradeoff of “fast enough and good enough.” To make a rational decision, you first need to break inference performance into metrics that are quantifiable and reproducible.

    The Two Core Metrics: TTFT and TPS

    Large-model inference usually splits into two phases: Prefill (processing the input) and Decode (generating output token by token). These map to two key user-facing metrics.

    Time To First Token (TTFT)

    TTFT is the time from sending a request to receiving the first token, and it determines whether users “feel” the system is fast. The main factors that affect TTFT include:

    • Queueing delay: scheduling latency when server-side concurrency is saturated;
    • Prefill compute: the longer the input, the heavier the computation before the first token;
    • Model size: larger parameter counts mean longer per-forward-pass time. Note that MoE models only activate a subset of parameters, so you cannot judge speed by total parameter count alone; in addition, quantization precision (e.g., INT8/FP16) and the attention implementation (e.g., FlashAttention) can significantly affect per-forward-pass time. You therefore cannot infer speed from total parameter count alone.

    For interactive scenarios (chat, code completion), TTFT carries extremely high weight—users can tolerate output arriving gradually afterward, but they struggle to put up with being “stuck” for a long time.

    Tokens Per Second (TPS)

    TPS is the number of tokens produced per second during the generation phase, and it determines how smoothly the output “reads.” It is mainly constrained by decode efficiency and memory bandwidth.

    It is important here to distinguish two concepts:

    • Single-request TPS: the number of tokens produced per second in one output stream, reflecting whether a single user experiences smooth reading;
    • Aggregate system throughput: the total tokens produced per second across all concurrent requests, reflecting the overall capacity of the cluster.

    Both change with concurrency and batch size: at low concurrency, the decode phase is often memory-bandwidth-bound and single-request TPS stays relatively stable; at high concurrency or with large batches, computation shifts to being compute-bound, and scheduling and batching change the TPS distribution across requests. When comparing different models or engines, you must therefore state the concurrency level, input/output lengths, and the P95/P99 basis, otherwise the numbers are not comparable.

    The Difference and the Tradeoff: Match the Metric to the Scenario

    Quick takeaway: short output → look at TTFT; long output → look at TPS; and under high concurrency the two often trade off against each other.

    Scenario More Critical Metric Reason What to Watch When Measuring
    Short Q&A, intent classification TTFT Output is short, so first-token speed defines the experience Concurrency, input length
    Multi-turn dialogue TTFT first Every turn needs an instant response Input length, conversation history
    Code completion TTFT Immediate feedback is the goal Input length, concurrency
    Long-form generation TPS Output is long, so throughput determines total time Output length, concurrency
    RAG with long context TTFT + TPS Long input raises first-token latency; long output relies on throughput Input length, output length
    Batch offline processing Aggregate throughput Not real-time; capacity is the goal Concurrency, batch size

    What users often complain about as “slow response” is usually the combined result of high TTFT plus low TPS: the first token takes forever to arrive, and once it does, only a few tokens trickle out each second.

    How to Measure TTFT and TPS

    For metrics to be reproducible, measurement conditions must be fixed. Recommended approach:

    • Tools: vLLM’s benchmark_serving, SGLang’s bench_serving, or a general-purpose load-testing tool such as locust;
    • Fixed conditions: specify concurrency levels (e.g., 1/8/32), input length, and output length, and keep them consistent throughout;
    • Reporting basis: report P50/P95/P99, not just averages; compute TPS as “total generation-phase time ÷ number of output tokens”;
    • Record template: model version, precision, concurrency, input/output lengths, TTFT (P50/P95/P99), TPS, and cost per call.

    Only with fixed conditions can you tell whether a change in “faster/slower” comes from the model, the engine, or the load.

    Reasoning Modes and the “Overthinking” Tradeoff

    Many reasoning-oriented models today offer different “thinking intensity” levels (a common approach is to split high-thinking and low-thinking modes). The principle is to let the model generate more or fewer intermediate reasoning tokens before giving the final answer.

    High-thinking mode significantly increases the number of reasoning tokens, which directly amplifies total time:

    1. Total wait time ≈ TTFT + (number of output tokens × per-token generation time)
    2. High thinking on → reasoning token count rises sharply → total wait time grows

    So a common phenomenon is this: even if switching to low-thinking mode relieves “overthinking,” the underlying slow decode speed (low TPS) and slow first token (high TTFT) remain hard to change. These are mainly influenced by model architecture and inference-engine implementation; lowering the thinking level generally cannot directly improve the underlying TTFT/TPS. You need to combine techniques such as quantization, prefix/KV-cache reuse, continuous batching, and speculative decoding, and verify with real measurements.

    The sound engineering approach is to choose the thinking level based on task complexity, rather than always using the highest level:

    1. def choose_mode(task):
    2. if is_simple_task(task): # formatting, extraction, simple rewriting
    3. return "low_thinking"
    4. elif is_multi_step(task): # multi-step reasoning, complex analysis
    5. return "high_thinking"
    6. return "medium_thinking"

    Right-Sizing Model Selection by Task Characteristics

    The rational selection logic is “good enough is enough,” not “bigger is always better.” You can tier models by task:

    • Simple tasks (information extraction, format conversion, text rewriting): use lightweight, fast models with low TTFT and low cost;
    • Medium tasks (code completion, summarization, routine Q&A): use mid-size models that balance speed and quality;
    • Complex tasks (architecture design, multi-step reasoning, tricky debugging): only then bring in strong reasoning models, accepting their slower speed.

    With this kind of tiered dispatch, you reserve the precious compute of strong models for the scenarios that genuinely need them—controlling cost while avoiding the speed penalty of “using a sledgehammer to crack a nut.”

    When selecting, use this decision checklist to self-check:

    1. Does quality meet the bar on your task-set evaluation?
    2. What is the TTFT/TPS SLO (target value)?
    3. Is the cost per call within budget?
    4. Can it use caching?
    5. Is the fallback path ready?

    A five-level decision flow (try from fast to slow, and stop once it passes):

    1. Task request
    2. ├─ Cache hit? ── Yes ─> Return cached result
    3. └─ No
    4. ├─ Lightweight model passes eval? ── Yes ─> Use lightweight tier
    5. ├─ Mid-size model passes eval? ── Yes ─> Use mid tier
    6. ├─ Strong model + low thinking passes? ── Yes ─> Strong model, low thinking
    7. └─ None pass ─> Strong model + high thinking

    Engineering-Level Performance Optimizations

    Beyond model selection, you can systematically reduce perceived latency and improve throughput from the engineering side:

    1. Streaming output: enable streaming responses so users see the first token as soon as possible, minimizing the negative perception of TTFT;
    2. Semantic caching: reuse historical results for identical or highly similar prompts, skipping redundant computation outright. Watch the risks: cache keys must include user/tenant and permission dimensions; set similarity thresholds and TTL; prevent similar prompts from hitting the wrong answer or causing cross-user unauthorized access; do not enable it for time-sensitive tasks;
    3. Input compression: trim context and control prompt length to lighten the Prefill-phase burden, thereby lowering TTFT;
    4. Concurrency and batch scheduling: properly configure concurrency limits and batch size to balance throughput and latency;
    5. Timeout and fallback: set reasonable timeout thresholds per task, and automatically fall back to a faster model or level on timeout.

    A typical streaming-call example (client.generate is an illustrative interface):

    1. import time
    2. def stream_chat(client, prompt):
    3. # Prioritize perceived latency: enable streaming to fetch and display the first token as early as possible
    4. t0 = time.perf_counter()
    5. first_token_time = None
    6. output_tokens = 0
    7. for chunk in client.generate(prompt, stream=True):
    8. if first_token_time is None:
    9. first_token_time = time.perf_counter() - t0 # TTFT
    10. output_tokens += 1
    11. yield chunk
    12. # After the loop ends, compute the generation-phase TPS
    13. total_time = time.perf_counter() - t0
    14. gen_time = total_time - first_token_time
    15. tps = output_tokens / gen_time if gen_time > 0 else 0
    16. print(f"TTFT={first_token_time:.3f}s, TPS={tps:.1f} tok/s")

    These techniques can be implemented using general-purpose cloud capabilities (such as caching services, message queues for peak shaving, and monitoring/alerting to collect TTFT/TPS metrics), forming an “observable → optimizable” closed loop.

    FAQ

    Q: How do I choose a model?
    First use a task-set evaluation to confirm quality meets the bar, then load-test TTFT/TPS under fixed conditions, and make a holistic decision based on SLO, cost per call, and cacheability, using the five-level flow to “stop once it passes.”

    Q: Why is it still slow after switching to low thinking?
    Low-thinking mode only reduces the number of reasoning tokens; it does not change the underlying TTFT/TPS. If the first token is slow or decoding is slow, you need to work at the engine level with quantization, KV-cache reuse, continuous batching, speculative decoding, and similar techniques—not just adjust the mode.

    Q: Why does the first token get slower after increasing concurrency?
    Under high concurrency, queueing increases and Prefill resources get contended for, so TTFT rises. You need to balance latency against throughput through concurrency limits, batch scheduling, and horizontal scaling.

    Conclusion

    Inference performance is not a single-dimension problem; it is a balance among three factors: quality, cost, and speed. As compute enters an era of tight balance, rather than blindly chasing the model with the largest parameter count, it is better to first quantify TTFT and TPS, understand the extra overhead that thinking modes introduce, and then do tiered model selection and engineering optimization by task characteristics. Using the “good enough and fast enough” model in the right place is a viable path to coping with compute constraints while safeguarding user experience.