提出无需训练的视觉令牌剪枝方法,显著降低多模态模型推理内存占用。
TopV: Compatible Token Pruning with Inference Time Optimization for Fast and Low-Memory Multimodal Vision Language Model

- 将剪枝建模为优化问题,基于视觉特征相似性等指标判断令牌重要性
- 单次预填充阶段剪枝,使KV缓存大小减少40%以上,推理速度提升30%
- 兼容FlashAttention与KV缓存,适合部署在资源受限设备上的多模态模型
视觉语言模型(VLMs)推理时需处理大量视觉输入令牌,消耗大量计算资源。以往方法依赖注意力分数的贪婪准则进行剪枝,存在不准确且不兼容FlashAttention与KV缓存的问题。本文提出TopV,一种无需额外训练或微调的视觉令牌剪枝方法,通过构建包含特征相似性、相对空间距离和绝对中心距离的视觉感知代价函数,将剪枝转化为优化问题,精准识别重要视觉令牌。该方法仅在预填充阶段执行一次剪枝,有效减小KV缓存规模。实验表明,相比现有方法,TopV在保持性能的同时,将推理内存降低40%以上,速度提升30%,且兼容主流加速技术。
原文摘要 · Abstract (English)
Vision-Language Models (VLMs) demand substantial computational resources during inference, largely due to the extensive visual input tokens for representing visual information. Previous studies have noted that visual tokens tend to receive less attention than text tokens, suggesting their lower importance during inference and potential for pruning. However, their methods encounter several challenges: reliance on greedy heuristic criteria for token importance and incompatibility with FlashAttention and KV cache. To address these issues, we introduce \textbf{TopV}, a compatible \textbf{TO}ken \textbf{P}runing with inference Time Optimization for fast and low-memory \textbf{V}LM, achieving efficient pruning without additional training or fine-tuning. Instead of relying on attention scores, we formulate token pruning as an optimization problem, accurately identifying important visual tokens while remaining compatible with FlashAttention. Additionally, since we only perform this pruning once during the prefilling stage, it effectively reduces KV cache size. Our optimization framework incorporates a visual-aware cost function considering factors such as Feature Similarity, Relative Spatial Distance, and Absolute Central Distance, to measure the importance of each source visual token, enabling effective pruning of low-importance tokens. Extensive experiments demonstrate that our method outperforms previous token pruning methods, validating the effectiveness and efficiency of our approach.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。