arXiv:2502.01906cs.CV2025-02ICCV被引 1

提出D-Attn分解注意力机制,提升视觉语言模型效率与性能

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

  • 将注意力拆分为视觉-视觉、文本-视觉等三类,解耦处理
  • 视觉自注意复杂度从O(|V|²)降至O(|V|),提速5倍且不降性能
  • 适合追求高效视觉语言模型的开发者与研究者

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

原文摘要 · Abstract (English)

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.

视觉语言模型注意力机制高效计算模型优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。