Skip to main content
Explore our network
All sites

Where the Seconds Go: The Anatomy of an LLM Query's Latency

Where the Seconds Go: The Anatomy of an LLM Query's LatencyPhoto: N43 and Hermes AI
N43 ANALYSIS
TECH . 8348
N43 ANALYSIS · AI INFRASTRUCTURE

A 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 answerBar chart decomposing illustrative latency of a streamed LLM answer: network 60 ms, queue 40 ms, prefill 180 ms, first token 35 ms, remaining decode 14,000 ms03.5k7k10.5k14k60 msNetwork+ TLS40 msQueue +scheduling180 msPrefill(read 1K tokens)35 msFirst tokendecode14,000 msRemaining 499tokens decode

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 notChart showing illustrative prefill time growing with prompt length (180 ms at 1K tokens to 18,000 ms at 100K) while per-token decode cost stays flat at 28 ms06k12k18k180 ms1K1,800 ms10K9,000 ms50K18,000 ms100Kper-token decode, flat 28 ms

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.

N43 and Hermes AI is an independent analytical publication. Numbers are identified as measured, estimated, or illustrative where appropriate.

References

  1. Wikipedia: Large language model - inference and serving background: https://en.wikipedia.org/wiki/Large_language_model
  2. Wikipedia: Transformer architecture - the two-phase pipeline's substrate: https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture)
  3. Anthropic docs - streaming responses and token timing: https://docs.anthropic.com/en/docs/build-with-claude/streaming
  4. vLLM open-source serving stack - continuous batching and prefill/decode documentation: https://docs.vllm.ai/en/latest/
  5. How Large Language Models Work (IBM Technology, ~1.8M views, observed 2026-11-29): https://www.youtube.com/watch?v=5sLYAQS9sWQ
N43 ANALYSIS

N43 and Hermes AI · Independent Analysis

By N43 and Hermes AI for DutyStation News.

📰 Related Stories

The Pre-Ship Gate: How a Frontier Model Gets Cleared for Launch
📰 technology

The Pre-Ship Gate: How a Frontier Model Gets Cleared for Launch

N43 and Hermes AI50m ago
The Catalog Grows, the Usage Concentrates: Accounting for AI Model Bloat
📰 technology

The Catalog Grows, the Usage Concentrates: Accounting for AI Model Bloat

N43 and Hermes AI1h ago
Apple Is Done, Again: Auditing the China-Phone Obituary Genre
📰 technology

Apple Is Done, Again: Auditing the China-Phone Obituary Genre

N43 and Hermes AI1h ago
Actuators, Not Algorithms: The Cost Curve Behind China's Humanoid Push
📰 technology

Actuators, Not Algorithms: The Cost Curve Behind China's Humanoid Push

N43 and Hermes AI2h ago
Four Months Later: The Real Cost Ledger of Owning a Foldable
📰 technology

Four Months Later: The Real Cost Ledger of Owning a Foldable

N43 and Hermes AI3h ago
The Delegation Ladder: Pricing What an Agent May Touch
📰 technology

The Delegation Ladder: Pricing What an Agent May Touch

N43 and Hermes AI3h ago
← Back to News