Why an AI service feels slow: first tokens, queues, speculation and the multi-GPU tax
Diagnose LLM latency by phase: time to first token versus streaming speed, queue accounting with Little's law, the break-even point for speculative decoding, and what tensor parallelism really buys.
Consolidates and expands four notes first published in Issue 001 on November 7, 2026. See the archive record.
“The model is slow” is rarely one problem. A user staring at a blank screen for three seconds and a user watching an answer stutter halfway through are describing different parts of the system, and the fixes barely overlap. Buying more accelerators can leave either complaint untouched.
This guide takes latency apart in the order a request experiences it: waiting to be admitted, processing the prompt, and generating the answer token by token. It then looks at two popular remedies, speculative decoding and tensor parallelism, and works out when each pays for itself. Two small calculators let you test the break-even points with your own measurements.
Start with the symptom
Two numbers, not one
Time to first token (TTFT) is what a client observes between sending a request and receiving the first generated token. It includes transport, queueing and prompt processing. It is not a direct measurement of any GPU kernel. NVIDIA’s GenAI-Perf documentation defines its latency metrics at exactly that request/response boundary [3].
After the first token, a simplified model of the rest is:
completion time ≈ TTFT + (output tokens − 1) × average interval between later tokens
Use the average interval from the same request. Percentiles do not add: inserting a fleet-wide mean into a p95 calculation produces a number nobody observed. Streaming chunks may also bundle several tokens, so record whether the first chunk actually carried a token.
An earlier start is not an earlier finish
Take a hypothetical 200-token answer:
| Scenario | TTFT | Later-token interval | Approximate completion |
|---|---|---|---|
| A | 0.4 s | 0.04 s | 8.36 s |
| B | 1.2 s | 0.02 s | 5.18 s |
A starts 0.8 seconds sooner. B finishes 3.18 seconds sooner. A voice assistant probably wants A; a report generator probably wants B. These are constructed timings, not vendor measurements, but the shape is common: the two phases compete for the same hardware, and tuning for one can cost the other.
Map symptoms to investigations
- Long TTFT, acceptable streaming. Look at admission, queueing and prompt processing. Long prompts from one tenant can delay short prompts from everyone else if the scheduler does not separate them.
- Prompt start, irregular or slow streaming. Look at decode capacity, scheduling contention and memory pressure that forces preemption.
- Both. Suspect a backlog: requests are arriving faster than the system finishes them.
A useful service objective names both phases: a first-token target and a generation target. A throughput number is only actionable when it states which of those targets still holds at that rate.
Why prompt processing and generation behave differently
Prompt processing handles many tokens in one large parallel pass. Generation produces one token per step for each sequence, and each step has to read the model’s weights again. That gives the phases different bottlenecks.
A simple bound shows why. Suppose a single-sequence decode step must read 14 GB of weights from memory that delivers an effective 1 TB/s. Weight transfer alone takes at least 14 milliseconds, which caps that sequence at about 71 steps per second before any computation. Batching helps precisely because several sequences can share one read of the weights. The bound is a floor for one assumed cost, not a throughput prediction.
Splitwise characterized the two phases as having different resource profiles and explored running them on separate machines [2]. DistServe also separates them and gives each its own latency objective [1]. Both report gains for the systems they evaluated; those gains are not multipliers to copy into another cluster’s plan. Splitting the phases introduces a new cost: the request state built during prompt processing has to move to the generation machines. With limited interconnect, interference is replaced by a transfer bottleneck.
Before considering a split layout, collect four distributions from production: prompt length, output length, queue time and the time it would take to transfer state. If the transfer would rival the interference it is meant to remove, the split does not help.
Queues: count three different things
Arrival rate, concurrency and batch size
Dashboards often show three numbers that sound similar:
- Arrival rate: requests entering a boundary per second.
- Concurrency: requests currently inside that boundary.
- Batch size: work scheduled together in one execution step.
A request waiting for its turn counts toward concurrency but contributes nothing to the current batch. ORCA’s iteration-level scheduling is a good reference for why the distinction matters: the set of running requests can change between model iterations rather than only between whole requests [4]. vLLM documents separate metrics for queue time, prefill, decode and end-to-end latency [5]. Record the server version with those metrics, because definitions change.
Little’s law keeps the books honest
Little’s law relates long-run averages inside any consistently defined, stable boundary [6]:
L = λ × W
Average requests present (L) equals admitted arrival rate (λ) times average time each request spends inside (W). It holds for the queue, for the generation stage and for both together, as long as each is measured on its own terms.
Suppose a stable service admits 20 requests per second, each waiting 0.4 seconds and generating for 1.5 seconds:
| Boundary | Mean residence | Admitted rate | Mean resident requests |
|---|---|---|---|
| Queue | 0.4 s | 20/s | 8 |
| Generation | 1.5 s | 20/s | 30 |
| Combined | 1.9 s | 20/s | 38 |
A dashboard showing 30 generating requests is consistent with 38 inside the wider boundary: eight are waiting. Comparing generation-only concurrency with end-to-end latency mixes two boundaries and produces an apparent contradiction that is really a bookkeeping error.
Slower generation needs more seats
The same law explains why a modest slowdown in generation can tip a service into backlog. Hold arrivals at 20 per second and answers at 150 tokens:
| Assumption | Case A | Case B |
|---|---|---|
| Generation time per request | 1 s | 2 s |
| Tokens per second per request | 150 | 75 |
| Required generation concurrency | 20 | 40 |
Halving per-request speed doubles the number of requests that must be resident at once. If memory caps concurrency at 30 (see the cache arithmetic in our serving memory guide), Case B cannot be sustained: the queue grows without limit, clients retry, and retries add arrivals.
Run a load sweep, not a single test
To find real capacity, hold the prompt and output distributions fixed and raise the offered rate in steps. At each step record completed requests, errors, queue growth and latency percentiles. The usable capacity is the highest rate that meets both objectives without the queue growing. If requests are still finishing after the test stops, report the drain time; otherwise the test quietly hides its backlog.
A high utilization figure with a growing queue is not efficiency. It is demand exceeding capacity. An explicit admission limit, with a defined rejection response, is often kinder to users than unlimited waiting, but where to set it is a product decision the engine’s batch setting cannot make on anyone’s behalf.
Speculative decoding: a bill to pay every round
How it works, and what has to hold
Speculative decoding uses a small draft model to propose several tokens, then has the large target model verify them in one pass. Accepted tokens are kept; at the first rejection the target supplies a correction. The original speculative decoding and speculative sampling papers describe acceptance rules designed to preserve the target model’s output distribution [7, 8]. That guarantee belongs to those specific procedures. A system described loosely as “draft and verify” does not inherit it automatically.
The break-even arithmetic
Consider rounds of four draft tokens. Assume drafting costs 1 ms per token, verification costs 14 ms per round, and ordinary decoding with the target costs 10 ms per token. One round therefore costs 4 × 1 + 14 = 18 ms.
If each draft position is accepted with conditional probability a, the expected tokens emitted per round, counting the correction or bonus token, follow the relation in the speculative decoding paper [7, §3.1]:
E = 1 + a + a² + a³ + a⁴
Acceptance a | Expected tokens per round | Time per emitted token | Speed vs. 10 ms baseline |
|---|---|---|---|
| 0.8 | 3.362 | 5.35 ms | 1.87× |
| 0.46 | 1.814 | 9.92 ms | 1.01× |
| 0.2 | 1.250 | 14.40 ms | 0.69× |
The break-even condition is simple:
round cost < baseline time per token × expected tokens per round
With these costs, the technique only helps when acceptance exceeds about 0.455. Below that, the same draft model makes the service slower.
Measure acceptance by request class
A single average acceptance rate hides the mix that matters. A draft model may predict repetitive structured output well and struggle with another language or a specialist vocabulary. Collect accepted-prefix length, round time, verification time and draft time per request class. Short requests deserve separate attention: their fixed setup costs are a larger share of completion time, so they may get slower even when long answers speed up. The operational result to aim for is a measured region where speculation helps at the required quality, plus a rule for turning it off elsewhere.
Tensor parallelism: capacity or speed?
Decide which problem you are solving
Spreading one model across several accelerators answers one of two questions. Either the model needs their combined memory, or it should run faster. The first is a capacity achievement: if the model cannot fit on one device, there is no one-device baseline, and quoting a “speedup” against a run that could never happen is meaningless. The second needs a real baseline.
When budgeting memory per device, remember that some state is partitioned and some is replicated. Dividing total memory by device count understates the requirement when buffers or caches are copied.
The communication term that does not divide
Megatron-LM describes splitting a layer’s matrix operations across devices, with reductions to combine partial results [9]. NCCL’s AllReduce combines values across ranks and delivers the result to each one [10]. These collectives take time that depends on message size, topology and competing traffic. A fast library does not remove that time from the budget.
Normalize one-device time to 1. Assume 90% of the work divides perfectly, 10% does not, and communication adds c(p) for p devices:
time(p) = 0.10 + 0.90 / p + c(p)
With illustrative communication costs of 0.04 at two devices and 0.09 at four:
| Devices | Fixed + divisible | Communication | Total | Speedup |
|---|---|---|---|---|
| 1 | 1.000 | 0 | 1.000 | 1.00× |
| 2 | 0.550 | 0.040 | 0.590 | 1.69× |
| 4 | 0.325 | 0.090 | 0.415 | 2.41× |
Four devices deliver well under four times the speed even with a generous divisible fraction. The communication values are illustrative, not typical, and the model assumes communication does not overlap with computation.
Generation makes this worse. Each decode step contains little work, so a collective that was negligible during a large prompt pass can dominate a small decode step.
Compare against the alternative use of the same hardware
The fair comparison for a four-way sharded replica is often four independent replicas, if the model fits on one device. Independent replicas avoid cross-device communication and can serve more independent requests, at the cost of longer single-request latency. Which wins depends on the actual request mix and objectives.
For facility planning the distinction is concrete. Four accelerators draw roughly the same power whether they run one sharded replica or four separate ones. If sharding yields 2.4 times the single-request speed but four replicas yield close to four times the request throughput, the power cost per completed request differs substantially between the two layouts. Latency-critical products may still choose sharding; they should know what they are paying for.
Power and heat show up as latency
Latency investigations usually stop at software, but accelerators are physical devices with power and thermal limits. When a card reaches its configured power cap or its temperature limit, it lowers clock speeds. The model still runs; it just runs slower, and it runs slower unevenly. A rack whose inlet air is a few degrees warmer, a cooling loop near capacity on a hot afternoon, or an operator who lowered power limits to fit more servers on a circuit can all appear in dashboards as “the model got slow on Tuesday”.
Three habits make this visible:
- Record clocks, power draw and temperature alongside latency during load tests and in production sampling. A latency regression that coincides with lower clocks is a facility question before it is a software question.
- Test at the power limit you will actually run. A benchmark taken with generous power caps in a cool lab does not describe a deployment that caps cards to fit a site’s electrical budget.
- Compare latency by time of day and by rack. Patterns that follow outdoor temperature or a particular row point to cooling or power distribution rather than the scheduler.
The reverse also holds. Lowering a power cap is a legitimate way to fit more accelerators within a fixed site capacity, but the latency cost depends on the phase: on the H100 systems Splitwise measured, prompt (prefill) latency rose substantially under power capping, while token generation showed almost no latency impact when capped from 700 W to 350 W [2]. But it is a trade-off that should be measured against the service objective, not discovered afterwards.
What to log for every request
Most of the analysis in this guide depends on data that serving stacks do not keep by default. A compact per-request record makes it possible:
| Field | Why it matters |
|---|---|
| Arrival, first-token and completion timestamps | TTFT, generation time and queue time by subtraction |
| Prompt and output token counts | Separates long-input from long-output slowness |
| Request class or tenant | Exposes interference and uneven acceptance |
| Outcome: completed, cancelled, errored, timed out | Keeps failures in the denominator |
| Worker or replica identifier | Links latency to placement, cache hits and hardware state |
| Model revision and server version | Makes before-and-after comparisons valid |
Keep prompt text out of the log unless there is a clear reason and permission to store it. The counts and timestamps answer nearly every capacity question without it.
A diagnostic sequence
- Separate TTFT from later-token intervals, per request, and look at both distributions.
- Reconcile queue, generation and end-to-end counts with Little’s law before changing any scheduler setting.
- Run a stepped load sweep and record drain time.
- For speculative decoding, measure acceptance by request class and compare with the break-even value for your own round costs.
- For tensor parallelism, state whether the goal is capacity or speed, and compare with independent replicas on the same power budget.
Sources and limitations
- DistServe, version 3, §§2.3 and 3.3: separate latency objectives, phase interference and state-transfer limits.
- Splitwise, version 2, §§II–IV: phase characterization and the state-transfer term in the evaluated systems.
- GenAI-Perf metric definitions, “Metrics”, checked November 2026: request-boundary latency definitions.
- ORCA, OSDI 2022: iteration-level scheduling and selective batching.
- vLLM metrics design, version 0.20.1: distinct queue, prefill, decode and frontend intervals.
- John D. C. Little, “A Proof for the Queuing Formula: L = λW”, Operations Research 9(3), 1961.
- Fast Inference from Transformers via Speculative Decoding, version 2, §2.3, §3.1 (Equation 1), §3.3 and Appendix A.1.
- Accelerating Large Language Model Decoding with Speculative Sampling, version 1: modified rejection sampling that preserves the target distribution.
- Megatron-LM, version 4, §3: intra-layer model parallelism and its reductions, in a training system.
- NCCL collective operations, “AllReduce”, checked November 2026.
Timings, queue examples, speculative-decoding costs and scaling fractions are original illustrative calculations, not measurements of any product or hardware. This guide consolidates and expands four shorter notes first published on November 7, 2026, whose addresses now redirect here.
Continue exploring
- The real cost of a useful token: utilization, service objectives, retries and the electricity bill
- Where the memory goes when you serve a large language model
- How to read an AI benchmark: sample sizes, paired comparisons, latency tails and hidden workload mixes