MambaOut: Do We Really Need Mamba for Vision?
Weihao Yu, Xinchao Wang
TL;DR
Problem: whether Mamba's SSM-based token mixer is necessary for vision tasks. Approach: analyze memory mechanisms and token-mixing modes, classify visual tasks by long-sequence and autoregressive properties, and test the idea by constructing MambaOut—Gated CNN blocks without SSM—evaluated on ImageNet, COCO, and ADE20K. Findings: ImageNet classification benefits from MambaOut, supporting that SSM is unnecessary for that task, while long-sequence detection/segmentation tasks show mixed results and still allow benefits from SSM-based Mamba models; the results validate the proposed hypotheses. Implications: MambaOut provides a simple, strong baseline for vision tasks, clarifies when Mamba is advantageous, and invites future exploration of Mamba's role in long-sequence vision tasks and LLM/LMM architectures.
Abstract
Mamba, an architecture with RNN-like token mixer of state space model (SSM), was recently introduced to address the quadratic complexity of the attention mechanism and subsequently applied to vision tasks. Nevertheless, the performance of Mamba for vision is often underwhelming when compared with convolutional and attention-based models. In this paper, we delve into the essence of Mamba, and conceptually conclude that Mamba is ideally suited for tasks with long-sequence and autoregressive characteristics. For vision tasks, as image classification does not align with either characteristic, we hypothesize that Mamba is not necessary for this task; Detection and segmentation tasks are also not autoregressive, yet they adhere to the long-sequence characteristic, so we believe it is still worthwhile to explore Mamba's potential for these tasks. To empirically verify our hypotheses, we construct a series of models named MambaOut through stacking Mamba blocks while removing their core token mixer, SSM. Experimental results strongly support our hypotheses. Specifically, our MambaOut model surpasses all visual Mamba models on ImageNet image classification, indicating that Mamba is indeed unnecessary for this task. As for detection and segmentation, MambaOut cannot match the performance of state-of-the-art visual Mamba models, demonstrating the potential of Mamba for long-sequence visual tasks. The code is available at https://github.com/yuweihao/MambaOut
