Cross-Data-Center KV Cache Transfer with Hybrid Attention: Feasibility and Trade-Offs

    Hybrid attention can reduce KV cache transfer requirements enough to make cross-data-center prefill–decode disaggregation feasible under suitable conditions. This article explains how to estimate KV bandwidth demand, route requests selectively, and apply bandwidth-aware scheduling, along with the model-quality, latency, security, and operational constraints to evaluate before deployment.

    1. Why Prefill–Decode Disaggregation Depends on Fast Networks

    Large language model inference typically has two stages. Prefill processes all input tokens at once and is primarily compute-intensive. Decode generates output tokens one at a time, reading the historical key-value (KV) cache at each step, and is primarily constrained by GPU memory bandwidth.

    Running these stages on separate nodes—known as prefill–decode (PD) disaggregation—allows hardware resources to be configured around each stage’s workload, improving overall utilization.

    The trade-off is that the KV cache must move between nodes. Once prefill finishes, the prefill node must send the cache to the decode node before generation can begin. Slower transfers increase time to first token (TTFT) and can reduce overall throughput.

    For this reason, most deployments keep both stages within the same high-speed RDMA network domain. That constraint also limits heterogeneous hardware combinations and the flexibility to scale resources independently.

    2. Measuring Transfer Demand with KV Throughput

    KV throughput, denoted by Φkv, is the amount of KV cache data produced by prefill per unit of time:

    1. Φkv = KV bytes per token × Prefill processing rate (tokens/second)

    Φkv determines the minimum sustained bandwidth the inter-node link must support. For full-attention layers, KV bytes per token can be estimated as:

    1. KV bytes per token =
    2. 2 × Number of full-attention layers
    3. × Number of KV heads
    4. × Head dimension
    5. × Bytes per element

    Consider a hypothetical configuration, not a specific model:

    • 64 full-attention layers
    • 8 KV heads
    • Head dimension of 128
    • bf16 precision, or 2 bytes per element

    The KV cache per token is:

    1. 2 × 64 × 8 × 128 × 2 = 262,144 bytes = 256 KiB

    A 32K-token input therefore produces approximately 8 GiB of KV cache.

    If a prefill instance processes 30,000 tokens per second, its KV throughput is:

    1. 262,144 × 30,000 × 8 bits/second ≈ 63 Gbps

    That demand can exceed the available bandwidth of typical inter-region Ethernet links, effectively restricting PD disaggregation to a single high-speed network domain.

    3. How Hybrid Attention Reduces KV Cache Size

    Hybrid attention architectures interleave a small number of full-attention layers with many linear-complexity or sliding-window layers. Linear-complexity layers maintain state whose size does not grow with sequence length, while sliding-window layers have a bounded cache. Only the full-attention layers retain KV data that grows linearly with the entire input length.

    Using the same hypothetical configuration, suppose only 16 of the 64 layers retain full attention and the remaining 48 use a linear-complexity architecture. The full-attention KV cache per token becomes:

    1. 2 × 16 × 8 × 128 × 2 = 65,536 bytes = 64 KiB

    This is one-quarter of the original size. For a 32K-token input, the full-attention KV cache is approximately 2 GiB. At the same prefill rate of 30,000 tokens per second, Φkv falls to roughly 16 Gbps, bringing it within the capacity of conventional Ethernet links with sufficient available bandwidth.

    Two qualifications matter:

    1. Linear-layer state still needs to be transferred. Its size is independent of input length, but the actual transfer budget must include the complete model state required by decode.
    2. The proportion of full-attention layers affects model quality. Architectural changes require renewed evaluation on long-context tasks; KV cache size alone is not a sufficient criterion.

    4. Selective Offloading: Not Every Request Benefits from Remote Prefill

    Long-context requests are the main candidates for cross-data-center deployment. Short requests produce smaller KV caches, but the overhead of remote computation and transfer may outweigh the benefit.

    The system therefore needs to make a routing decision for each request. The following simplified example illustrates the approach:

    1. def should_offload(prompt_len: int,
    2. kv_bytes_per_token: int,
    3. link_free_gbps: float,
    4. local_prefill_tps: float,
    5. remote_prefill_tps: float,
    6. local_queue_wait_s: float,
    7. min_len: int = 16384) -> bool:
    8. """Determine whether a long request benefits from remote prefill."""
    9. if prompt_len < min_len:
    10. return False # Keep short requests local; offloading offers too little benefit.
    11. kv_bits = prompt_len * kv_bytes_per_token * 8
    12. transfer_s = kv_bits / (link_free_gbps * 1e9)
    13. remote_total_s = prompt_len / remote_prefill_tps + transfer_s
    14. local_total_s = local_queue_wait_s + prompt_len / local_prefill_tps
    15. return remote_total_s < local_total_s

    This logic considers three factors:

    • Whether the input meets a minimum length threshold.
    • How long the transfer would take given the link’s currently available bandwidth.
    • Whether remote prefill plus transfer is faster than local queuing plus local prefill.

    A production implementation must also account for remote queueing, retries, and cost constraints. The example shows only the core decision logic.

    5. Bandwidth-Aware Scheduling

    Selective offloading depends on continuous observation of network conditions. Common mechanisms include:

    • Bandwidth watermarks: Set high and low utilization thresholds for the cross-data-center link. As utilization approaches the upper threshold, reduce offloading and keep more requests local.
    • Priority allocation: Give latency-sensitive requests priority access to the link and transfer batch workloads during quieter periods.
    • Layer-wise pipelining: Send each layer’s KV data as soon as it is ready, overlapping transfer with computation in subsequent layers to reduce waiting time.
    • Congestion fallback: When packet loss or jitter increases, fall back to a local, homogeneous deployment to preserve service availability.

    The goal is to make transfer overhead predictable and prevent the cross-data-center link from becoming a new single bottleneck.

    6. Reported Results and Applicability Limits

    A public report described results for an internal hybrid model with one trillion parameters. In that setting, selective offloading combined with heterogeneous deployment improved throughput by approximately 54% and reduced P90 TTFT by approximately 64% compared with a homogeneous PD deployment.

    These results apply to a particular model, traffic profile, and network environment. They should not be assumed to hold in other deployments. The report also emphasized that reducing KV cache size at the model level is not enough: selective offloading and bandwidth-aware scheduling are equally necessary.

    Before deployment, evaluate the following constraints:

    • Model quality: Hybrid architectures require dedicated training and long-context evaluation. Do not replace a production model before validating quality.
    • Tail latency: Cross-data-center network jitter can amplify P99 latency. Remote execution paths need timeouts and fallback policies.
    • Data security: KV caches contain semantic information derived from user input. Cross-data-center transfers require encryption and must meet applicable compliance requirements.
    • Operational complexity: Multiple clusters and network links make monitoring and troubleshooting more difficult, requiring unified observability.

    7. Deployment Evaluation Checklist

    1. Profile input lengths. Measure the share of requests that exceed the proposed long-context threshold.
    2. Measure the network. Record available bandwidth, latency, and jitter across the cross-data-center link, including average and peak values.
    3. Calculate transfer demand. Use the target model’s architecture to estimate KV bytes per token and Φkv, then determine whether the link can sustain the load.
    4. Run a limited A/B test. Compare TTFT, throughput, and unit cost using a small share of production traffic.
    5. Prepare a rollback plan. Ensure that requests can quickly return to local execution if the link degrades or fails.

    Cross-data-center PD disaggregation is worth considering only when long-context requests represent a substantial share of traffic, network conditions are stable, and model quality meets requirements. Base the decision on measurements rather than theoretical estimates alone, and weigh each performance benefit against its operational cost.