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

面向高效高分辨率视觉-语言模型的FlexAttention

FlexAttention for Efficient High-Resolution Vision-Language Models

UMass Amherst(马萨诸塞大学阿默斯特分校);Princeton University(普林斯顿大学);South China University of Technology(华南理工大学);University of California, Los Angeles(加利福尼亚大学洛杉矶分校);MIT-IBM Watson AI Lab(麻省理工学院-IBM沃森人工智能实验室)

Junyan Li, Delin Chen, Tianle Cai, Peihao Chen, Yining Hong, Zhenfang Chen, Yikang Shen, Chuang Gan

AI总结:

提出FlexAttention灵活注意力机制,通过低分辨率token与少量选定高分辨率token迭代计算注意力图,在保持性能的同时显著降低高分辨率视觉-语言模型的计算成本。

摘要:

当前的高分辨率视觉-语言模型将图像编码为高分辨率图像token,并穷尽地使用所有这些token计算注意力,这显著增加了计算成本。为解决此问题,我们提出FlexAttention,一种用于高效高分辨率视觉-语言模型的灵活注意力机制。具体而言,高分辨率图像被同时编码为高分辨率token和低分辨率token,其中仅低分辨率token和少量选定的高分辨率token用于计算注意力图,这大幅缩减了计算成本。高分辨率token通过一个高分辨率选择模块进行选择,该模块可基于输入注意力图检索相关区域的token。选定的高分辨率token随后与低分辨率token和文本token拼接,并输入到一个分层自注意力层,该层产生可用于下一步高分辨率token选择的注意力图。分层自注意力过程和高分辨率token选择过程在每个注意力层中迭代执行。在多模态基准上的实验证明,我们的FlexAttention优于现有的高分辨率VLM(例如,在V* Bench上相对约9%,在TextVQA上约7%),同时将计算成本显著降低近40%。

英文摘要:

Current high-resolution vision-language models encode images as high-resolution image tokens and exhaustively take all these tokens to compute attention, which significantly increases the computational cost. To address this problem, we propose FlexAttention, a flexible attention mechanism for efficient high-resolution vision-language models. Specifically, a high-resolution image is encoded both as high-resolution tokens and low-resolution tokens, where only the low-resolution tokens and a few selected high-resolution tokens are utilized to calculate the attention map, which greatly shrinks the computational cost. The high-resolution tokens are selected via a high-resolution selection module which could retrieve tokens of relevant regions based on an input attention map. The selected high-resolution tokens are then concatenated to the low-resolution tokens and text tokens, and input to a hierarchical self-attention layer which produces an attention map that could be used for the next-step high-resolution token selection. The hierarchical self-attention process and high-resolution token selection process are performed iteratively for each attention layer. Experiments on multimodal benchmarks prove that our FlexAttention outperforms existing high-resolution VLMs (e.g., relatively ~9% in V* Bench, ~7% in TextVQA), while also significantly reducing the computational cost by nearly 40%.

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

↑