Introduction
Current Large Multimodal Models (LMMs), such as LLaVA, typically treat images as a long sequence of "visual words" fed into the input layer of a Large Language Model (LLM). While effective, this approach encounters a significant scaling wall: high-resolution images and videos generate thousands of tokens. Because the computational cost of the Transformer's self-attention mechanism grows quadratically with sequence length, feeding these long sequences directly into the LLM makes training and inference prohibitively expensive.
DeepStack introduces a remarkably simple yet powerful architectural shift. Instead of flattening all visual tokens into one long sequence, it "stacks" high-resolution visual features and injects them into intermediate transformer layers via residual connections. This allows models to process 4x to 5x more visual information without increasing computational context length or memory overhead.
The DeepStack Strategy
The core innovation of DeepStack is its "bottom-to-top" approach to token processing, contrasting with the traditional "left-to-right" concatenation.
Architectural Implementation
The model employs a dual-stream processing pipeline:
- Global Stream: A low-resolution "global" image is converted into tokens and fed into the LLM's input layer as usual.
- Detailed Stream: A high-resolution "detailed" image is processed, and its tokens are divided into groups.
- Layer-wise Injection: Instead of joining the input sequence, these high-resolution groups are added directly to the hidden states of the LLM’s intermediate layers (e.g., layers 4, 8, 12, etc.) using a simple residual connection ($H = H + X_{stack}$).
This strategy requires zero modifications to the underlying LLM architecture. It essentially "recycles" existing context length slots to carry more information as data moves deeper through the network. The authors applied this to both the language backbone (DeepStack-L) and the vision transformer encoder (DeepStack-V).
Evaluation and Key Results
DeepStack was evaluated using a robust suite of benchmarks, including general VQA (VQAv2, GQA), LMM-specific benchmarks (SEED, POPE, MMMU), and high-resolution text-oriented tasks (TextVQA, DocVQA, InfoVQA).
The results demonstrate that "simple is better" for scaling visual inputs:
- Performance Gains: DeepStack-L (7B and 13B) outperformed LLaVA-1.5 counterparts by an average of 2.7–2.9 points.
- High-Resolution Mastery: On tasks requiring fine-grained detail, improvements were substantial: +11.0 on DocVQA and +4.2 on TextVQA compared to LLaVA-1.5-7B.
- Efficiency: DeepStack achieved results comparable to state-of-the-art models like LLaVA-Next while using only one-fifth of the context length (576 vs 2880 tokens).
Key Insights
- LLMs as Visual Encoders: Early layers of an LLM are highly capable of processing raw visual features. By injecting features deeper, the model acts like a recurrent enhancer, refining its understanding at every stage.
- Spatial Consistency: The method of grouping high-resolution tokens is crucial. Using "2D Spatial" sampling (preserving neighboring pixels) significantly outperformed random grouping.
- Residuals are Sufficient: A simple addition ($+$) operation is enough to infuse new visual information into a running transformer hidden state, avoiding the need for complex cross-attention layers.
Limitations and Future Work
While effective, the current choice of injection layers and intervals is determined by manual ablation. Future research could explore learned "stacking schedules." Additionally, while basic residual addition works well, more sophisticated fusion methods like gated functions or layer-wise positional embeddings might further enhance the model's ability to distinguish between tokens injected at different depths.
Summary updated