arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2408.10945cs.CVcs.AI
收藏

HiRED:面向高分辨率视觉-语言模型高效推理的注意力引导令牌丢弃方法

HiRED: Attention-Guided Token Dropping for Efficient Inference of High-Resolution Vision-Language Models

Virginia Tech(弗吉尼亚理工大学);Queen’s University Belfast(贝尔法斯特女王大学);University College Dublin(都柏林大学学院)

Kazi Hasan Ibn Arif, JinYi Yoon, Dimitrios S. Nikolopoulos, Hans Vandierendonck, Deepu John, Bo Ji

AI总结:

HiRED 提出一种基于 CLS 注意力在固定令牌预算内为高分辨率图像分区动态分配视觉令牌的即插即用方法,在 LLaVA-Next-7B 上显著提升吞吐量、降低延迟并节省 GPU 内存。

摘要:

高分辨率视觉-语言模型(VLMs)通过保留详细的图像信息,在多模态任务中被广泛用于提升准确性。然而,由于需要对高分辨率图像输入的多个分区进行编码,这些模型往往会产生过多的视觉令牌。通过多个 Transformer 网络处理如此大量的视觉令牌带来了显著的计算挑战,尤其是对于资源受限的商用 GPU。为了解决这一挑战,我们提出了高分辨率早期丢弃(HiRED),这是一种即插即用的令牌丢弃方法,旨在固定的令牌预算内运行。HiRED 利用视觉 Transformer(ViT)中 CLS 令牌的注意力来评估图像分区的视觉内容,并据此为每个分区分配最优的令牌预算。然后,在每个分区分配预算内最具信息量的视觉令牌被选出并传递给后续的大语言模型(LLM)。我们证明了与现有的令牌丢弃方法相比,HiRED 实现了更优的准确性和性能。实验表明,在 LLaVA-Next-7B 上使用 HiRED-20%(即 20% 的令牌预算)可将令牌生成吞吐量提升 4.7 倍,将响应延迟降低 78%,并在 NVIDIA TESLA P40(24 GB)上进行单次推理时节省 14% 的 GPU 内存。对于更大的批处理大小(例如 4),HiRED-20% 通过将内存使用量降低 30% 来避免内存不足错误,同时保持吞吐量和延迟方面的优势。代码 - https://github.com/hasanar1f/HiRED

英文摘要:

High-resolution Vision-Language Models (VLMs) are widely used in multimodal tasks to enhance accuracy by preserving detailed image information. However, these models often generate an excessive number of visual tokens due to the need to encode multiple partitions of a high-resolution image input. Processing such a large number of visual tokens through multiple transformer networks poses significant computational challenges, particularly for resource-constrained commodity GPUs. To address this challenge, we propose High-Resolution Early Dropping (HiRED), a plug-and-play token-dropping method designed to operate within a fixed token budget. HiRED leverages the attention of CLS token in the vision transformer (ViT) to assess the visual content of the image partitions and allocate an optimal token budget for each partition accordingly. The most informative visual tokens from each partition within the allocated budget are then selected and passed to the subsequent Large Language Model (LLM). We showed that HiRED achieves superior accuracy and performance, compared to existing token-dropping methods. Empirically, HiRED-20% (i.e., a 20% token budget) on LLaVA-Next-7B achieves a 4.7x increase in token generation throughput, reduces response latency by 78%, and saves 14% of GPU memory for single inference on an NVIDIA TESLA P40 (24 GB). For larger batch sizes (e.g., 4), HiRED-20% prevents out-of-memory errors by cutting memory usage by 30%, while preserving throughput and latency benefits. Code - https://github.com/hasanar1f/HiRED

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

↑