LLM serving performance splits into four metrics: TTFT, time to first token, driven by prompt prefill; TPOT/ITL, inter-token latency during decode; end-to-end latency; and throughput, total tokens per second across all users.

Prefill, decode and the four metrics

Latency, throughput & batching (TTFT vs tokens/sec)Diagram with these labels, in reading order: request; compute; transition; decode; calculate; User Request; Prefill Phase; (Compute-bound); TTFT; (Time to First Token); Decode Phase; (Memory-bandwidth-bound); TPOT; (Inter-token Latency); Throughput; (Tokens/sec).requestcomputetransitiondecodecalculateUser RequestPrefill Phase(Compute-bound)TTFT(Time to First Token)Decode Phase(Memory-bandwidth-bound)TPOT(Inter-token Latency)Throughput(Tokens/sec)
Latency and Throughput in LLMs

Inference has two phases. Prefill processes the whole prompt in parallel. It is compute-bound and sets the time to first token. Decode generates one token at a time and is memory-bandwidth-bound, which sets tokens per second.

MetricWhat it measuresSet by
TTFTTime to first tokenPrompt prefill
TPOT/ITLInter-token latency during decodeDecode, memory bandwidth
End-to-end latencyTotal time for one responsePrefill plus output length
ThroughputTotal tokens per second across all usersDecode and batch size

Prompt length matters: a longer prompt inflates TTFT. A long output extends total time. Tuning one number without the others hides these effects.

  • Prefill sets TTFT.
  • Decode sets tokens per second.
  • Bigger batches raise throughput.
  • Long prompts inflate TTFT.
  • Long outputs inflate total time.

Why batch size pulls TTFT and throughput apart

Larger batches improve throughput by amortizing compute across requests. They also lengthen the time each request waits in the queue, which hurts TTFT. A batch that is too small leaves the GPU idle. A batch that is too large leaves users waiting.

Little's Law, from queueing theory, relates the number of items in a system, their arrival rate and the time each spends there, and it is a useful frame for batch sizing in a job queue. The analogy has a limit. LLM throughput also depends on GPU memory bandwidth and the size of the key-value (KV) cache, and the two phases have opposing bottlenecks. Tuning one can worsen the other, so TTFT and throughput need separate strategies.

A single average-latency number is the obvious metric to optimize, and it conceals the tradeoff. Separating TTFT from TPOT lets engineers tune each against its own bottleneck. Teams also gain a shared vocabulary and service level objectives (SLOs) for capacity planning and cost per token.

Tuning for chat compared with bulk processing

For interactive chat, minimize TTFT and keep the 95th percentile latency (p95) low, even at some cost in throughput. This usually means capping batch sizes and prioritizing prefill. For bulk or offline work, maximize throughput, accept larger batches and tolerate longer waits. Mixed workloads can use prefill and decode disaggregation or priority scheduling.

Tuning tradeoffs Optimizing TTFT can reduce throughput, and the reverse also holds. Treat them as separate targets.

Example scenario: 200 ms latency and 300 tokens per second

Example scenario Latency spikes to 200 ms and throughput drops to 300 tokens per second. The figures are illustrative.
Latency, throughput & batching (TTFT vs tokens/sec)Diagram with these labels, in reading order: Latency Measurement; TTFT Analysis; TPOT/ITL Review; Throughput Calculation; Increase Batch Size; Optimize Token Generation; Adjust Server Resources.Latency MeasurementTTFT AnalysisTPOT/ITL ReviewThroughput CalculationIncrease Batch SizeOptimize Token GenerationAdjust Server Resources
Debugging LLM Performance Issues

Inefficient batching is one candidate cause. Requests that are batched poorly raise TTFT, because requests wait longer in the queue before their prefill starts.

  • Check the current batching configuration and batch size.
  • Measure average TTFT at peak hours against off-peak hours.
  • Look at queue length for a backlog of incoming requests.
The call Adjust the batching strategy and compare the result with measured TTFT and throughput. Larger batches raise throughput but can also raise TTFT, so changes need testing against both. Monitor both metrics against agreed thresholds.

Back to the knowledge baseRequest an assessment