Inference, Serving & Production·Question 15 of 76Intermediate

Why do we obsess over P99 latency rather than the average, and what causes tail latency in LLM serving specifically?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Because users experience the tail, not the mean. A user making 100 requests over a week hits the P99 about once - and for multi-call features it's far worse: an agent chaining 10 sequential LLM calls has a ~10% chance per run that some call hits the P99, so the workflow's tail is dominated by per-call tails compounding. Averages also hide bimodality: P50 flat + P99 exploding is the classic overload signature, invisible in the mean.

Full worked answer

Because users experience the tail, not the mean. A user making 100 requests over a week hits the P99 about once - and for multi-call features it's far worse: an agent chaining 10 sequential LLM calls has a ~10% chance per run that some call hits the P99, so the workflow's tail is dominated by per-call tails compounding. Averages also hide bimodality: P50 flat + P99 exploding is the classic overload signature, invisible in the mean.

LLM-specific tail sources:

  • Queueing spikes: bursty arrivals against near-saturation capacity - queue delay is hyper-sensitive near the throughput knee.
  • Prompt-length variance: a 100K-token prefill takes orders of magnitude longer than a 500-token one; without chunked prefill it also stalls other requests' decode (head-of-line blocking), spreading its latency to innocent bystanders' ITL.
  • Output-length variance: total latency scales with generated tokens; unbounded max_tokens means unbounded latency.
  • Preemption: when KV memory runs out, engines evict sequences and recompute/restore them later - a hidden latency cliff that shows up only under memory pressure.
  • Cold anything: cold prefix cache, freshly scaled replica warming up, first request compiling kernels/CUDA graphs.
  • Provider-side variance when using APIs - you inherit someone else's multi-tenant tail.

Mitigations map one-to-one: admission control and headroom for queueing; chunked prefill and separate long-context pools for prompt variance; max_tokens caps; monitoring preemption counts and KV utilization; warm-up on deploy; hedged requests for API tails (send a duplicate after ~P95, take the first response - spends money to buy tail latency, so budget it).

Measure percentiles per prompt-length bucket and per feature; a global P99 mixes autocomplete with deep research and tells you nothing.

What a good answer covers

  • Because users experience the tail, not the mean
  • A user making 100 requests over a week hits the P99 about once - and for multi-call features it's far worse
  • Averages also hide bimodality
  • Queueing spikes: bursty arrivals against near-saturation capacity - queue delay is hyper-sensitive near…
  • Prompt-length variance: a 100K-token prefill takes orders of magnitude longer than a 500-token one;…

Key terms: Queueing spikes · Prompt-length variance · Output-length variance · Preemption · Cold anything · Provider-side variance

Interviewer follow-ups to expect

  1. Why does an agent workflow's end-to-end tail degrade faster than any single call's?

  2. What are the risks of hedged requests for non-idempotent operations?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep