PD Asymmetry in LLM Inference: Design Principles and Low-Cost Architecture Practices

    Prefill and decode phases in autocratic Transformer inference are fundamentally different, yet many teams overlook this asymmetry when optimizing inference cost. This article explains why prefill is compute-bound while decode is memory-bound, how to separate prefill and decode resource pools, and which techniques—KV cache management, chunked prefill, continuous batching, speculative decoding, and multimodal decoupling—actually reduce cost. It also introduces an SLA-based evaluation framework and a practical engineering checklist for deploying disaggregated prefill-decode architectures.

    1. The Starting Point: Why Prefill and Decode Are Naturally Asymmetric

    When discussing LLM inference costs, much of the attention goes to whether a “lightweight, high-speed model variant” is cheaper. However, a more fundamental fact is often overlooked: the inference process of an autoregressive Transformer is inherently split into two phases with completely different characteristics—prefill and decode. Understanding the difference between these two phases is the prerequisite for understanding architecture optimization, deployment strategies, and cost evaluation.

    The prefill phase processes the user’s complete prompt. For an input of length L, the model can compute hidden states for all positions in parallel. The matrix multiplications are large and highly parallel, making this phase closer to a compute-intensive workload. Prefill has two core goals: first, to compute and write the key-value cache for every attention layer—commonly known as the KV Cache; second, to produce the first output token from the hidden state of the last position via the output layer. A clarification is needed here: the KV Cache comes primarily from the key and value projections in attention, not from the MLP layers, and the output layer only serves first-token prediction or token-by-token output. Even within prefill, not all computation revolves around the cache—there is a clear “asymmetry of purpose.”

    The decode phase is entirely different. The model generates one token at a time, reading the historical KV Cache and performing a single forward pass before sampling the next token. Because generation is autoregressive, the parallelizable sequence dimension in each step is small, and the performance bottleneck shifts from raw compute to memory bandwidth, cache reads, and scheduling overhead. In long-context scenarios, the capacity and access cost of the KV Cache are further amplified. In short: prefill is compute-heavy, decode is memory-heavy; prefill targets first-token latency, while decode focuses on per-token latency and overall throughput. This asymmetry is not unique to any particular model—it is inherent to conventional autoregressive models.

    Phase Parallelism Primary Bottleneck Key Output Core Metrics
    Prefill High Compute, matrix multiplication efficiency KV Cache, first token First-token latency (TTFT)
    Decode Low Memory bandwidth, cache reads, scheduling Next token Per-token latency, throughput

    2. Conventional Models Are Also PD-Asymmetric—Just Not Explicitly Split

    In early deployments, many engineering teams place prefill and decode in the same inference instance and mix them through batch scheduling. This is simple to implement, but it masks the resource contention caused by PD asymmetry: prefill for long prompts can consume large amounts of compute, blocking requests that are generating tokens; meanwhile, decode requests holding memory and bandwidth long-term can degrade prefill throughput. The result is that first-token latency and per-token latency constrain each other, making capacity planning difficult.

    A more systematic approach is explicit PD disaggregation: maintain a prefill resource pool and a decode resource pool. After prefill completes, the KV Cache is transferred or shared to the decode pool, which then continues generation. The value of disaggregated deployment is that resources can be provisioned separately for compute-intensive and memory-intensive workloads, with independent batching strategies and autoscaling metrics. But it also introduces new engineering challenges: KV Cache transfer bandwidth, cache placement management, request queuing and timeouts, and failure fallback.

    A simplified scheduling pseudocode captures this idea:

    1. def schedule(request):
    2. if request.phase == PREFILL:
    3. kv_cache = prefill_pool.run(request.prompt)
    4. cache_store.put(request.id, kv_cache)
    5. decode_pool.enqueue(request.id)
    6. else:
    7. kv_cache = cache_store.get(request.id)
    8. next_token = decode_pool.step(request.id, kv_cache)
    9. return next_token

    In real systems, chunked prefill and continuous batching should also be combined: split long prompts into multiple chunks and interleave short prefill jobs with decode steps to prevent decode requests from being starved by long prefills, while using continuous batching to improve accelerator utilization. The goal is not to chase a single-point metric, but to bring first-token latency, per-token latency, and throughput under separate SLAs.

    3. General Architecture Techniques for Low-Cost, High-Throughput Variants

    A so-called “lightweight, high-speed model variant” is essentially a coordinated trade-off across three layers—model structure, cache management, and inference scheduling—not simply a smaller parameter count. Common techniques fall into the following categories.

    First, structural sparsity and conditional computation. Mixture-of-experts, sparse attention, and layer-wise asymmetric designs allow different inputs to activate only part of the computation paths, reducing average compute. Layer-wise asymmetry deserves particular attention: shallow layers tend to focus on feature extraction while deeper layers focus on semantic composition, and different layers contribute differently to the cache and outputs. In practice, you can configure layers differently based on task distribution, but this must be grounded in verifiable evaluation—cost savings should never come at the expense of critical capabilities.

    Second, KV Cache management. In long-context inference, cache capacity and read cost are often harder problems than parameter compute. Common methods include cache quantization, paged management, prefix sharing, expiration-based eviction, and tiered storage. Paged management reduces memory fragmentation; prefix sharing suits multi-turn conversations and batches of similar prompts; tiered storage moves inactive caches to cheaper media. Note that cache compression forces a rebalance between accuracy and latency, so regression testing against the task type is mandatory.

    Third, scheduling and batching optimization. Continuous batching dynamically stitches different requests together at the token level; chunked prefill reduces the interference of long prompts on decode; speculative decoding uses a small model or lightweight draft stage to speed up token-by-token generation. These methods all point to the same goal: decouple prefill’s high parallelism from decode’s low parallelism so each resource pool operates near its own optimal point.

    Fourth, multimodal decoupling. In multimodal scenarios, the computational characteristics of the vision encoder, projection layers, and the language model differ even more. Decoupling the encoder from the language model, compressing visual tokens, and adopting dynamic resolution are all effective directions for reducing multimodal inference cost. Evaluation should not only look at language-side throughput but also at image encoding, cross-modal alignment, and end-to-end latency for long-video or high-resolution inputs.

    4. Evaluation and Selection: From “Unit Price” to “SLA-Based Total Cost”

    Whether a low-cost variant fits your business cannot be judged by price per million tokens alone. A more reasonable evaluation framework is the total cost of unit effective throughput under a given SLA. At minimum, you should collect first-token latency, per-token latency, concurrent throughput, long-context degradation, multimodal end-to-end latency, and failure rate. Load tests should cover realistic prompt-length and output-length distributions rather than just peak performance with short prompts.

    1. metrics = bench(
    2. model,
    3. workload=profile(prompt_len_dist, output_len_dist, concurrency),
    4. duration=minutes(30)
    5. )
    6. cost_per_1k = accelerator_hour_cost * duration_hours / total_tokens * 1000
    7. sla_ok = metrics.ttft_p95 < target_ttft and metrics.tpot_p95 < target_tpot

    Here, target_ttft and target_tpot should come from the business SLA, not arbitrary guesses. For interactive applications, first-token latency is usually more sensitive; for offline batch processing, throughput and total cost carry more weight; for long-context knowledge-base Q&A, cache capacity and retrieval quality are equally critical. Only by combining workload profiles, SLAs, and cost models can you determine whether a low-cost, high-throughput variant is truly “worth it.”

    5. Engineering Deployment Checklist

    When deploying a PD-asymmetric architecture, verify the following items one by one: (1) whether the cache transfer path has sufficient bandwidth and failure retry; (2) whether the prefill and decode pools support independent scaling; (3) whether monitoring covers first-token latency, per-token latency, cache hit rate, and queue time; (4) whether chunked prefill is enabled for long prompts; (5) whether there is a degradation strategy for peak periods, such as shortening context, reducing batch size, or switching to a lightweight path; (6) whether canary releases and regression tests cover multimodal and long-context scenarios.

    For deployment and observability, general-purpose cloud platforms—such as Baidu AI Cloud or similar providers—offer container services, object storage, logging, and monitoring/alerting capabilities that can support load testing, deployment, and observability. The specific architecture, however, should still be designed around your business SLA.

    6. Conclusion

    PD asymmetry is not a “new discovery” from some new model—it is a first principle of autoregressive inference: prefill is compute-heavy and produces the cache and first token, while decode is memory-heavy and emits tokens one by one. Conventional models have the same asymmetry; whether you explicitly split the phases, how you schedule them, and how you manage the cache determine whether the theoretical advantage translates into real cost savings. The key to a low-cost, high-throughput variant lies not in a single parameter or trick, but in the coordinated design of model structure, cache management, disaggregated scheduling, and multimodal decoupling. Evaluation should be anchored to total cost under SLA, so you are not misled by surface-level unit pricing.