Cross-Model KV Cache Transfer in LLM Families: A Closed-Form Linear Mapping for Prefill Reuse
Taekyung Heo, Rasoul Shafipour, Ritchie Zhao, Maximilian Golub, Mohammad Mahdi Kamani, Ritika Borkar, Makesh T Chandran, Pantea Zardoshti, Bita Darvish Rouhani
NeurIPS page · OpenReview · alphaXiv · Open on the map
Category: Efficient LLM Inference & Training › KV Cache Optimization · Type: new method · Keywords: cross-model KV cache transfer, LLM inference scaling, ridge regression mapping, prefill reuse, model cascading
Summary
The paper presents a closed-form ridge mapper that transfers KV caches across LLM family models, enabling prefill reuse and achieving 71-98% of original accuracy while running 3-31× faster.
Explained to a 5-year-old
When we use big talking computers (LLMs), sometimes we need to switch to a bigger or smaller one. Each time we switch, the computer has to start remembering everything again, which takes a lot of time. This paper finds a way to copy the memory from the old computer to the new one, so the new one doesn't have to start over. It uses a simple math rule to match the memories, and it works really fast. This helps the computers change quickly without waiting.
Explained to a 5-year-old, longer
Big computers that talk (LLMs) can be different sizes. When we need to use a different size, we have to switch models. Switching means the new model forgets everything it knew before. Forgetting everything forces the model to learn again, which takes a long time. The paper looks at how we can keep the old memory and give it to the new model. It finds that the memory from one model is often similar to the memory of another model. By using a simple rule, we can copy the old memory to the new one. This copying is fast and works for many different models. The new method helps the computers change without waiting for a full relearning process. It also works when we switch back and forth many times. The idea is useful for services that run many different sized models. It saves time and energy while keeping the quality of answers high.
For a technical reader
The system reuses KV caches from a source LLM when switching to a larger or smaller model, avoiding the expensive prefill step. It exploits the linear relationship between matched KV heads and fits a ridge regression per head on a small calibration set. Rotary positional embeddings are removed from keys to make the mapping position-free. An optional MLP can improve performance on problematic pairs. The mapper runs orders of magnitude faster than re-prefill and remains stable across multiple handoffs.
Problem
When deploying large language models, switching between models of different sizes requires re-computing the costly prefill step from scratch, leading to inefficiency.
Method
The approach selects top-k source layers per target head, strips rotary positional embeddings from keys, and fits a ridge regression on a small calibration set to map source KV to target KV. This linear mapping is applied per head and can be reused across context lengths, with an optional nonlinear MLP to improve failures.
Results
Across six model pairs, the linear mapper retains 71-98% of the original prefill accuracy on four pairs, while two pairs degrade sharply; a nonlinear MLP recovers up to +22 percentage points on those failures. The mapper runs 3-31× faster than re-prefill.
Contributions
The work discovers a strong linear relationship in cross-model KV caches and proposes a per-head ridge regression mapper that enables fast cache transfer, along with an optional MLP to improve performance on problematic pairs.
Limitations and assumptions
Requires source and target models to have the same KV head count and per-head dimension; performance varies across families, with some pairs showing sharp degradation.
Practical relevance
Enables cost-effective model cascading and mid-conversation switching in production LLM services by reusing KV caches, reducing latency and compute.
Research questions this paper is counted under
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction