Disaggregated Prefill-Decode Serving Interview Preparation Guide

🧠

Ready to test yourself?

Each test is 5 questions with varying difficulty.

Master AI/ML with AI Prep app

AI Prep covers AI Agents, Generative AI, ML Fundamentals, NLP & LLMs and a lot more, with adaptive tests and daily challenges. Fully offline on Android. Free to try, one-time unlock for lifetime access.

Download AI Prep, Free to Try

Introduction

Disaggregated prefill-decode serving is a critical architectural pattern in modern LLM inference, designed to solve the fundamental performance mismatch between the compute-bound prefill phase and the memory-bandwidth-bound decode phase. In 2026, as models grow larger and context windows expand, monolithic serving engines often struggle with head-of-line blocking, where long prefill tasks stall token generation for other requests. This topic is essential for AI Engineers and System Architects building high-scale inference platforms. Interviewers ask about this to evaluate your understanding of GPU utilization, scheduling complexity, and the trade-offs between Time to First Token (TTFT) and total system throughput. Junior candidates are expected to understand the basic bottleneck distinction, while senior candidates must demonstrate mastery of cross-node scheduling, KV cache migration, and the impact of disaggregation on system reliability and complexity.

Why It Matters

The core problem in LLM serving is that the prefill phase (processing the input prompt) is compute-intensive, while the decode phase (generating tokens) is memory-bandwidth-bound. In a standard monolithic setup, a long prompt can saturate the GPU's compute units, delaying the decode phase of other active requests, which significantly increases latency. Disaggregation decouples these phases, allowing operators to assign different GPU pools to each task. This increases resource utilization by matching the hardware profile (e.g., high-compute GPUs for prefill, high-bandwidth GPUs for decode) to the specific phase requirements. For companies serving millions of tokens daily, this can improve throughput by 2x-3x and significantly reduce tail latency. This is a high-signal interview topic because it tests whether a candidate understands the hardware-software interface. A strong answer shows an awareness of the overhead introduced by cross-node communication and the complexity of state synchronization (KV cache transfer) between pools, which are the primary failure modes in real-world production systems.

Core Concepts

Architecture Overview

The architecture splits the inference engine into two distinct pools. The Prefill Pool processes incoming requests, computes the KV cache, and then offloads the state to the Decode Pool. The Decode Pool maintains the KV cache in its local memory and performs iterative token generation. Communication between pools is handled via a high-speed interconnect, often using specialized protocols to minimize latency during the handoff.

Data Flow
  1. Input Request
  2. Dispatcher
  3. Prefill Pool (Compute KV)
  4. Interconnect
  5. Decode Pool (Iterative Generation)
  6. Output Token
 [Incoming Request] 
        ↓ 
 [Request Dispatcher] 
  ↙               ↘ 
[Prefill Pool]   [Decode Pool] 
  (Compute)        (Generate) 
        ↓           ↑ 
  [KV Cache Transfer] 
        ↓           ↑ 
 [Interconnect Layer]
Key Components
Tools & Frameworks

Design Patterns

KV Cache Handover State Management

Asynchronous transfer of KV cache tensors from prefill to decode nodes using RDMA.

Trade-offs: Reduces latency but introduces significant network complexity.

Pool-Aware Scheduling Scheduling

Dynamically adjusting the ratio of prefill-to-decode nodes based on incoming request distribution.

Trade-offs: Optimizes utilization but requires sophisticated monitoring.

Batch-Size Decoupling Resource Allocation

Running different batch sizes in prefill and decode pools to match throughput capacity.

Trade-offs: Maximizes throughput but increases memory pressure.

Common Mistakes

Production Considerations

Reliability Requires robust state synchronization; use checkpointing for KV cache transfers to handle node failures.
Scalability Scale pools independently based on prefill-to-decode ratio; use service discovery for dynamic pool membership.
Performance Bottlenecks are often network bandwidth or interconnect latency; monitor TTFT and tokens-per-second (TPS).
Cost Reduces cost by allowing cheaper, compute-optimized GPUs for prefill and memory-optimized GPUs for decode.
Security Secure inter-node communication with mTLS; ensure KV cache data is encrypted in transit.
Monitoring Track queue depths, transfer latency, and GPU utilization per pool.
Key Trade-offs
Latency vs. Throughput
Complexity vs. Efficiency
Network Overhead vs. Compute Gain
Scaling Strategies
Dynamic pool resizing
Request-length-based routing
KV cache offloading
Optimisation Tips
Use RDMA for tensor transfers
Implement KV cache compression
Batch prefill requests aggressively

FAQ

How does disaggregated serving differ from monolithic serving?

Monolithic serving executes both prefill and decode on the same GPU, leading to resource contention. Disaggregated serving separates these into distinct pools, allowing for specialized hardware allocation and independent scaling of compute and memory-bandwidth resources, which significantly improves throughput and reduces tail latency.

Why is the prefill phase compute-bound?

The prefill phase involves processing the entire input sequence using matrix multiplications, which are compute-intensive. The GPU must perform massive parallel operations to compute the attention scores for all tokens in the prompt, saturating the compute units rather than the memory bandwidth.

What makes the decode phase memory-bandwidth-bound?

During decoding, the system generates tokens one by one. Each step requires loading the model weights and the KV cache from memory to the GPU compute cores. Because the compute required for a single token is relatively small compared to the amount of data loaded, the system is limited by how fast it can move data from HBM to the cores.

What is the biggest challenge in disaggregated prefill-decode?

The primary challenge is the overhead of transferring the KV cache between the prefill and decode pools. If the interconnect is slow or the transfer logic is inefficient, the latency added by the migration can negate the performance gains achieved by decoupling the phases.

Can I use standard load balancers for disaggregated serving?

Standard load balancers are insufficient because they lack awareness of the request's state (prefill vs. decode). You need a specialized dispatcher that understands the current load on both pools and the specific requirements of the request, such as prompt length and expected generation length.

How does disaggregation affect TTFT?

Disaggregation improves TTFT by ensuring that incoming prefill requests are not blocked by long-running decode tasks. By offloading prefill to a dedicated pool, the system can guarantee that prompt processing starts immediately, leading to lower and more consistent Time to First Token.

Is disaggregation always better than monolithic serving?

No. Disaggregation introduces significant architectural complexity and network overhead. For small-scale deployments or models with very short context windows, the overhead of managing multiple pools and transferring state may outweigh the performance benefits. It is best suited for large-scale production environments.

What role does NCCL play in this architecture?

NCCL (NVIDIA Collective Communications Library) is the standard for high-performance communication between GPUs. In disaggregated serving, it is used to efficiently transfer the large KV cache tensors between the prefill and decode nodes, minimizing the time spent in the handoff phase.

How do you handle node failure in a disaggregated system?

Fault tolerance requires stateful recovery mechanisms. If a node in the decode pool fails, the dispatcher must be able to redirect the request to another node, potentially re-fetching or re-computing the KV cache. This often involves checkpointing the state or maintaining redundant copies of the cache.

What is the impact of context window size on disaggregation?

As context windows grow, the size of the KV cache increases linearly. This makes the transfer of the cache between pools more expensive, increasing the importance of efficient interconnects and potentially requiring techniques like KV cache compression or smarter caching strategies to keep latency low.

Related Roles

Master AI/ML with AI Prep app

AI Prep covers AI Agents, Generative AI, ML Fundamentals, NLP & LLMs and a lot more, with adaptive tests and daily challenges. Fully offline on Android. Free to try, one-time unlock for lifetime access.

Download AI Prep, Free to Try
← Back to Interview Prep