Skip to main content
QUICK REVIEW

[Paper Review] Mamba-ND: Selective State Space Modeling for Multi-Dimensional Data

Shufan Li, Harkanwar Singh|arXiv (Cornell University)|Feb 8, 2024
Neural Networks and ApplicationsComputer Science4 citations
TL;DR

Mamba-ND extends the Mamba state space model to multi-dimensional data by alternating sequence ordering across layers in row-major orderings, achieving state-of-the-art performance on image, video, and weather forecasting tasks with significantly fewer parameters and linear complexity, outperforming Transformers like ViT and Swin-Transformer while reducing model size by up to 44.5%.

ABSTRACT

In recent years, Transformers have become the de-facto architecture for sequence modeling on text and a variety of multi-dimensional data, such as images and video. However, the use of self-attention layers in a Transformer incurs prohibitive compute and memory complexity that scales quadratically w.r.t. the sequence length. A recent architecture, Mamba, based on state space models has been shown to achieve comparable performance for modeling text sequences, while scaling linearly with the sequence length. In this work, we present Mamba-ND, a generalized design extending the Mamba architecture to arbitrary multi-dimensional data. Our design alternatively unravels the input data across different dimensions following row-major orderings. We provide a systematic comparison of Mamba-ND with several other alternatives, based on prior multi-dimensional extensions such as Bi-directional LSTMs and S4ND. Empirically, we show that Mamba-ND demonstrates performance competitive with the state-of-the-art on a variety of multi-dimensional benchmarks, including ImageNet-1K classification, HMDB-51 action recognition, and ERA5 weather forecasting.

Motivation & Objective

  • To extend the Mamba state space model, originally designed for 1D sequences, to multi-dimensional data such as images, video, and scientific datasets.
  • To address the challenge of sequential processing in Mamba, which requires a specific data ordering, when applied to multi-dimensional inputs.
  • To evaluate and compare various multi-dimensional extensions of SSMs, including bi-directional, N-directional, and multi-head designs.
  • To identify the most effective and efficient architecture for extending 1D SSMs to higher dimensions without introducing complex factorizations or architectures.
  • To demonstrate that a simple, alternating ordering strategy across layers can surpass complex multi-directional designs in performance and efficiency.

Proposed method

  • Mamba-ND applies 1D Mamba layers as black-box components, processing flattened multi-dimensional data in alternating row-major orderings across consecutive layers.
  • The model alternates the sequence ordering between layers—e.g., row-major, column-major, and diagonal-like orderings—to enable multi-directional information flow without modifying the underlying SSM mechanism.
  • It maintains linear complexity with respect to sequence length by leveraging the selective state space mechanism of Mamba, avoiding the quadratic complexity of self-attention.
  • The architecture does not require factorization or specialized 2D/3D SSM layers; instead, it relies on reordering the input data before each 1D SSM layer.
  • It uses a block-level design where each block applies a different ordering, enabling the model to capture spatial and temporal dependencies across multiple directions.
  • The method is agnostic to input dimensionality and generalizes to 2D (images), 3D (video), and even 4D (weather data) by treating the data as a sequence of patches.
Figure 1: Mamba-ND outperforms Transformers while significantly reducing the number of parameters. On ImageNet-1k, we compare against ViT [ 12 ] . On HMDB-51 [ 22 ] , we compare against Video-Swin [ 28 ] . On ERA5, we compare against Cli-ViT [ 34 ] .
Figure 1: Mamba-ND outperforms Transformers while significantly reducing the number of parameters. On ImageNet-1k, we compare against ViT [ 12 ] . On HMDB-51 [ 22 ] , we compare against Video-Swin [ 28 ] . On ERA5, we compare against Cli-ViT [ 34 ] .

Experimental results

Research questions

  • RQ1Can the Mamba architecture, originally designed for 1D text sequences, be effectively extended to multi-dimensional data such as images and video?
  • RQ2Does a simple alternating sequence ordering strategy across layers outperform more complex multi-directional or multi-head SSM designs in modeling multi-dimensional data?
  • RQ3How does the effective receptive field of Mamba-ND compare to uni-directional and bi-directional baselines in capturing spatial and temporal dependencies?
  • RQ4What is the impact of architectural choices such as factorization, layer ordering, and depth on performance and parameter efficiency?
  • RQ5Does a minimal modification—merely reordering input sequences between layers—yield competitive performance compared to state-of-the-art Transformers?

Key findings

  • On ImageNet-1K, Mamba-ND achieves 1.5% higher top-1 accuracy than ViT while reducing the number of parameters by 20.7%.
  • On the HMDB-51 action recognition benchmark, Mamba-ND achieves 0.9% higher accuracy than the 3D Swin-Transformer while reducing parameters by 39.0%.
  • On the ERA5 72-hour weather forecasting task, Mamba-ND achieves a 0.7-point gain in Anomaly Correlation Coefficient (ACC) compared to Cli-ViT, with a 44.5% reduction in parameters.
  • The alternating row-major ordering strategy outperforms more complex designs such as 2D+3D factorization, multi-head SSM, and bi-directional SSM, despite their increased complexity.
  • The effective receptive field visualization shows that Mamba-ND achieves a more uniform and global sensitivity pattern than uni-directional or bi-directional models, explaining its superior performance.
  • Ablation studies confirm that simpler designs, such as alternating ordering, are more effective than deeper or wider multi-directional architectures, supporting the importance of depth over width in SSMs.
Figure 2: Architecture of Mamba-ND: In this figure we visualize Mamba-3D. Given 3D input data, we patchify it into $L$ patches. During this process, we maintain the original 3D structure of the input. This sequence is then passed through $K$ Mamba-ND blocks, each of which consists of a chain of 1-D
Figure 2: Architecture of Mamba-ND: In this figure we visualize Mamba-3D. Given 3D input data, we patchify it into $L$ patches. During this process, we maintain the original 3D structure of the input. This sequence is then passed through $K$ Mamba-ND blocks, each of which consists of a chain of 1-D

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.