Prefill/Decode Disaggregation for LLM Serving

Running prefill and decode on separate GPU pools steadies tail latency and lets each phase scale on its own. How disaggregated LLM serving works.

A single long prompt can make everyone else’s answer stutter. You have a server streaming tokens to a dozen users, the cadence is smooth, and then one request shows up with a 20,000-token context. For a moment the stream to everybody else hiccups. The tokens were flowing a few dozen milliseconds apart, and now there is a visible gap before the next one lands.

That gap is not a bug in your code. It is the direct result of running both phases of inference on the same GPUs. This post is for engineers who already serve an open model behind an endpoint, with vLLM or something like it, and who have started to care about the shape of their tail latency rather than just the average. Disaggregation is one of the levers you reach for at that point, and it is worth understanding before you reach for it, because it is not free and it does not help every workload.

Why the two phases fight

An autoregressive model answers in two phases with different hardware profiles. I wrote about the split in detail in prefill vs decode, so here is the short version. Prefill reads the whole prompt in one forward pass and produces the first token. It is compute-bound: the GPU’s math units are the bottleneck, and the cost grows with prompt length. Decode then generates the rest of the answer one token at a time, reusing the KV cache from prefill. It is memory-bound: the limit is how fast you can read the weights and the cache out of HBM, and the cost grows with the length of the answer.

Continuous batching keeps a serving GPU busy by mixing many requests into one running batch and refilling finished slots every step. It is the single biggest throughput win on a serving GPU, and nearly every modern engine does it. But it also means prefill and decode share the same batch on the same hardware. When a long prompt arrives, its prefill pass is heavy, and the engine has to fit that work into the same step where it is also trying to generate the next token for every request already streaming. The decode steps wait behind the prefill.

A decode request's inter-token latency drawn as a row of equal steps. In the colocated case a wide prefill block interrupts the row and leaves a visible gap; in the disaggregated case the steps stay evenly spaced because prefill runs elsewhere.

The two metrics people track make the conflict concrete. Time to first token (TTFT) is essentially the cost of prefill. Time per output token (TPOT), or inter-token latency, is the cost of one decode step. On a colocated server these two numbers are coupled, because the same batch produces both. You cannot tune one without disturbing the other, and a burst of long prompts drags the whole thing around. Databricks put the hardware split plainly in their inference performance guide: the first token is compute-bound, the rest is memory-bound. Two different bottlenecks, one set of GPUs, one set of knobs.

What disaggregation actually does

Disaggregation is the decision to stop sharing. You run prefill on one pool of GPUs and decode on another. A request lands on a prefill worker, which reads the prompt, computes the KV cache, and produces the first token. Then the KV cache for that request is handed to a decode worker over the network, and the decode pool streams the rest of the answer.

Two layouts side by side. On the left, one GPU pool runs prefill and decode together and a long prefill stalls the shared batch. On the right, a prefill pool and a decode pool are separate, with the KV cache moving between them over the fabric; a summary lists steadier tail latency and independent scaling against the cost of network transfer and extra moving parts.

The idea was laid out cleanly in DistServe (Zhong et al., OSDI 2024). Their argument is that colocating the phases forces one set of resource and parallelism choices onto two jobs that want different things, and the interference costs you on both latency metrics. Split them and each phase gets its own placement. On their own benchmarks the authors report serving up to 7.4 times more requests, or holding a 12.6 times tighter latency target, against the colocated systems they compared with. Those are their numbers on their setups, so read them as a direction rather than a promise, but the direction is real and it is why every large serving stack now has a disaggregated mode.

The benefit that survives contact with a real deployment is control. Once the phases are on separate pools, a long prefill cannot land in the middle of someone’s decode batch, so tail inter-token latency gets steadier. You can also size and tune the pools independently. The prefill pool is doing big matrix math, so it wants parallelism that favors compute and can run with fewer, larger workers. The decode pool is memory-bound and lives or dies by batch size, so it wants many workers batching aggressively for throughput. On one shared pool you pick a single configuration and compromise. Split, you optimize each for what it is actually doing.

The catch: moving the KV cache is not free

This is the part that is easy to miss. Disaggregation is not, by itself, a throughput optimization. The vLLM docs say this directly: disaggregated prefill does not inherently improve throughput. Its value is separating TTFT and inter-token latency so you can control each and keep the tail in check. If your goal is raw tokens per second per GPU and you do not care about the tail, disaggregation can make things worse, because now every request’s KV cache has to cross the network between pools.

That transfer is the dominant new cost. The KV cache for a long prompt is large, and it has to move from a prefill worker to a decode worker before generation can continue, which adds to TTFT and consumes interconnect bandwidth you were not spending before. This is why DistServe places the two pools according to the cluster’s bandwidth: keeping the transfer on fast links, NVLink inside a node or InfiniBand and RDMA across nodes, is what keeps the overhead tolerable. On slow links the handoff can cost more than the interference you were trying to remove. The overhead is also proportionally worst on short prompts, where there was barely any prefill interference to fix in the first place. You are paying a fixed-ish transfer cost to solve a problem that short prompts did not really have.

So the mental model is a trade, not a free win: you spend network bandwidth and some extra TTFT to buy steadier tail latency and independent scaling. That trade is good when prompts are long and varied, when the tail matters to you, and when your GPUs are connected by a fast fabric. It is a bad trade when prompts are short and uniform, when you only care about average throughput, or when your interconnect is slow.

What it looks like in vLLM

vLLM ships this as an experimental feature, and the exact flags move between releases, so treat the following as the shape of it and check the disaggregated prefilling docs for your version before copying anything. You run two instances, one for each role, and point them at a connector that handles the KV transfer:

# Prefill instance: does the prompt pass, produces + exports the KV cache
vllm serve <model> \
  --port 8100 \
  --kv-transfer-config \
  '{"kv_connector":"NixlConnector","kv_role":"kv_producer"}'

# Decode instance: imports the KV cache, streams the answer
vllm serve <model> \
  --port 8200 \
  --kv-transfer-config \
  '{"kv_connector":"NixlConnector","kv_role":"kv_consumer"}'

The connector is the interesting piece. NixlConnector, built on NVIDIA’s NIXL transfer library, is the main path for moving KV data between the instances; the docs also list others such as MooncakeConnector and LMCacheConnectorV1. In front of the two instances you need a proxy or router that sends each request to a prefill worker first and then to a decode worker, carrying along the identifiers the decode side needs to pick up the right cache. vLLM’s repo has runnable setups under its examples/disaggregated/ directory.

If you are operating at the scale where you would run this in production, the orchestration is usually not hand-rolled. NVIDIA Dynamo has a disaggregated serving engine that sits on top of vLLM, TensorRT-LLM, or SGLang and manages the prefill and decode pools for you, and the Kubernetes-native llm-d project wires the same pattern into a gateway and autoscaler. The research idea from 2024 has become a standard building block in the serving stacks shipping in 2026.

When I would reach for it

Disaggregation is near the end of the list, not the start. If you are serving an open model and your tail latency is rough, the cheaper moves come first. Turn on continuous batching if it is somehow off. Turn on prefix caching so shared prompt prefixes skip prefill entirely, which cuts the prefill load that causes the interference in the first place. Look at chunked prefill, where the engine slices a long prefill into smaller pieces so it can be interleaved with decode steps on the same GPU instead of blocking them. Chunked prefill attacks the same interference problem without any network transfer, and for a lot of workloads it is enough.

I would reach for full disaggregation when a few things are all true at once. Prompts are long and their lengths vary a lot, so prefill genuinely crowds out decode. The tail of inter-token latency matters to the product, not just the average. There is enough traffic to keep two separate pools busy, because a disaggregated setup with idle decode workers is just wasted GPUs. And the hardware has a fast enough interconnect that moving the KV cache does not eat the gain. Miss any of those and a simpler lever will serve you better.

This is the kind of decision I spend my time on now, building dedicated inference for open models, and it was the same shape of problem behind Archi, the retrieval copilot I worked on for CMS operations at CERN. Archi’s prompts were all over the place: a quick one-line question next to a request that pulled in several retrieved documents and ran to many thousands of tokens. That spread is exactly the profile where the phases fight, and exactly where splitting them earns its cost. The honest first question is always whether cheaper levers close the gap. When they do not and the prompt distribution is wide, disaggregation is the tool built for it.


Image credit: diagrams by Muhammad Hassan Ahmed, released under CC0. No third-party images were used.