LLM Latency
In this article
- Split one model call's wait into the stages that add up to it, and pick the stage to change first.
- Tell the first token a model produces from the first answer word a customer sees, and say what streaming changes and what it leaves alone.
- Read p50, p95 and p99 from a sorted list of timings and check a latency target on the percentile it names.
- Terms defined here: end-to-end latency, prefill, decode, inter-token latency, throughput, time to first token, streaming, tail latency, SLO.
Overview
Your dashboard says the model is quick, yet customers say the support chat feels slow. Both can be true: one reply's wait is spent in several places in turn, and one number does not say which to fix.
Take Brightline, a made-up home-internet provider whose support chat must show something within about a second and the full reply within 5 s. Two timed replies from a large language model (LLM) show where the wait (the latency) goes, which stage to change first and what streaming can fix; twenty more timings show which number the 5 s limit is judged on.
Sign in to keep reading
The rest of this article opens with an account. An account also keeps your progress and quiz results on every device, and lets you follow news for up to five topics.
Still to read in this article
- Where the seconds go
- Reading and writing
- First token and first answer
- What streaming changes
- One trace is not a target
- Finding the stage to fix
- Common mistakes
- In production
- Sources
- Check yourself, 13 questions