ZipVL: Efficient Large Vision-Language Models with Dynamic Token Sparsification and KV Cache Compression

Yefei He, Feng Chen, Jing Liu, Wenqi Shao, Hong Zhou, Kaipeng Zhang, Bohan Zhuang · DOI

Abstract

Large Vision-Language Models (LVLMs) are increasingly powerful but face significant computational bottlenecks due to the quadratic complexity of attention in the prefill phase and the memory overhead of Key-Value (KV) caches during decoding. We present ZipVL, an efficient inference framework that dynamically identifies and retains only the most critical visual tokens. By employing layer-wise adaptive ratio assignment and a unified token allocation strategy, ZipVL achieves a 2.3× speedup in the prefill phase and a 2.8× boost in decoding throughput with negligible impact on accuracy across diverse benchmarks.

Introduction

State-of-the-art LVLMs like LLaVA and Qwen-VL are computationally expensive, primarily due to two factors: the Prefill Bottleneck and the Decoding Bottleneck. In the prefill phase, processing high-resolution images or long videos leads to a massive number of tokens, where the quadratic complexity of the attention mechanism results in high Time-To-First-Token (TTFT). During decoding, the model must maintain a KV cache for all previous tokens; for long sequences, this cache can exceed GPU memory limits and slow down generation due to memory bandwidth constraints.

Existing solutions often rely on static pruning ratios, which fail to account for the varying information density of visual content. A simple image may require very few tokens, whereas a complex chart requires high-density information. ZipVL addresses this by allowing the model to adaptively adjust token sparsity based on the specific input and layer requirements.

Attention maps across different layers and datasets demonstrate that visual redundancy is prevalent and varies significantly by task and depth.

Methodology

ZipVL optimizes the entire inference lifecycle through three primary innovations:

  1. Layer-wise Adaptive Ratio Assignment: Rather than a fixed pruning percentage, ZipVL utilizes a threshold ($\tau$). It calculates cumulative attention scores and retains only the minimum number of tokens necessary to account for a target majority (e.g., 97.5%) of the total attention weight. This ensures complex tasks receive more compute resources while simpler ones are optimized.
  2. Unified Token Allocation: To maintain consistency, the "important" tokens identified during the prefill phase are used to prune the KV cache. This synchronization ensures that the model's internal representations remain stable throughout the generation process.
  3. Efficient Approximation with Probe Tokens: To identify important tokens without the overhead of full attention calculation, ZipVL uses a small subset of "probe tokens" (comprising recent and random tokens) to estimate importance with minimal computational cost.
The ZipVL framework: (1) Dynamic ratio calculation, (2) Important token identification, and (3-4) Sparse attention implementation in prefill and decoding phases.

Experimental Results

ZipVL was evaluated on LLaVA-Next-13B and LongVA-7B across benchmarks including VQAv2, ChartQA, and Video-MME.

  • Efficiency Gains: On LLaVA-Next-13B, ZipVL accelerated the prefill phase by 2.3× and improved decoding throughput by 2.8×. For 128-frame video processing, attention FLOPs were reduced by over 82%.
  • Accuracy Preservation: The framework maintains high performance even on complex reasoning tasks. On VQAv2, ZipVL achieved these speedups with only a 0.5% reduction in accuracy compared to the full unoptimized model. It significantly outperformed static baselines like FastV and HiRED, which often struggle with information-dense benchmarks like ChartQA.

Conclusion and Future Work

ZipVL demonstrates that dynamic, layer-wise token sparsification is a highly effective strategy for scaling LVLM inference. By linking prefill sparsity with KV cache eviction, it provides a holistic solution for both compute and memory bottlenecks. Future work will explore extending these sparse computations to Multi-Layer Perceptron (MLP) modules and investigating the synergy between dynamic sparsification and model quantization techniques.

Summary updated

BibTeX
@misc{he2024zipvl,
  author = {Yefei He and Feng Chen and Jing Liu and Wenqi Shao and Hong Zhou and Kaipeng Zhang and Bohan Zhuang},
  title = {{ZipVL: Efficient Large Vision-Language Models with Dynamic Token Sparsification and KV Cache Compression}},
  year = {2024},
  eprint = {2410.08584},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.08584},
}
Figure