PureKV: Plug-and-Play KV Cache Optimization with Spatial-Temporal Sparse Attention for Vision-Language Large Models

Zhonghua Jiang, Kunxi Li, Yiyun Zhou, Sihao Liu, Zhaode Wang, chengfei lv, Shengyu Zhang · Submission to ICLR 2026 · Withdrawn

TL;DR

PureKV is a plug-and-play optimization framework that makes dynamic KV cache pruning compatible with modern, hardware-accelerated attention engines (like FlashAttention) in Vision-Language Large Models (VLLMs). By pairing cross-layer importance estimation with a novel spatial-temporal sparse attention pattern, it purges spatiotemporal noise, slashes KV cache memory by up to $5\times$ (80% reduction), and delivers a $3.16\times$ speedup in prefilling latency with virtually no loss in multimodal reasoning accuracy.

What Problem Does This Paper Address?

As Vision-Language Large Models process high-resolution video and image sequences, the number of visual tokens explodes. During inference, this causes severe bottlenecks:

  1. The Prefill Phase: Self-attention scales quadratically with sequence length, delaying the Time-to-First-Token (TTFT).
  2. The Decoding Phase: Autoregressively caching key-value (KV) states consumes huge amounts of GPU memory.

While existing KV cache pruning methods (like H2O or SnapKV) discard low-importance tokens, they compute full, explicit attention matrices at every layer to determine token importance. This makes them incompatible with fast GPU kernels like FlashAttention or custom sparse attention, which deliberately avoid materializing attention weight matrices to save memory and IO overhead. Furthermore, conventional dense attention causes "information entanglement"—over successive layers, causal attention blurs important visual features with background noise and redundant consecutive frames, degrading downstream token pruning.

Methods

PureKV introduces two complementary mechanisms to unify efficient attention with dynamic KV cache pruning:

Lower Layers (e.g., Layer 1–2)         Higher Layers (with Flash/Sparse Attention)
[ Full Attention Matrices ]           [ Hardware-Accelerated Kernels (No Matmul Weights) ]
            │                                                 │
            ▼                                                 ▼
Accumulated Attention (C_low)  ──(reused across layers)──►   S_high = C_low ⊙ ||V_high||
            │                                                 │
            ▼                                                 ▼
 Prune non-recent KV cache                             Prune non-recent KV cache
  • Cross-Layer Importance Estimation (CLIE): Instead of calculating full attention scores at every layer, PureKV calculates attention only in the earliest transformer layers (e.g., Layer 2). The model then reuses these lower-layer attention scores for all subsequent higher layers, multiplying them element-wise by the L2 norm of the higher layers' Value vectors ($\|V^{\text{high}}\|$). This eliminates the need to expose attention matrices at higher layers, restoring full compatibility with FlashAttention.
  • Value-Weighted Scoring: Prior token pruning methods measure importance strictly through query-key attention scores. PureKV weights attention scores by the magnitude ($\|V\|$) of the corresponding value vector, recognizing that even an attended token produces little impact if its value vector is near zero.
  • Spatial-Temporal Sparse Attention (ST-SpAttn): In the higher layers of video models, dense attention is replaced with a structured sparse attention pattern that cleanses visual noise during prefill:
  • Spatial Sparsity: Preserves connections only within the current frame (local context) and back to the very first frame (global context anchor).
  • Temporal Sparsity: Restricts cross-frame attention to matching tokens in the immediately preceding frame alongside the initial anchor frame.

Datasets

  • MVBench: A multimodal video understanding benchmark covering 14 distinct tasks including Action Sequence, Action Prediction, Unexpected Action, Object Interaction, Scene Transition, and Action Count.
  • AVSD (Audio Visual Scene Aware Dialogue): Used to assess generalization on dialogue and audiovisual video reasoning tasks.
  • Target Architectures: Evaluated on VideoLLaMA2 and Qwen2.5-VL-7B.

Key Insights and Ideas

  • Lower-layer attention is a sufficient statistic: Statistical analysis using Spearman’s rank correlation confirmed that token importance rankings derived from Layer 1/2 strongly correlate ($\rho > 0.4$ across most layers, $p < 0.05$) with ground-truth rankings computed at deep layers.
  • Attention weights alone lie: Ignoring the Value vector magnitude produces biased pruning. Weighting attention by $\|V\|$ captures the actual magnitude of the residual contribution to model activations.
  • Sparsity acts as a representation purifier: Dense attention across video frames acts like a noisy diffusion process—background tokens gradually contaminate salient object tokens across layers. Constraining attention to immediate temporal neighbors and anchor frames acts as a structural filter, generating cleaner, more separable KV representations that make eviction algorithms more effective.

Key Results

  • Memory Compression: Under strict 10%–20% KV cache budgets (i.e., compressing the cache by $5\times$ to $10\times$), PureKV consistently outperforms prior compression techniques (H2O, SnapKV, StreamingLLM, FastV, LOOK-M). On Qwen2.5-VL, PureKV with a 20% budget achieved an average score of 0.5429 on MVBench, outperforming the full 100% cache baseline (0.5136) by filtering out noise.
  • Prefill and Decoding Acceleration: On VideoLLaMA2, PureKV reduces prefilling latency from 0.1190 ms/token down to ~0.0355 ms/token (a $\sim 3.16\times$ prefill speedup) and reduces per-token decoding latency from 36.73 ms to ~28 ms.
  • Generalizability: PureKV functions as a drop-in enhancement; integrating its cross-layer scoring and ST-SpAttn modules into existing frameworks like SnapKV and StreamingLLM yielded consistent accuracy improvements (e.g., boosting SnapKV on VideoLLaMA2 from 0.4811 to 0.5680).

Limitations and Future Work

  • Hyperparameter Sensitivity across Layers: The starting layers for CLIE and ST-SpAttn require careful calibration. Activating CLIE at Layer 0 degrades performance severely because initial representations lack semantic context, whereas Layer 2 serves as the empirical sweet spot.
  • Structured Video Geometry: ST-SpAttn assumes an explicit, regular grid/frame structure (anchor frames, previous-frame coordinate matching), making it directly applicable to video streams, but less immediately suited for arbitrary irregular multi-image documents or heterogeneous interleaved inputs without adaptation.

Summary updated

BibTeX
@misc{jiang2025purekv,
  author = {Zhonghua Jiang and Kunxi Li and Yiyun Zhou and Sihao Liu and Zhaode Wang and chengfei lv and Shengyu Zhang},
  title = {{PureKV: Plug-and-Play KV Cache Optimization with Spatial-Temporal Sparse Attention for Vision-Language Large Models}},
  year = {2025},
  eprint = {2510.25600},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.25600},
}

Loading related content...

Figure