Abstract
Compound AI systems, such as agentic systems, are an emerging trend in large-scale enterprise settings, with multiple LLMs specialized for different users, tasks, and/or roles working together. In these scenarios, different models often process inputs that share the same context prefix. Although much work was done in the past to enable the reuse of prefix KV caches across inputs for a single model, how to enable one model to reuse the prefix KV caches of a different model remains an open question. We introduce DroidSpeak, the first distributed LLM inference system that enables KV cache reuse across distributed nodes running inference of different LLMs, so long as the LLMs have the same architecture. We present the first study that aims at understanding the impact of sharing KV caches across different LLMs, and if/when such sharing affects quality. Inspired by the findings, we present DroidSpeak, which selectively recomputes a few layers of the KV cache produced by another LLM and reuses the remaining layers, with negligible quality loss. Moreover, carefully pipelining the layer-wise re-computation and the loading of reused KV cache further improves the inference performance. Experiments on diverse datasets and model pairs demonstrate that DroidSpeak achieves up to 4x throughput improvement and about 3.1x faster prefill (time to first token), with negligible loss of quality in F1 scores, Rouge-L or code similarity score, compared to the baseline which does not allow any sharing across models.
The Rise of Compound AI and the KV Cache Bottleneck
In modern enterprise AI, the paradigm is shifting from single monolithic models to "Compound AI" systems. These workflows involve multiple specialized agents—such as a coding agent, a debugging agent, and a validation agent—working in concert to solve complex tasks. Often, these agents are different fine-tuned versions of the same base model (e.g., Llama-3 or Mistral) and frequently process the same conversation history or document context.
While KV caching is a standard technique to accelerate inference by storing previous computations, it has historically been restricted to the exact same model weights. In multi-agent systems, this restriction forces every model to "re-read" and recompute the entire context from scratch, leading to redundant computation, high latency (Time to First Token), and inefficient GPU utilization.
The Challenge of Cross-Model Cache Sharing
The primary obstacle to cross-model sharing is weight divergence. Even if two models share the same architecture, slight differences in their fine-tuned weights cause errors to propagate through the KV cache. Directly reusing a cache generated by Model A in Model B typically results in a "garbage in, garbage out" scenario, where generation quality collapses.
As shown in empirical studies, naive reuse can tank accuracy by over 50%. Consequently, current systems treat each model as an isolated silo, missing significant opportunities for optimization in distributed environments.
DroidSpeak: Selective Recomputation and Pipelining
DroidSpeak addresses this challenge by treating KV cache sharing as a selective recomputation problem. The system is built on several key technical pillars:
- Critical Layer Identification: Researchers discovered that not all layers are equally sensitive to weight differences. On average, only about 11% of layers are "critical"—meaning they are highly sensitive to deviations. By recomputing only these specific layers, the system can restore model accuracy to near-baseline levels.
- Selective Recomputation with E-Cache: DroidSpeak recomputes only the identified critical layers. To facilitate this, it utilizes an Embedding (E) cache—the output of the previous layer from the sender model—as a starting point for recomputation, avoiding a full restart from the first layer.
- Contiguous Grouping: To minimize error propagation during transitions between reused and recomputed data, DroidSpeak identifies contiguous blocks of layers to recompute, balancing efficiency against output quality.
- Pipelined Execution: In distributed settings, DroidSpeak pipelines the network transfer of reused KV cache layers with the GPU-bound recomputation of critical layers. This effectively hides network latency, ensuring that the system remains performant even in bandwidth-constrained environments.
Performance and Quality Evaluation
DroidSpeak was evaluated across diverse tasks, including reasoning (HotpotQA), summarization (multi_news), and code completion (HumanEval), using model families like Llama-3, Mistral, and Phi-3.5.
- Latency and Throughput: DroidSpeak achieves a 1.7x to 3.1x reduction in prefill latency (TTFT). In high-load scenarios, it supports up to 4x higher throughput compared to standard systems that do not allow cross-model sharing.
- Quality Preservation: Across all benchmarks, DroidSpeak maintained generation quality within a negligible margin (often <1% difference in F1 or Rouge-L scores) of the full recomputation baseline.
- Offline Profiling: A key insight is that layer criticality is largely determined by the model pair rather than the specific input text. This allows for effective offline profiling, where the optimal recomputation strategy is determined once and applied to all subsequent requests.
Conclusion and Future Directions
DroidSpeak represents the first distributed inference system to enable effective KV cache reuse across different LLMs of the same architecture. By identifying the "10% rule" of critical layers, it unlocks massive performance gains for multi-agent and multi-LoRA workflows without sacrificing accuracy. Future work may explore cross-architecture sharing and dynamic adaptation of recomputation ratios to handle real-time fluctuations in server load and network conditions.
Summary updated