TL;DR
Modern AI workflows frequently pass the same prompt or conversation history through multiple different LLMs, wasting massive compute on redundant "prefill" steps. This paper introduces cross-model KV sharing, a novel method to translate the internal key-value (KV) cache from one model to another—even across different architectures, tokenizers, and sizes—slashing target prefill latency by up to 67% while preserving or even boosting downstream accuracy.
What Problem Does This Paper Address?
Heterogeneous LLM systems are booming. Whether it's routing an easy query to a small model before escalating to a larger one, coordinating multi-agent workflows, or running verification pipelines, multiple models often operate over the exact same context (e.g., system prompts, long chat histories, or retrieved documents).
Currently, LLM infrastructure treats the Key-Value (KV) cache as strictly model-local. When a new model is invoked, it must perform the expensive "prefill" phase from scratch, re-computing attention matrices over thousands of tokens. For long-context applications, this redundancy introduces massive GPU compute overhead and latency. This paper tackles a fundamental question: Can we translate and reuse a KV cache across entirely different models to eliminate redundant prefill computation?
Methods
The authors propose a universal context-reuse layer that acts as a translator between a source model ($M_A$) and a target model ($M_B$).
This translation is highly non-trivial. The translator must map representations across models that differ in:
- Hidden dimensions and layer counts.
- Attention configurations (e.g., mapping Multi-Head Attention to Grouped-Query Attention).
- Tokenizers and vocabulary spaces.
Instead of trying to perfectly replicate the target model's native cache, the system trains a learned translation function ($T_\theta$) to minimize the representation distance or optimize downstream task performance. Once the source model completes its prefill, the translator maps its KV cache into a target-compatible format. The frozen target model can then skip its own prefill phase entirely and decode directly from this translated state.
Datasets
- NoLiMa: Used as the primary dataset to train the translation/transport modules.
- LongBench2: Used to evaluate long-context multi-choice QA accuracy.
- FineWeb-Edu: Sampled text chunks were used to evaluate decoding perplexity across various token horizons.
Key Insights and Ideas
- Context Mobility: The paper shifts the paradigm of KV caches from temporary, model-locked execution artifacts to transferable computational assets that can flow freely across model boundaries.
- The "Knowledge Injection" Effect: Surprisingly, transferring a KV cache from a larger, more capable model (Qwen2.5-7B) to a smaller model (Qwen2.5-1.5B) actually improves the smaller model's accuracy far beyond its native baseline. The translated cache carries rich contextual representations from the larger model that the smaller model could not generate on its own.
- Fidelity vs. Utility: A translated cache does not need to be mathematically identical to a native cache to be highly effective. As long as it preserves the essential semantic and contextual relationships, the target model can decode successfully.
Key Results
1. Within-Family Transfer (Qwen2.5-7B $\rightarrow$ Qwen2.5-1.5B)
- Accuracy Boost: Decoding with the translated 7B cache boosted the frozen 1.5B model's LongBench2 accuracy from 27.59% to 34.48% (recovering 38.1% of the accuracy gap between the two native models).
- Speedup: Target prefill latency dropped from 158.7ms to 34.5ms (a 4.6× reduction) for 8K–16K contexts, and from 288.3ms to 53.8ms (a 5.4× reduction) for 16K–32K contexts.
2. Cross-Family Transfer (Qwen2.5-1.5B $\rightarrow$ Gemma-2-2B)
- Prefill Reduction: Handoff reduced target-side prefill latency by 67.04% at a 4K context length while maintaining decoding perplexity remarkably close to native baselines.
3. Extreme Heterogeneity (Llama3.1-70B $\rightarrow$ Qwen2.5-7B)
- Massive Latency Slashing: Combining a family change with a 10× scale gap, the handoff path achieved 44.0% accuracy (retaining 96.3% of native Qwen target accuracy) while dropping measured latency from 899ms to just 138ms (a 6.5× speedup).
Limitations and Future Work
- Long-Context Degradation: Handoff accuracy dropped by 8.16 percentage points when moving from the 8K–16K context bucket to the 16K–32K bucket, showing that preserving representation fidelity becomes harder as context scales.
- System Overheads: Pure translation takes only 9.1–12.2 ms. The rest of the handoff time is consumed by peer-to-peer copying, cache assembly, and runtime synchronization, which remain critical optimization targets.
- Generalization: The authors note that further evaluation is required to see how well these translation layers generalize across a wider variety of architectures, dynamic multi-agent workflows, and deployment environments.
Summary updated