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
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.
| Metric | What it measures | Set by |
|---|---|---|
| TTFT | Time to first token | Prompt prefill |
| TPOT/ITL | Inter-token latency during decode | Decode, memory bandwidth |
| End-to-end latency | Total time for one response | Prefill plus output length |
| Throughput | Total tokens per second across all users | Decode 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.
Example scenario: 200 ms latency and 300 tokens per second
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.