FM-Mamba: An Efficient Native 2D Selective State Space Model with Stability-Aware Discretization
Organizations: School of Computer Science, Beijing Institute of Technology, Beijing, China · School of Aerospace Engineering, Beijing Institute of Technology, Beijing, China · Shenzhen International Graduate School, Tsinghua University, Shenzhen, China
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 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 , and two independent input-dependent step sizes , govern propagation along the two axes, so that the coefficients adapt per position and per direction. A normalized ratio 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
Figures & tables
| Condition | Step constraint | ||
|---|---|---|---|
| none | |||
| none | |||
| Training cost | Validation quality | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Architecture | Condition | Params (M) | Time/ epoch (s) | Total (h) | Peak mem. (GiB) | GPU energy (kWh) | Best epoch | mAP (%) | micro-F1 (%) | macro-F1 (%) | Val. BCE |
| Vision Mamba [ 29 ] | – | 24.720 | 252.53 | 2.806 | 14.63 | 1.545 | 20 | 51.260 | 57.176 | 46.372 | 0.0807 |
| VMamba [ 17 ] | – | 24.365 | 205.87 | 2.287 | 9.76 | 1.097 | 17 | 51.366 | 56.654 | 44.310 | 0.0782 |
| 2DMamba [ 27 ] | – | 24.365 | 197.91 | 2.199 | 9.85 | 1.096 | 17 | 51.433 | 56.351 | 44.067 | 0.0781 |
| [ 3 ] | – | 24.638 | 497.98 | 5.533 | 21.99 | 2.892 | 22 | 52.034 | 58.293 | 48.151 | 0.0807 |
| – | 22.063 | 694.18 | 7.713 | 25.03 | 4.081 | 34 | 52.581 | 58.550 | 48.617 | 0.0847 | |
| Architecture | Condition | mAP (%) | micro-F1 (%) | macro-F1 (%) | micro-P (%) | micro-R (%) | FPS | Compute (GFLOPs/img) | Peak mem. (MiB) |
|---|---|---|---|---|---|---|---|---|---|
| Vision Mamba [ 29 ] | – | 51.281 | 57.647 | 46.870 | 71.092 | 48.479 | 72.96 | 9.094 | 125.32 |
| VMamba [ 17 ] | – | 50.748 | 56.938 | 44.257 | 72.947 | 46.692 | 63.71 | 7.864 | 123.85 |
| 2DMamba [ 27 ] | – | 50.832 | 56.970 | 44.219 | 73.140 | 46.655 | 74.09 | 7.871 | 123.85 |
| [ 3 ] | – | 52.517 | 58.685 | 48.409 | 71.257 | 49.884 | 53.76 | 8.700 | 137.88 |
| – | 52.289 | 59.065 | 48.814 | 70.418 | 50.864 | 64.15 | 7.686 | 126.67 | |
| 52.395 | 58.614 | 48.320 | 71.443 | 49.692 | 64.45 | 8.775 | 126.48 |
Selective SSMs
Selective state-space models (SSMs) use input-dependent recurrent dynamics to filter sequence information with linear-time scans.
See all 82 papers