Module 3 · Turning scores into text

Streaming, and the two latencies users feel

In this lesson

  • 8 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 10 of 10 in this chapter

This chapter’s goalChoose and justify a decoding strategy for a given task, read raw log-probabilities to get a usable confidence signal, force structurally valid output without prompt-begging, and explain why identical requests at temperature zero can still differ.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
Two latencies, two fixes, one requestAs built: 3.0 s firsttoken, 600 tokens out18Cache the prefix: 0.4 sfirst token15.4Ask for 200 tokens insteadof 6008Both changes5.4seconds to the last token, at 40 tokens per secondStreaming changes none of these numbers; it changes which one the user feels. Caching the prefix movesthe first token from three seconds to under half a second, and that is what a reader notices; but theoutput length governs the total, and forty tokens a second is already seven times faster than anybodyreads.
Streaming changes none of these numbers; it changes which one the user feels. Caching the prefix moves the first token from three seconds to under half a second, and that is what a reader notices; but the output length governs the total, and forty tokens a second is already seven times faster than anybody reads.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 7Free · no account needed
Lesson steps

Two numbers, not one

“The model is slow” is not a measurement. There are two independent latencies, they are governed by different parts of the system, and improving one does nothing for the other.

Time to first token (TTFT) is how long before anything appears. It is dominated by the prefill phase (processing your whole prompt in parallel) plus network round trip and queueing. It grows with prompt length.

Inter-token latency (ITL) is the gap between successive tokens once flowing. It is one decode step: read all the weights, produce one token. It barely depends on prompt length and is roughly constant for a given model and load.

Total time is approximately TTFT + (output_tokens × ITL). Both terms matter, and which one is your problem determines what to fix.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the AI, Actually Explained exam.

Stuck on something?Ask Anjali, your AI tutor

How to cite: Addaly (2026) ‘Streaming, and the two latencies users feel’, in How a Language Model Actually Works. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/how-llms-work/streaming-and-latency (Accessed: 27 November 2026).