FM-Mamba: An Efficient Native 2D Selective State Space Model with Stability-Aware Discretization

Shengyuan Hu, Yiyong Sun, Weihang Shan, Yongzhe ChangarXiv 2026 · arXiv

TL;DR

FM-Mamba introduces a native 2D selective state space model that processes images without flattening them into 1D sequences. By leveraging the Fornasini–Marchesini (FM) framework and a novel stability-aware discretization, it achieves significantly higher training efficiency and lower memory usage than existing Mamba-based vision models while maintaining competitive accuracy.

What Problem Does This Paper Address?

State Space Models (SSMs) like Mamba have gained popularity for their linear scaling with sequence length, offering a compelling alternative to the quadratic scaling of Transformers. However, adapting Mamba to 2D data like images presents a "structural mismatch."

Most current "Vision Mamba" methods solve this by flattening 2D grids into 1D sequences (e.g., raster or zigzag scans). This approach has three major drawbacks:

  1. Loss of Spatial Adjacency: Vertical neighbors in an image become distant in a 1D sequence.
  2. Computational Overhead: To compensate for the loss of structure, models often run multiple scans (e.g., four directions), multiplying the compute and memory requirements.
  3. Stability Issues: Direct 2D recurrences often lack a theoretical framework to ensure numerical stability, leading to "exploding" signals unless aggressive global damping is applied, which can hurt performance.

FM-Mamba tackles these by proposing a native 2D recurrence that respects the grid structure and incorporates 2D stability theory directly into the model's discretization step.

Methods

The authors build FM-Mamba on the General Fornasini–Marchesini (FM) model, a classic framework for 2D discrete systems.

Key technical innovations include:

  • Native 2D Recurrence: Unlike 1D Mamba, which only looks at one predecessor, FM-Mamba’s state update gathers information from three neighbors: horizontal, vertical, and diagonal. This preserves "multipath propagation"—the idea that information can reach a point through many different routes on a grid.
  • Anisotropic Selection: The model uses two independent, input-dependent step sizes ($\Delta_1, \Delta_2$) for the horizontal and vertical axes. This allows the model to adapt its "focus" differently in each direction based on the image content.
  • Stability-Aware Discretization: The authors derived a closed-form mathematical bound for these step sizes. If the input-dependent steps fall outside a "stable" range that could cause numerical overflow, they are projected back onto the boundary. This ensures local stability without needing the blunt "global scaling" used in previous 2D SSMs.
  • Dual-Diagonal Wavefront Scan: To make this computationally efficient, the authors use a parallel scan that processes the image along anti-diagonals (wavefronts). This allows for high parallelism on GPUs without ever flattening the feature map.
The dual-diagonal wavefront scan allows the model to process 2D dependencies in parallel along anti-diagonals.

Datasets

The model was evaluated on the COCO 2017 dataset for multi-label classification. The authors used a standard split (train2017 for training, val2017 for validation) and resized images to 224 × 224.

Key Insights and Ideas

  • The Diagonal Term Matters: The "diagonal predecessor" term ($\tilde{A}_0$) in the recurrence isn't just an extra parameter; it arises naturally from the cross-axis coupling of the horizontal and vertical dynamics during discretization. It significantly improves the model's ability to capture complex spatial relationships.
  • Single-Drive Injection: While many models use dual projections for horizontal and vertical paths, FM-Mamba uses a "single-drive" approach where the input enters the state through a single projection. This reduces the number of parameters and intermediate tensors, leading to massive memory savings.
  • Local vs. Global Stability: Instead of damping the entire signal globally (which can wash out features), FM-Mamba uses its "stability-aware" criteria to constrain the model only where and when it's needed, per-position and per-channel.

Key Results

FM-Mamba demonstrates a superior balance of efficiency and quality compared to both flattening-based (Vision Mamba, VMamba) and existing native 2D (Mamba2D) baselines:

  • Efficiency: Compared to Mamba2D, FM-Mamba reduces training time by up to 52.8%, peak memory by 42.1%, and training energy by 53.5%.
  • Throughput: In inference, FM-Mamba reaches 86.74 FPS (unoptimized), which jumps to a staggering 385.39 FPS with an optimized Per-Shape Dispatch (PSD) implementation.
  • Accuracy: Despite the efficiency gains, it remains highly competitive, staying within 0.12 percentage points of the mAP (mean Average Precision) of much heavier models.
Training loss vs. time shows FM-Mamba (right) converging much faster and more efficiently than flattening baselines (left).

Limitations and Future Work

While FM-Mamba excels at image-level classification, the authors note several areas for future exploration:

  • Dense Prediction: The current work focuses on classification. Extending this native 2D recurrence to tasks like object detection and semantic segmentation is a logical next step.
  • Higher Dimensions: The FM framework can theoretically be extended to 3D (video) or even higher-dimensional data.
  • Inference Optimization: While training is highly efficient, further work is needed to optimize inference for the specific "anisotropic" (direction-dependent) recurrence used here.

For more details, the code is available at https://github.com/BitSsm/FM-Mamba-Runtime.

Summary updated

Abstract

When applied to two-dimensional features such as images, Mamba-based methods either flatten the feature map into 1D sequences and fuse multiple scans, which breaks spatial adjacency and multiplies computation, or recurse directly on the 2D grid but rescale the recurrence with a fixed input-independent factor and aggregate only the predecessors on a single anti-diagonal, leaving the discrete step unconstrained by 2D stability theory. We propose \textbf{FM-Mamba}, a native 2D selective state space model built on the general Fornasini--Marchesini (FM) model. Its coupled recurrence evolves along both spatial axes; cross-axis coupling induces a discrete diagonal-predecessor term $\tilde A_0$, and two independent input-dependent step sizes $Δ_1(i,j)$, $Δ_2(i,j)$ govern propagation along the two axes, so that the coefficients adapt per position and per direction. A normalized ratio $r_k=a_{0,k}/(a_{1,k}a_{2,k})$ yields a closed-form piecewise bound on the two step sizes; when a configuration falls outside the stable interval the steps are projected onto this bound, and the criterion is re-verified per position after training, which suppresses systematic local amplification without global damping. The recurrence is executed by a dual-diagonal wavefront scan: each update gathers information from two anti-diagonals, and the input enters the current state through a single projection, so that neither training nor inference flattens the feature map. Code is available at https://github.com/BitSsm/FM-Mamba-Runtime
BibTeX
@misc{hu2026fm,
  author = {Shengyuan Hu and Yiyong Sun and Weihang Shan and Yongzhe Chang},
  title = {{FM-Mamba: An Efficient Native 2D Selective State Space Model with Stability-Aware Discretization}},
  year = {2026},
  eprint = {2611.22061},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.22061},
}
Figure