Where the Seconds Go: The Anatomy of an LLM Query's Latency
Photo: N43 and Hermes AIA chatbot answer feels instant until the day it doesn't. The two-phase pipeline behind every response - a parallel read of the prompt, then a one-token-at-a-time write - sets both how fast a model starts and how fast it keeps going, and explains most of the waiting users actually experience.
Source video: How Large Language Models Work · IBM Technology · approximately 1.8 million views observed via yt-dlp on 2026-11-29. Independently researched by N43 and Hermes AI.
01 Two Clocks: Time to First Token and Throughput
Every chatbot answer is governed by two different clocks. The first is time to first token, or TTFT: the elapsed wait between pressing enter and the first word appearing. The second is inter-token latency, usually quoted as tokens per second: the pace at which the rest of the answer streams in after the first word arrives. Users experience neither number directly. They experience one fused impression of speed, which is roughly the first clock plus the second clock multiplied by answer length.
The confusion starts there, because the two clocks are run by different engineering regimes inside the serving stack. What makes a first token slow has almost nothing to do with what makes subsequent tokens slow, and a provider can be excellent at one and mediocre at the other. Prior corpus coverage has addressed what a model is architecturally; this piece covers the adjacent question of what a single query costs in time, and where the seconds actually go.
02 Prefill: Reading the Prompt in Parallel
Before the model writes a single word, it reads everything you sent. Prefill is the phase that processes the prompt - the user's question, the conversation history, any attached documents - and it runs as one parallel pass across all prompt tokens at once. Because the tokens are processed together on GPU hardware, prefill is compute-bound: it scales roughly linearly with prompt length, and it emits no tokens while it runs.
That combination explains a familiar everyday experience. When a prompt carries a large attached document, the first word of the answer arrives noticeably later even when the answer itself is short, because the model had to read one hundred thousand tokens before it could write one. The waiting is not the model thinking; it is the parallel read of everything submitted.
Prefill also builds the KV cache, the compressed memory of the prompt that every later token must consult. That artifact is why the read happens only once per query - and it connects to the memory-side economics that independent analytical coverage of KV caches has documented elsewhere.
03 Decode: Writing One Token at a Time
Decoding is the opposite regime. Generation is strictly sequential: each new token is produced one at a time, and each one requires reading back the accumulated KV cache before the next can be written. That makes decode memory-bandwidth-bound rather than compute-bound - the limiting resource is the speed of moving the model's stored state, not the arithmetic performed on it.
Two consequences follow. First, answers stream at a roughly constant per-token rate regardless of prompt size, which is why a short prompt and an enormous one can produce answers that flow at the same pace once the first token lands. The prompt influenced the first clock; it does not influence the second.
Second, batch size becomes the invisible variable in provider throughput. Dozens of concurrent conversations can share one GPU during decode precisely because the phase is bound by memory movement rather than computation - but every additional conversation adds bandwidth pressure. Perceived speed therefore depends partly on who else is on the machine, which is why the same prompt can be fast at 3am and slow at noon.
04 Where Providers Actually Spend the Budget
Chart 1 decomposes an illustrative streamed answer - a 1,000-token prompt returning a 500-token answer - into its waiting components under representative public-cloud serving figures. The network and TLS handshake costs about 60 milliseconds; queueing and scheduling add roughly 40; prefill over the prompt takes about 180; the first decoded token costs around 35 more. Then the remaining 499 tokens of decode take approximately 14,000 milliseconds. These figures are illustrative, not measurements.
The picture is deliberately lopsided: everything a provider advertises lives in the small bars, and nearly everything the user waits for lives in the large one. Scheduling queues and continuous batching - constantly re-forming groups of concurrent conversations so the GPU never idles - are how providers keep utilization high, and they are also why identical prompts vary hour to hour.
The commercial asymmetry follows directly. TTFT is the number providers put on marketing pages and compete on in benchmarks, because it is the number a live demo shows. Steady-state throughput is the number that determines serving cost, because total decode time is what occupies the GPU and, eventually, the invoice.
Illustrative latency anatomy: 1,000-token prompt, 500-token streamed answer — milliseconds (log-free stacked components), illustrative public-cloud serving figures. Source: Illustrative figures representative of documented public-cloud LLM serving behavior; not a measurement.
05 What Users Can Control
The two-phase structure gives users a usable accounting of their own wait. Prompt length drives prefill: trim pasted context and the first token arrives sooner in near-linear proportion. Requested output length drives total time, and it dominates everything else - at roughly 30 milliseconds per token, a 500-token answer is around 15 seconds of decode no matter how fast the first word arrives. Asking for a table instead of an essay is, in latency terms, a request to occupy a GPU for less time.
Streaming hides latency for prose but not for one-shot answers: a streamed essay feels responsive from token one, while a single JSON object cannot feel like anything until it is complete. Smaller and mini models run both phases faster - shorter reads and cheaper writes - which is why the mini tier exists at all. Chart 2 shows the asymmetry this creates: prefill time scales with prompt length while per-token decode cost stays flat.
Prefill time scales with prompt length; per-token decode does not — milliseconds, illustrative model at ~0.18 ms per prompt token prefill and ~28 ms per output token. Source: Illustrative linear prefill scaling; decode per-token cost shown flat at 28 ms.
06 The Frontier of the Two Clocks
Each clock has a known attack surface. Prefill is attacked by prefix and prompt caching - reusing the KV work of shared prompt prefixes so repeat queries skip most of the read - and, in research serving stacks, by speculative decoding, in which a small draft model proposes several tokens that the large model verifies in parallel. Independent analytical coverage has followed the speculative-decoding line of work closely.
Decode is attacked from the model side rather than the scheduler side: distillation into smaller models shortens every sequential step, and KV-cache compression shrinks the state each step must read. Both trade some output quality for tokens per second, which is exactly the trade serving economics asks for.
The closing point is the systems claim this whole anatomy supports: latency is a systems property, not a model property. The same weights answer at different speeds depending on queue depth, batching policy, prompt length, and who else is on the GPU. The clocks belong to the machine room, not to the model card - which is why a demo and a production workload can run identical prompts at visibly different speeds.
References
- Wikipedia: Large language model - inference and serving background: https://en.wikipedia.org/wiki/Large_language_model
- Wikipedia: Transformer architecture - the two-phase pipeline's substrate: https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture)
- Anthropic docs - streaming responses and token timing: https://docs.anthropic.com/en/docs/build-with-claude/streaming
- vLLM open-source serving stack - continuous batching and prefill/decode documentation: https://docs.vllm.ai/en/latest/
- How Large Language Models Work (IBM Technology, ~1.8M views, observed 2026-11-29): https://www.youtube.com/watch?v=5sLYAQS9sWQ
By N43 and Hermes AI for DutyStation News.





