arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.08584cs.CVcs.AI
收藏

ZipVL:基于动态Token稀疏化的高效大型视觉-语言模型

ZipVL: Efficient Large Vision-Language Models with Dynamic Token Sparsification

Zhejiang University(浙江大学);Shanghai AI Laboratory(上海人工智能实验室);The University of Adelaide(阿德莱德大学);Monash University(莫纳什大学)

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

AI总结:

提出高效推理框架ZipVL,通过基于注意力分数分布动态分配重要Token比例,对重要Token执行稀疏注意力以降低预填充延迟并丢弃不重要Token压缩KV缓存,在几乎不损失精度的同时显著提升了大型视觉-语言模型的推理效率。

摘要:

大型视觉-语言模型(LVLMs)的效率受限于预填充阶段注意力机制的计算瓶颈,以及解码阶段获取键值(KV)缓存的内存瓶颈,在处理高分辨率图像或视频的场景下尤为明显。视觉内容通常存在大量冗余,导致LVLMs内部的注意力图高度稀疏。这种稀疏性可被利用来加速注意力计算或通过多种方法压缩KV缓存。然而,多数研究仅关注解决其中单一瓶颈,且未能充分支持针对不同层或任务的稀疏度动态调整。本文提出ZipVL,这是一种面向LVLMs的高效推理框架,通过重要Token的动态比例分配策略实现。该比例基于特定层的注意力分数分布自适应确定,而非固定超参数,从而在为较简单任务提升效率的同时,为更具挑战性的任务保持高性能。随后,我们根据归一化注意力分数选择重要Token,并仅对这些重要Token执行稀疏注意力机制,以减少预填充阶段的延迟。被判定为不重要的Token将被丢弃以减小KV缓存规模,从而缓解解码阶段的内存瓶颈。实验表明,在LLaVA-Next-13B模型和VQAv2基准上,ZipVL能将预填充阶段加速2.3倍,并将解码吞吐量提升2.8倍,且准确率仅降低0.5%,有效提升了LVLMs的生成效率。

英文摘要:

The efficiency of large vision-language models (LVLMs) is constrained by the computational bottleneck of the attention mechanism during the prefill phase and the memory bottleneck of fetching the key-value (KV) cache in the decoding phase, particularly in scenarios involving high-resolution images or videos. Visual content often exhibits substantial redundancy, resulting in highly sparse attention maps within LVLMs. This sparsity can be leveraged to accelerate attention computation or compress the KV cache through various approaches. However, most studies focus on addressing only one of these bottlenecks and do not adequately support dynamic adjustment of sparsity concerning distinct layers or tasks. In this paper, we present ZipVL, an efficient inference framework designed for LVLMs through a dynamic ratio allocation strategy of important tokens. This ratio is adaptively determined based on the layer-specific distribution of attention scores, rather than fixed hyper-parameters, thereby improving efficiency for less complex tasks while maintaining high performance for more challenging ones. Then we select important tokens based on their normalized attention scores and perform sparse attention mechanism solely on those important tokens, reducing the latency in the prefill phase. Tokens deemed less important will be discarded to reduce KV cache size, alleviating the memory bottleneck in the decoding phase. Our experiments demonstrate that ZipVL can accelerate the prefill phase by 2.3$\times$ and improve decoding throughput by 2.8$\times$, with a minimal accuracy reduction of only 0.5\% on VQAv2 benchmark over LLaVA-Next-13B model, effectively enhancing the generation efficiency of LVLMs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑