Shaking Up VLMs: Comparing Transformers and Structured State Space Models for Vision & Language Modeling

Georgios Pantazopoulos, Malvina Nikandrou, Alessandro Suglia, Oliver Lemon, Arash Eshghi

Presented at EMNLP 2024, this research provides a rigorous comparison between the ubiquitous Transformer architecture and the rising star of sequence modeling: Mamba, a Structured State Space Model (SSM). As Vision-Language Models (VLMs) scale toward higher resolutions and longer contexts, the quadratic complexity of Transformers becomes a significant computational bottleneck. This study investigates whether Mamba can serve as a more efficient, yet equally capable, multimodal backbone.

Architecture and Methodology

To ensure a fair comparison, the researchers developed Mamba-VL and a Transformer-based baseline, Pythia-VL, across three scales: 800M, 1.4B, and 2.8B parameters. Both models utilize a frozen EVA-02 vision encoder and a two-layer MLP connector, with the only variable being the language backbone.

A unique challenge for Mamba is its lack of inherent positional embeddings. To address this, the authors introduced custom separator tokens: ## to mark the start and end of an image sequence, and && to mark the end of each row of image patches. This allows the model to maintain spatial awareness within its linear state updates.

Architecture of the Mamba-VL model, highlighting the integration of vision and language components with custom separator tokens (## and &&) to handle spatial information.

The Grounding Bottleneck: Summarization vs. Retrieval

The study's most significant finding is a fundamental trade-off: Mamba is an excellent "summarizer" but a poor "retriever" compared to Transformers. Mamba excels at tasks where the answer depends on a global summary of the image, such as general captioning or high-level visual QA. However, it struggles significantly with visual grounding tasks that require localizing specific objects within a scene.

Visual grounding task example where the model must process image patches to localize specific elements, a task where Mamba-based models struggle compared to Transformers.

This limitation stems from a "task-agnostic" bottleneck. In standard VLM configurations, image tokens are processed before the text instruction. Because Mamba updates its hidden state linearly, it must compress the entire image into a fixed-size state before it even "knows" what the specific task or object of interest is. Synthetic tests revealed that Transformers learn to retrieve tokens from a sequence nearly 10x faster than Mamba, and this performance gap actually widens as models scale up.

Key Results and Performance Metrics

  • Mamba Wins on "Coarse" Tasks: Mamba-VL consistently outperformed Pythia-VL in Image Captioning and General VQA. At the 2.8B scale, Mamba achieved a superior captioning score (237.53 vs. 236.24).
  • Dominance in Reading Comprehension: Mamba showed a significant lead in text-heavy visual tasks (e.g., TextVQA, AI2D), suggesting it is more effective at maintaining extracted textual information within its hidden state.
  • Transformers Lead in Grounding: Pythia-VL consistently beat Mamba-VL in visual grounding benchmarks like RefCOCO and GRIT. For the 2.8B models, Pythia scored 453.07 on the grounding sum, while Mamba trailed at 423.61.
  • Resolution Sensitivity: While both architectures benefit from higher resolutions (e.g., 480x480), Transformers experience a much larger performance boost in grounding tasks than Mamba.

Conclusion and Future Directions

The research concludes that purely SSM-based VLMs may be structurally limited for fine-grained visual tasks. While Mamba offers impressive efficiency and summarization capabilities, it lacks the robust associative recall of the Transformer's attention mechanism.

Future work is expected to focus on hybrid architectures (such as Jamba) that interleave Mamba blocks with Attention layers. This approach aims to combine Mamba's linear scaling and efficient summarization with the Transformer’s superior retrieval and grounding capabilities, potentially creating a more balanced and scalable multimodal backbone.

Summary updated

BibTeX
@inproceedings{pantazopoulos2024shaking,
  author = {Georgios Pantazopoulos and Malvina Nikandrou and Alessandro Suglia and Oliver Lemon and Arash Eshghi},
  title = {{Shaking Up VLMs: Comparing Transformers and Structured State Space Models for Vision \& Language Modeling}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.793},
}
Figure