Abstract
Modern Large Vision-and-Language Models (LVLMs) typically treat visual and textual tokens as a homogeneous sequence. However, this "early fusion" approach introduces significant positional biases and computational inefficiencies. We present Decomposed Attention (D-Attn), an architecture that treats these modalities differently. By diagonalizing visual-to-visual attention and debiasing positional encodings, D-Attn achieves a 5x speedup and supports 8x more visual tokens while improving performance across standard vision-language benchmarks.
Introduction
The standard paradigm for LVLMs, such as LLaVA, involves flattening 2D images into 1D token sequences to leverage the reasoning power of pre-trained Large Language Models (LLMs). Despite its success, this method suffers from two critical flaws. First, 1D positional encodings (like RoPE) create a "spatial distance" bias where text tokens incorrectly perceive different parts of an image as being at varying distances. Second, visual tokens, which are already highly contextualized by vision encoders (e.g., CLIP), are subjected to redundant $O(N^2)$ self-attention within the LLM, leading to massive computational overhead.
The D-Attn Architecture
To address these issues, we propose Decomposed Attention (D-Attn). This method mathematically splits the standard causal self-attention mechanism into three distinct paths: Visual-to-Visual (V2V), Textual-to-Visual (T2V), and Textual-to-Textual (T2T).
Key Innovations:
- V2V Diagonalization: Since visual tokens arrive at the LLM already "smart" from the vision encoder, D-Attn diagonalizes the V2V matrix. Visual tokens only attend to themselves within the LLM layers, reducing complexity from $O(|V|^2)$ to $O(|V|)$.
- Debiased Positional Encoding: In the T2V path, we assign a uniform position index to all visual tokens. This ensures text tokens view the entire image globally, eliminating the flawed 1D "ruler" bias inherent in standard LLMs.
- Seamless Integration: A specific $\alpha$-weighting strategy ensures that these decomposed paths can be merged without disrupting the pre-trained LLM's logic, requiring no heavy additional modules.
Key Results and Efficiency
We evaluated D-Attn across 10 benchmarks using Mistral 7B and Gemma 2 9B backbones. The results demonstrate that D-Attn consistently outperforms standard self-attention (S-Attn) while being significantly more efficient.
Performance Highlights:
- Scalability: D-Attn allows for processing up to 74k visual tokens on hardware that previously capped out at 9k, representing an 8x increase in capacity.
- Benchmark Gains: On the MME benchmark, the Mistral 7B variant improved from 1533.1 to 1598.6.
- Qualitative Accuracy: The model exhibits superior fine-grained recognition, correctly distinguishing between similar activities like snowboarding and skiing in complex scenes where standard models often generalize incorrectly.
Conclusion
D-Attn demonstrates that visual and textual tokens should not be treated identically within LVLMs. By acknowledging the pre-contextualized nature of visual tokens and fixing positional biases, we can build models that are both more powerful and significantly more efficient, paving the way for high-resolution image and long-form video understanding.
Summary updated