Topic 5
Throughput: everyone vs each user
Latency is one request's experience. Throughput is how much work the system gets through: usually output tokens per second across all requests. AI Engineering (Ch. 9) recommends counting input (prefill) and output (decode) throughput separately, because the two phases are limited by different things, and notes that per-user tokens/s and completed requests per minute are also used.
Throughput is where cost comes from: a machine costs the same per hour whether it serves 100 tokens a second or 1,000.
Predict first
On the GPU, the same move takes total throughput from 179 to 1,349 tokens/s while each user drops from 179 to 84. Both devices show the same trade-off: batching raises throughput and lowers per-user speed. AI Engineering (Ch. 9) cites a LinkedIn report that doubling or tripling throughput is common if you accept worse TTFT and TPOT.
Why does running 16 requests cost so much less than 16 times one request? That is the subject of lesson 2: during decode the processor spends most of its time reading the model's weights, and a batch reads them once for everyone.
Throughput across models
Tokens are not a common currency: different models split the same text into different numbers of tokens (Token counts are not word counts). The book's advice is to compare systems on cost per request, not tokens per second, when the tokenizers differ.
Quick check