Cross-Model KV Cache Transfer in LLM Families:A Closed-Form Linear Mapping for Prefill Reuse
Production deployments often swap between different-sized models in a family for cost-quality cascading, mid-conversation switching, and routing, and each swap forces the receiver to repay the prefill from scratch. We propose cross-model KV cache transfer, where the receiver reuses the source’s KV cache, skipping prefill. We find that cross-model KV has substantial linear structure across matched-KV pairs, where source and target share KV head count and per-head dimension. On Qwen3 14B→32B, one source layer explains 56% of variance in the target’s keys and 32% in values, rising to 79% and 65% with multiple source layers. Building on this, we design a closed-form ridge mapper that operates per head and proceeds in three steps. First, for each target layer we select the top-k most predictive source layers and concatenate their KV as input. Second, we strip RoPE from the keys before mapping, so the fit is position-free and reusable across context lengths. Third, we fit ridge regression on
Rasoul Shafipour Ritchie Zhao Maximilian Golub Affiliation: Mohammad Mahdi Kamani Ritika Borkar Makesh Tarun Chandran Affiliation: Pantea Zardoshti Bita Darvish Rouhani Affiliation: NVIDIA Abstract Production deployments often swap between different-sized models in a family for cost-quality cascading, mid-conversation switching, and routing, and each swap forces the receiver to repay the prefill from scratch. We propose cross-model KV cache transfer, where the receiver reuses the source’s KV cache, skipping prefill. We find that cross-model KV has substantial linear structure…
saved by
related reading
- KV Caching Explained: Optimizing Transformer Inference Efficiencyhuggingface.co
- [2506.06266] Cartridges: Lightweight and general-purpose long context representations via self-studyarxiv.org
- Paged Attention from First Principles: A View Inside vLLM – Hamza's Bloghamzaelshafie.bearblog.dev
- [2412.02252] Compressing KV Cache for Long-Context LLM Inference with Inter-Layer Attention Similarityarxiv.org
- Speculative KV coding: losslessly compressing KV cache by up to ~4× using a predictor modelfergusfinn.com
- Kimi Linear: An Expressive, Efficient Attention Architecturearxiv.org
- [2412.14838] DynamicKV: Task-Aware Adaptive KV Cache Compression for Long Context LLMsarxiv.org
- Bridging the Attention Gap: Complete Replacement Models for Complete Circuit Tracinginterp.open-moss.com
- [2602.05970] Inverse Depth Scaling From Most Layers Being Similararxiv.org
- [2101.03961] Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsityarxiv.org
- You Only Need Minimal RLVR Training: Extrapolating LLMs via Rank-1 Trajectoriesarxiv.org
- Language Model Compositionarxiv.org