KV Broadcasting: Optimizing KV Cache Communication for LLM Inference

    KV cache movement can become a major communication bottleneck in large language model inference, especially with long sequences, high concurrency, and multi-GPU deployment. This article explains why KV cache communication is costly, how KV broadcasting reduces duplicate computation and repeated transfers, and how to design communication paths, coordinate with quantization, manage buffers and failures, and evaluate results with TTFT, TPOT, bandwidth, and memory metrics. It also outlines when KV broadcasting is likely to help and when simpler alternatives may be preferable.

    1. Background: Why KV Cache Becomes a Communication Bottleneck

    During autoregressive generation in large language models, each newly generated token requires reading the Key and Value tensors of all previous tokens. These tensors are collectively called the KV cache. As the sequence grows longer and concurrency increases, the KV cache consumes more GPU memory.

    In multi-GPU inference, model weights and computation are sharded across multiple GPUs, so the KV cache is also distributed across devices. This creates cross-device data movement requirements. The volume of data moved is determined by sequence length, number of layers, number of attention heads, and data precision. This traffic often becomes a limiting factor for time to first token and overall throughput.

    2. Basic Idea of KV Broadcasting

    KV broadcasting means distributing a given piece of KV data from one source to multiple receivers in a single operation, rather than having each receiver recompute it or fetch it separately from a remote source. The benefit comes from two areas: avoiding duplicate computation and reducing repeated transmission of the same data.

    Typical scenarios include the following three cases:

    • Within a tensor parallel group, multiple GPUs handling the same request need the same KV segments.
    • After the prefill phase completes, KV data must be delivered to one or more decode instances.
    • When a common prefix is reused by multiple requests, the KV data for the shared prefix must be synchronized to multiple worker nodes.

    3. Communication Path Design

    In practice, the communication path usually needs to consider the following four aspects.

    1. Source selection: Choose the device that holds the latest and complete KV data as the root node to avoid distributing stale data.
    2. Distribution topology: Within a node, use high-bandwidth interconnects for distribution first; across nodes, transmit over the network. A tree topology is suitable when there are many receivers, while a ring topology is suitable for links with balanced bandwidth. Topology selection should be based on measured bandwidth and latency.
    3. Pipelined transfer: Split KV data by layer or by block so that while one block is being transferred, computation for the next block can proceed concurrently, hiding part of the communication latency.
    4. Synchronization semantics: Before a receiver uses a KV segment in computation, it must confirm that the segment has been fully written; otherwise, it may read incomplete data.

    The following code is an execution-order illustration only. It is not a real interface from any framework.

    1. # Illustrative code: execution order for per-layer broadcast and computation overlap
    2. def broadcast_kv(kv_layers, root_rank, group):
    3. for layer_id, block in enumerate(kv_layers):
    4. if group.rank == root_rank:
    5. handle = group.async_send(block, layer_id)
    6. else:
    7. handle = group.async_recv(layer_id)
    8. # While waiting for the current layer transfer, execute computation for the next layer
    9. overlap_compute(layer_id + 1)
    10. handle.wait()

    4. Coordination with Quantization and Cache Formats

    The byte size of KV data directly determines communication volume. Taking BF16 as the baseline, INT8 and FP8 use only 1 byte per element, so the transfer volume is about half. However, low-precision storage introduces numerical error and requires additional quantization and dequantization overhead.

    In practice, precision loss should be evaluated per layer or per channel. Low-precision transfer should be enabled only for layers where the precision loss is acceptable, and the dequantization location must be explicitly defined at the receiver. Quantization strategy needs to be designed together with the broadcast strategy; otherwise, the savings from reduced transfer may be offset by dequantization overhead.

    5. Implementation Considerations

    • Buffer management: Preallocate receive buffers to avoid dynamically allocating GPU memory for each transfer and to reduce fragmentation.
    • Memory layout: Ensure that the same batch of KV blocks is stored contiguously in memory to reduce packing and unpacking overhead.
    • Lifecycle management: Before the source releases a buffer, it must confirm that all receivers have finished reading it.
    • Failure handling: When a receiver times out or fails, support fallback to local recomputation or retransmission only to that receiver, avoiding failure of the entire batch.

    6. How to Evaluate Results

    Evaluate the following metrics separately rather than looking only at end-to-end total time.

    • Time to first token (TTFT): reflects the time spent on prefill computation and KV distribution.
    • Time per output token (TPOT): reflects whether the decode phase is affected by communication interference.
    • Communication bandwidth utilization and wait time: determine whether the bottleneck is actually in communication.
    • Per-request peak GPU memory: confirm that preallocated buffers do not crowd out space needed for the model and KV cache.

    Controlled experiments should use the same input length, concurrency, and hardware conditions. Each group should be repeated multiple times, and both the mean and variation range should be reported. An optimization can be judged effective only when results are stable across repeated experiments.

    7. Applicability Boundaries and Cautions

    KV broadcasting does not provide benefits in every scenario. When sequences are short and concurrency is low, computation itself is fast, and the additional synchronization and scheduling overhead may offset the time saved by reduced transmission. When the number of receivers is small, point-to-point transfer is usually simpler and has lower maintenance cost. Before introducing KV broadcasting, teams should first use performance profiling to confirm that communication is indeed the bottleneck, then decide whether to modify the communication path.

    8. Conclusion

    The core value of KV broadcasting is to turn “multi-point duplicate movement” into “one distribution, shared by multiple receivers,” while hiding part of the latency through pipelining. Implementation should consider communication topology, data precision, buffer management, and fault recovery together. Time to first token, time per output token, and peak memory should be used as acceptance criteria.