MM-ShiftKV: Decode-Aware Prefill-Stage KV Selection for Multimodal Large Language Models

Jinsong Shu, Chenyang Wu, Zhongle Xie, Baokun Wang, Lidan Shou

TL;DR

MM-ShiftKV addresses a critical "prefill-decode scale mismatch" in multimodal LLMs, where decoding-time queries exhibit significantly higher variance than prefill-stage representations. By generating variance-expanded synthetic query proxies during the prefill stage, it accurately preserves semantically critical visual tokens under tight Key-Value (KV) cache budgets. This training-free, prefill-only method slashes peak VRAM by up to 43% and accelerates decoding by up to 1.9x without any decoding-time overhead.

What Problem Does This Paper Address?

Multimodal Large Language Models (MLLMs) excel at processing high-resolution images, but doing so requires converting visual inputs into thousands of tokens. During inference, these tokens dominate the Key-Value (KV) cache, which stores past keys and values to avoid recomputation during autoregressive decoding. Because the KV cache grows linearly with sequence length, it quickly becomes a massive memory and latency bottleneck.

To mitigate this, recent techniques use "prefill-stage KV selection" to prune less important tokens right after the prompt is processed (the prefill stage). However, these methods implicitly assume distributional homogeneity—the idea that token importance during prefilling accurately reflects token importance during decoding.

The authors reveal that this assumption completely breaks down in multimodal settings. MLLMs experience a severe prefill-decode scale mismatch: the hidden states during decoding exhibit substantially larger variance than those during prefilling. Because existing pruning methods rely on under-scaled prefill statistics, they suffer from "information blindness," mistakenly discarding sparse but semantically vital visual tokens. This leads to degraded visual grounding and unstable reasoning under tight cache budgets.

Prefill-decode statistics showing layer-wise mean and variance mismatch, alongside attention mass coverage across different methods.

Methods

The authors introduce MM-ShiftKV, a training-free, decode-aware, and strictly prefill-only KV cache selection framework. Instead of relying solely on raw prefill statistics, it actively simulates the distributional properties of future decoding queries before decoding begins.

The algorithm operates in three main steps at the end of the prefill stage:

  1. Query Proxy Construction: The method calculates the element-wise mean ($\mu_{pre}$) and standard deviation ($\sigma_{pre}$) of the prefill hidden states. To counteract the scale mismatch, it introduces a variance expansion factor ($\gamma = 10$) and samples $N=512$ synthetic "proxy" hidden states from a widened Gaussian distribution: $$\tilde{H}_i \sim \mathcal{N}\left(\mu_{pre}, \text{diag}((\gamma\sigma_{pre})^2)\right)$$ These proxies are projected into the query space and assigned synthetic future positions using the model's rotary positional embeddings (RoPE).

  2. KV Importance Estimation: The synthetic query proxies are split into $G=32$ disjoint groups. The method computes how these proxies attend to the prompt keys, aggregating the attention mass within each group. Each group then "votes" on a minimal set of keys that cover a predefined attention mass threshold ($\tau = 0.95$).

  3. Budgeted KV Selection: Prompt keys are ranked based on their total accumulated votes. To resolve ties deterministically, the attention score from the actual last prefill query acts as a secondary tie-breaker (a last-query anchor). The top keys fitting the budget are retained, the original temporal order is restored, and the most recent token is always kept to maintain local context stability.
Overview of the MM-ShiftKV workflow, illustrating query proxy construction, importance estimation via group-wise voting, and budgeted selection.

Datasets

The framework was evaluated using Qwen2.5-VL-7B-Instruct and LLaVA-v1.6-Vicuna-7B across several demanding multimodal benchmarks:

  • OCRBench & DocVQA: Text recognition and document visual question answering.
  • ChartQA: Visual and logical reasoning over numerical charts.
  • TextVQA: Question answering centered on real-world text (e.g., street signs).
  • MMMU: Advanced multi-discipline multimodal understanding and reasoning.
  • TextCaps: Image captioning requiring precise reading comprehension.

Key Insights and Ideas

  • Functional Stage Divergence: Prefilling primarily handles visual perception and cross-modal alignment, whereas decoding shifts toward language generation and sequential reasoning. This functional shift is what naturally alters the underlying numerical distributions of the hidden states.
  • Fattening the Envelope: Standard sampling fails to capture the heavy-tailed, systematic outliers that emerge downstream during query projection. Artificially inflating the covariance matrix ("fattening" the sampling envelope) allows the query proxies to successfully hit 89.7% of these critical outlier dimensions, compared to just 12.4% without variance expansion.
  • Zero Decoding Intervention: Because the proxy simulation and cache pruning occur entirely at the end of the prefill stage, the optimized KV cache remains fixed throughout generation. This makes MM-ShiftKV fully compatible with high-performance decoding kernels like FlashAttention.

Key Results

  • Superior Accuracy under Tight Budgets: Under extreme compression constraints (e.g., a strict budget of 64 tokens per KV head), MM-ShiftKV delivers relative accuracy improvements of 20% to 30% on document understanding tasks compared to strong baselines like SnapKV and ExpectedAttn. On generation tasks (TextCaps), it improves caption quality metrics by over 40%.
  • Substantial Efficiency Gains: When tested on long-context sequences up to 32K tokens, MM-ShiftKV maintains a nearly flat decoding latency profile, achieving up to a 1.9x speedup over uncompressed inference (FullKV). Simultaneously, it cuts peak GPU memory usage by 43.3% (dropping from 32.9 GB to 18.6 GB).
End-to-end decoding latency and peak GPU memory usage under increasing input lengths up to 32K tokens.

Limitations and Future Work

  • Prefill Overhead: Constructing and evaluating 512 query proxies introduces a minor computational cost during the prefill phase, increasing the Time-To-First-Token (TTFT) by roughly 0.38 seconds (~2.2% of total inference time). The authors note there is room to optimize this initialization phase.
  • Static Pruning Constraints: Because cache selection is strictly prefill-only, the method does not evict or compress new tokens generated during the decoding stage, which could pose challenges for tasks requiring exceptionally long text generation.
  • Modality Scope: The study focused exclusively on image and video inputs. Adapting the framework to handle other heterogeneous modalities, such as audio-text models, remains an open direction for future research.

Summary updated

BibTeX
@inproceedings{shu2026mm,
  author = {Jinsong Shu and Chenyang Wu and Zhongle Xie and Baokun Wang and Lidan Shou},
  title = {{MM-ShiftKV: Decode-Aware Prefill-Stage KV Selection for Multimodal Large Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.findings-acl.1447},
}
Figure