arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.01906cs.CV
收藏

D-Attn:面向大型视觉-语言模型的分解注意力

D-Attn: Decomposed Attention for Large Vision-and-Language Models

ByteDance Intelligent Creation(字节跳动智能创作)

Chia-Wen Kuo, Sijie Zhu, Fan Chen, Xiaohui Shen, Longyin Wen

AI总结:

本文提出D-Attn分解注意力架构,将LVLM的因果自注意力分解为视觉到视觉、文本到视觉和文本到文本注意力,并通过修正位置编码和对角化视觉注意力,在保持语言能力的同时提升视觉理解性能并大幅降低计算成本。

摘要:

大型视觉-语言模型(LVLMs)传统上通过将视觉和文本标记拼接成单一同质输入来集成到大语言模型(LLMs)中,从而最大限度地保留预训练的语言能力。然而,这种对视觉和文本标记的受限架构限制了视觉标记处理的设计空间,可能导致性能和效率欠佳。本文提出分解注意力(D-Attn),一种更灵活的LVLM注意力架构,能够在不影响文本到文本注意力的情况下修改视觉标记操作。D-Attn将LVLM的一维因果自注意力分解为视觉到视觉、文本到视觉和文本到文本注意力,并通过精心推导的加权策略,即α加权,合并分解注意力产生的视觉和文本输出标记。利用这种灵活性,我们在保持预训练LLM能力的同时,对视觉标记处理引入两项关键改进:1)修正文本到视觉注意力中的有偏位置编码,以提升视觉理解性能;2)将视觉到视觉注意力对角化,在不牺牲性能的情况下,将|V|个视觉标记的计算复杂度从O(|V|^2)降至O(|V|)。大量实验和分析验证了D-Attn的有效性,在多个图像基准上表现出显著改进,同时大幅降低计算成本(例如,加速5倍)。代码将发布于https://github.com/bytedance/DecomposedAttention。

英文摘要:

Large vision-and-language models (LVLMs) have traditionally integrated visual and textual tokens by concatenating them into a single homogeneous input for large language models (LLMs), thereby maximally preserving the pre-trained language capabilities. However, this constrained architecture for visual and textual tokens restricts the design space for processing visual tokens, potentially leading to suboptimal performance and efficiency. In this paper, we propose Decomposed Attention (D-Attn), a more flexible attention architecture for LVLMs, which enables modification of visual token operations without affecting textual-to-textual attention. D-Attn decomposes the 1-D causal self-attention of LVLMs into visual-to-visual, textual-to-visual, and textual-to-textual attentions, and the visual and textual output tokens from the decomposed attentions are merged with a carefully derived weighting strategy, namely $α$-weighting. Taking advantage of the flexibility, we are able to introduce two critical improvements in visual token processing while maintaining the capacity of pre-trained LLMs: 1) We rectify the biased positional encoding in textual-to-visual attention to boost visual understanding performance. 2) We diagonalize visual-to-visual attention to reduce computation complexity from $O(|V|^2)$ to $O(|V|)$ for $|V|$ visual tokens without compromising performance. Extensive experiments and analysis validate the effectiveness of D-Attn, demonstrating significant improvements on multiple image benchmarks while significantly reducing computational costs (\eg, $5\times$ faster). Code will be available at https://github.com/bytedance/DecomposedAttention.

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

↑