KV Broadcast: Optimizing KV Cache Communication for Long-Context LLM Inference
This article examines why KV Cache communication becomes a bottleneck in long-context and multimodal LLM inference, and introduces KV Broadcast as a targeted cache distribution mechanism. It explains the basic design principles, including on-demand distribution, duplicate-send reduction, topology-aware routing, and chunked pipelined transfer. It also discusses how KV Broadcast works with tensor parallelism, cache quantization, layer partitioning, and EPD disaggregated architectures, then presents a simplified implementation model and key engineering concerns such as lifecycle management, backpressure, communication-computation overlap, failure recovery, and monitoring. Finally, it outlines suitable scenarios and limitations.
1. Technical Background: Why KV Cache Communication Becomes a Bottleneck
During autoregressive inference in large models, the input prompt first goes through the prefill stage. The model computes Key and Value tensors for each attention layer and stores them as the KV Cache. In the token-by-token decoding stage, every newly generated token must read historical cache entries to complete attention computation.
When the context is short and concurrency is low, KV Cache is mainly constrained by device memory capacity. In long-context and multimodal scenarios, however, the problem evolves into a combined bottleneck across device memory, host memory, and inter-node interconnect bandwidth. This is mainly reflected in the following aspects:
Cache size grows with context length.
The longer the context, the more Key and Value data must be stored. For multi-layer, multi-head attention structures, cache size can reach several GB or more. When a request is distributed across multiple compute devices, synchronizing the cache by simple replication can quickly consume device memory and interconnect bandwidth.Decoding involves high-frequency, small-step, continuous access.
The prefill stage can usually achieve high compute efficiency through batched matrix operations. The decoding stage generates only a small number of tokens per round, but repeatedly reads historical cache entries. As a result, communication latency and memory access efficiency directly affect per-token generation speed.Parallel computing creates cache distribution problems.
In intra-node tensor parallelism, pipeline computing, or multi-device collaborative inference, different devices may hold only part of the layers, heads, or sequences. If full exchange is performed every round, communication cost may gradually exceed computation cost.Multimodal input increases preprocessing and cache migration pressure.
Inputs such as images, audio, or video usually need to be encoded before entering the prefill stage together with the text prompt. If encoding, prefill, and decoding share the same set of resources, burst requests may cause cache movement and compute tasks to contend with each other.
The core goal of KV Broadcast is to optimize the transmission, replication, routing, and reuse of KV Cache without changing the model’s computational semantics.
2. Basic Idea of KV Broadcast
KV Broadcast can be understood as a targeted broadcast mechanism for KV Cache. It does not simply copy the cache to all devices. Instead, based on the compute topology, request state, and cache ownership relationships, it sends the necessary data to the target compute group in one pass and avoids repeated transmission as much as possible.
Its basic flow can be abstracted as follows:
Request enters│├─Determine context and parallel compute group│├─Prefill stage generates KV Cache│├─Identify decode instances that need to access the cache│├─Perform one or a small number of broadcasts according to device topology│└─Decode stage reads local or near-local cache directly
Compared with traditional point-to-point transmission, KV Broadcast usually includes the following design ideas:
Centralized generation, on-demand distribution.
After KV Cache is generated in the prefill stage, it is organized by the cache-holding node or cache service module and then distributed to the devices that actually participate in decoding.Reduce duplicate sends.
If multiple decode instances need to read the same context, they do not need to pull it separately from the source device. A shared broadcast path can complete one distribution.Select paths based on topology.
Communication between devices within a node is usually cheaper than cross-node communication. The scheduler should prioritize intra-node high-speed interconnect and then send necessary data to other nodes, avoiding unplanned full-network replication.Support chunked and pipelined transfer.
A long-context KV Cache does not necessarily need to be transmitted as a whole. It can be split by layer, sequence block, or time slice, so that subsequent data is transferred while computation proceeds, reducing first-token latency and peak memory usage.
3. Synergy with Other Inference Optimization Techniques
KV Broadcast is not an isolated communication component. It usually needs to work with compute parallelism, cache compression, and scheduling architectures to form a complete inference optimization solution.
3.1 Working with Tensor Parallelism
Tensor parallelism splits the weights or computation tasks of a layer across multiple devices. If each device only needs part of the attention heads, the KV Cache can also be partitioned by attention head or sequence dimension to avoid unnecessary cache replication.
A common strategy is:
- First determine the logical ownership of the cache based on the tensor parallel group;
- Establish cache distribution relationships for each group;
- Broadcast only the data actually needed by that group;
- Complete subsequent attention computation locally on the device.
This can reduce the broadcast scope, but it also increases the complexity of cache layout management. Therefore, the cache sharding method must be consistent with the operator implementation; otherwise, additional reordering overhead may occur.
3.2 Working with Cache Quantization
KV Cache usually has a large data volume, so storing the cache in low precision is an important way to reduce communication pressure. Common approaches include storing part of the cache in low-precision integer or floating-point formats while retaining necessary scaling factors or calibration information.
Cache quantization can reduce:
- The number of cache bytes per token;
- The amount of data sent over the inter-node network;
- Device memory usage;
- The size of temporary buffers during broadcasting.
However, quantization is not a cost-free optimization. Data distributions may differ across layers and attention heads. If the quantization granularity is too coarse, generation quality may be affected; if it is too fine, metadata and decoding overhead will increase. Engineering practice therefore needs to balance accuracy, compression ratio, and decoding cost.
3.3 Working with Layer Partitioning
For deep networks, the computation and cache of different layers can be placed on different devices or device groups. Layer partitioning can alleviate memory pressure on a single card, but it also increases the number of inter-layer transfers.
The role of KV Broadcast here is to distribute the cache required by the same layer or the same group of layers within a local scope as much as possible and to use pipelining to hide communication latency. Ideally, while the current layer is computing, the cache required by the next layer has already begun transmitting, reducing the waiting time of compute devices.
3.4 Working with EPD Disaggregated Architecture
In production-grade inference systems, multimodal encoding, prefill, and decoding can be split into different worker pools:
- The encoding pool handles inputs such as images, audio, and video;
- The prefill pool handles large prompts and generates the initial KV Cache;
- The decode pool generates results token by token.
This architecture can scale different types of compute resources separately, but it also makes KV Cache an important data exchange object between worker pools. KV Broadcast can take on the task of migrating cache from the prefill pool to the decode pool, and work with cache handles, lifecycle management, and chunked transfer strategies to reduce cross-pool communication cost.
4. A Simplified Implementation Model
The following is a platform-independent pseudocode example:
def prepare_and_broadcast(request, prefill_group, decode_group):kv_cache = prefill_group.run_prefill(request.tokens)layout = build_cache_layout(cache=kv_cache,topology=get_device_topology(),targets=decode_group.members())for block in layout.blocks:compressed = compress_kv(block)destinations = layout.destinations(block)broadcast(payload=compressed,targets=destinations,async_mode=True)return create_cache_handle(layout)
The decoding side reads the data that has already been distributed through the cache handle:
def decode_step(state, cache_handle):local_kv = cache_handle.get_required_blocks(layer_id=state.layer_id,token_range=state.token_range)return attention(query=state.query,key_cache=local_kv.keys,value_cache=local_kv.values)
A real system also needs mechanisms such as cache version numbers, timeout control, failure retries, device failover, and resource reclamation. The “broadcast” in the pseudocode does not necessarily correspond to a single communication primitive. A concrete implementation may involve shared memory, direct device interconnect, hierarchical forwarding, or message queues.
5. Key Engineering Issues in Deployment
5.1 Cache Lifecycle Management
KV Cache requires clear timing for creation, distribution, reference, invalidation, and reclamation. For long-context requests, if the cache occupies device memory for a long time, new requests may be unable to enter. The system should therefore design cache eviction policies and distinguish between caches that are being generated, reusable, and invalid.
5.2 Backpressure and Flow Control
When prefill speed exceeds decode consumption speed, the broadcast link may accumulate backlog. The system needs to apply backpressure based on cache queue length, device memory watermark, and network send rate to prevent the cache from piling up continuously and eventually causing cascading timeouts.
5.3 Communication and Computation Overlap
If computation starts only after broadcasting is complete, communication time is directly added to inference latency. A more effective approach is to chunk the cache and trigger computation for the corresponding layer as soon as data arrives, achieving communication-computation overlap.
5.4 Failure Recovery
During broadcasting, device restarts, link jitter, or target instance scaling may occur. The system should support chunk-level retransmission and local recovery without regenerating the entire KV Cache. For caches that cannot be recovered, it should fall back to the re-prefill path.
5.5 Monitoring Metrics
When evaluating the effectiveness of KV Broadcast, average throughput alone is not enough. The following should also be observed:
- First-token latency;
- Per-token generation latency;
- Average and peak KV Cache occupancy;
- Broadcast bytes versus effective compute bytes;
- Communication wait time;
- Cache hit rate;
- Retransmission rate and timeout rate;
- Device memory watermark;
- Performance changes under different context lengths.
These metrics help identify whether problems come from model computation, cache layout, network bandwidth, or scheduling policy.
6. Applicable Scenarios and Limitations
KV Broadcast is especially suitable for the following scenarios:
- Ultra-long context inference;
- Multiple instances sharing the same prefix;
- Separate deployment of prefill and decoding;
- Multi-device collaborative generation;
- Cache migration caused by multimodal requests;
- AI compute clusters with limited device memory but strong node interconnect capability.
It also has certain limitations. For requests with very short context and low concurrency, broadcast management overhead may be higher than direct transmission. When network bandwidth is insufficient or device topology is irregular, cache replication may become a new bottleneck. If cache quantization or sharding strategies are poorly designed, they may also introduce accuracy loss and additional reordering overhead.
Therefore, KV Broadcast should not be regarded as a standalone solution to all inference problems. It should be part of the inference service stack and designed together with cache compression, parallel computing, hierarchical scheduling, and elastic scaling.
7. Conclusion
The essence of KV Broadcast is to establish a more efficient data distribution mechanism around KV Cache. Through on-demand broadcasting, topology awareness, chunked transfer, and communication-computation overlap, it reduces duplicate replication and cross-device waiting in long-context inference.
In a complete inference system, it can work with intra-node parallelism, cache quantization, layer partitioning, and EPD disaggregated architectures to improve memory utilization, cache migration efficiency, and decoding-stage stability. For compute clusters with constrained memory and strong interconnect capability, the value of this type of optimization is reflected not only in individual communication performance, but also in whether compute, storage, interconnect, and scheduling can be unified to improve overall hardware utilization and reduce the per-token cost of long-context and multimodal inference.
