Prefill and Decode Disaggregation
Separating Compute-Intensive Prompt Processing from Memory-Intensive Token Generation
01 Abstract
Autoregressive LLM serving consists of two fundamentally different phases: Prefill, which processes all input prompt tokens in parallel with high compute intensity, and Decode, which generates output tokens sequentially and is frequently bound by memory bandwidth. Mixing both phases on the same scheduling pool creates head-of-line blocking and latency jitter. Apolynux proposes logical prefill/decode disaggregation — achievable even within a single node — paired with block-based KV-cache sharing and prefix caching.
02 Problem Statement
When a long prompt enters prefill on a shared execution pool, it monopolises compute units and memory controllers, causing sharp inter-token latency spikes for concurrent decode streams. Conversely, tuning hardware purely for decode bandwidth leaves prefill throughput suboptimal.
03 Background & Foundations
Recent peer-reviewed systems research (such as Splitwise and DistServe) demonstrated that disaggregating prefill and decode improves adherence to independent TTFT and TPOT service-level objectives. Apolynux adapts this principle to both single-node logical pools (via core/accelerator partitioning) and multi-node clusters.
04 Existing Architectural Limitations
- Co-located prefill bursts induce severe tail spikes in inter-token latency (ITL) for active decode users.
- Static contiguous KV-cache allocation wastes memory and causes fragmentation under varied context lengths.
- Repeated system prompts and RAG context chunks are redundantly recomputed without prefix caching.
05 Proposed Apolynx Architecture
Requests enter a dedicated logical Prefill Engine that materialises block-allocated KV-cache entries and hands ownership cleanly to an isolated Decode Engine.
Prefill Engine Pool
Optimised for parallel prompt ingestion, batched attention kernels, and compute-heavy accelerator or multi-core execution.
Block-Based KV-Cache Manager
Manages paged KV blocks, shared prefix caching for common RAG/system prompts, and context-aware eviction.
Decode Engine Pool
Optimised for low scheduling overhead, high weight residency, and steady memory-bandwidth utilisation per output token.
Zero-Copy KV Handoff
Transfers KV block ownership via pointer handoff on the same node or RDMA write across disaggregation peers.
06 Technical Design
Logical disaggregation does not strictly require separate physical servers: within a single host, InferPlane can bind prefill threads/accelerators separately from decode-isolated cores, transferring KV-cache block descriptors via lockless ownership handoff. Across nodes, KV transfer cost is explicitly weighed against phase-isolation benefits.
| Dimension | Prefill Phase | Decode Phase |
|---|---|---|
| Token Pattern | Parallel across full prompt | Sequential (one token per step) |
| Primary Bottleneck | Compute intensity (FLOPs) | Memory bandwidth (weights + KV) |
| Key Latency Metric | Time to First Token (TTFT) | Time Per Output Token (TPOT) / ITL |
| Primary Optimisations | Batched matmul, accelerator offload, prefix reuse | Weight residency, paged KV, minimal scheduler jitter |
07 Execution Workflow
- 1. Prompt Arrival: Request enters Prefill Engine; KV Manager checks for cached prefix blocks.
- 2. Prompt Processing: Only uncached prompt tokens execute parallel prefill, populating paged KV blocks.
- 3. Ownership Transfer: Completed KV block references transfer atomically (or via RDMA) to the Decode Engine.
- 4. Token Generation: Decode Engine streams tokens steadily without interruption from incoming long prompts.
- 5. Block Reclamation: Completed sequences release unshared KV blocks back to the block allocator.
08 Algorithms, Interfaces & Specification
REQUEST (Prompt)
|
v
+---------------------------+
| PREFILL ENGINE | (Compute-intensive, parallel)
+---------------------------+
|
v (Zero-copy pointer or RDMA KV transfer)
+---------------------------+
| PAGED KV CACHE POOL | (Prefix sharing + block alloc)
+---------------------------+
|
v
+---------------------------+
| DECODE ENGINE | (Memory-BW-bound, low jitter)
+---------------------------+
|
v
TOKEN GENERATION
09 Implementation Considerations
- On single-node systems, logical core/queue partitioning avoids network KV-transfer latency completely.
- Cross-node disaggregation is only beneficial when KV-cache transfer time is small relative to saved interference.
- Prefix caching must enforce strict tenant/user isolation in multi-user enterprise deployments.
10 Performance Evaluation Methodology
Measure TTFT, TPOT, inter-token latency (p50/p95/p99), KV-cache memory footprint, prefill tokens/sec, decode tokens/sec, and combined SLO attainment under mixed short/long prompt workloads.
11 Limitations & Scope Boundaries
- Architecture Design stage: profiling of prefill/decode interference is planned in Phase 2.
- For very small single-user setups with minimal concurrency, unified scheduling may already suffice.
12 Open Research Questions & Challenges
- How dynamically should compute capacity shift between prefill and decode pools as traffic shifts between long-document RAG and short chat?
- What KV-cache compression or quantisation methods best reduce cross-node transfer overhead without hurting domain accuracy?
13 Future Directions
- Elastic pool rebalancing driven by InferPlane Control Plane telemetry.
- Hardware-assisted RDMA KV-cache streaming for multi-node enterprise clusters.
14 Primary Technical References
- Patel et al. (ISCA 2024) — Splitwise: Efficient Generative LLM Inference Using Phase Splitting.
- Zhong et al. (OSDI 2024) — DistServe: Disaggregating Prefill and Decoding for Goodput-Optimized Large Language Model Serving.
- Kwon et al. (SOSP 2023) — PagedAttention — Block-based KV-cache memory management.
Research Status: Architecture Design • Scientific Integrity Disclosure
This research programme explicitly separates established computer science principles, existing open-source technologies, Apolynux architectural proposals, experimental implementations, and independently validated results. Apolynux does not claim to have invented OpenFlow, lock-free algorithms, RDMA, hugepages, or Mixture-of-Experts. Our research contribution is the proposed integration of these disciplines into a unified programmable inference architecture, evaluated strictly through repeatable empirical measurement.