wikillm

Concept · 11 papers · updated 2026-10-25

State-space model (SSM)

A state-space model carries a fixed-size state through a sequence, so cost grows linearly with length. Covered: selective scans (Mamba), diagonal S5, 2D image scans, hybrid backbones, scalar-decay SSD (Mamba-2), video, LiDAR occupancy (OccMamba) and robot control (LocoMamba). xLSTM is a recurrent neighbour, not an SSM. Numbers are author-reported.

sequence-modellinear-costimage-restorationimage-classificationvideo-understandinghybrid-architecturelanguage-modellinglong-range-sequencesarchitecture-searchrobot-locomotionreinforcement-learning3d-occupancy

Markdown28 min read

AI-compiled overview, updated 2026-10-25, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.

Overview

A state-space model (SSM) keeps a hidden state h that is updated from each input and read out as an output. The continuous form is h'(t) = A h(t) + B x(t) and y(t) = C h(t) + D x(t), with a state of size N 2402.15648 §3.1 2402.15648 eq. 1. After discretisation, the same map is a recurrence over a sequence, h_k = Ā h_{k-1} + B̄ x_k, which costs one update per token 2402.15648 eq. 3. The shared invariant is that the memory has a fixed size, so the cost grows linearly with sequence length, not quadratically as in full self-attention 2402.15648 §1 2407.08083 §1 2405.21060 §1.

Mamba-style "selective" SSMs make B̄, C and the step size Δ depend on the input, which lets the model decide what to keep in its state 2402.15648 §3.1 2312.00752 §3.2. Mamba (Mamba-1) introduced this for sequence modelling, and the Mamba-2 paper narrows the state transition to one scalar decay per head. Under that restriction the recurrence and a masked attention-like matrix are two forms of the same map 2405.21060 §5.3 (see the scalar-decay variant below).

Not every variant is selective. S5 keeps fixed parameters per layer and gets its long-range results from a diagonal state and a parallel scan 2208.04933 §3.2. The variants below share the core above but differ in how the state transition is chosen, how a 2D image or a video is fed to a sequence model, and how a sequence model is combined with attention. Outside vision and language, one variant uses the same block for LiDAR occupancy in a navigation stack 2408.10618 §3.1, and another fuses sensor tokens inside a reinforcement-learning policy 2508.11849 §3.2.

A common complaint is that a sequential scan sees pixels in one order and so has limited access to global context. The image papers argue this and answer it differently: MambaIR scans four directions, MambaVision mixes scan blocks with attention, and LocalMamba keeps small windows contiguous and searches over eight scan directions per layer 2402.15648 §1 2407.08083 §1 2403.09338 §4.1 2403.09338 §4.2. VideoMamba orders the spatiotemporal tokens and runs each block in both directions 2403.06977 §3.2.

xLSTM (see its variant below) is not a state-space model. It is included because it is a recurrent model with a fixed-size state that the authors compare against Mamba in their own tables 2405.04517 tab. 1.

VMamba (arXiv:2401.10166) has no card here, so nothing from it is used on this page.

Variants

Input-dependent selection with a fused scan (Mamba-1)

Mamba makes the step size Δ, the input matrix B and the output matrix C functions of each token, and keeps A fixed 2312.00752 §3.2. This lets the model keep or drop each input. The authors report 99.8% on Selective Copying, where the positions of the tokens to keep vary, against 18.3% for S4 2312.00752 §4.1. Making the parameters input-dependent removes the convolution form that made earlier models efficient, so the authors write a fused GPU kernel. It discretises, scans in fast on-chip memory and recomputes the intermediate states in the backward pass 2312.00752 §3.3, app. D. The block is repeated with no separate attention or MLP, and its SSM branch goes through a short causal convolution 2312.00752 §3.4, app. E.2.2.

Author-reported zero-shot results: Mamba-1.4B averages 59.7 on the paper's six tasks, against 55.2 for Pythia-1.4B, and only compares with models that share its tokenizer and data 2312.00752 §4.2.2. Inference throughput is reported at 4 to 5 times that of a Transformer of similar size 2312.00752 §4.5.

Selection does not help raw audio. On YouTubeMix, the selective layer is worse than the fixed one in every block, and the authors use the fixed layer near the signal and the selective one only for discrete tokens such as text and DNA 2312.00752 app. E.4.1 2312.00752 §5.

The paper's discretisation of B̄ (eq. 4) is not what the released kernel computes, so an implementation has to pick one 2312.00752 eq. 4 selective_scan_interface.py. Card: Mamba: Linear-Time Sequence Modeling with Selective State Spaces.

Diagonal MIMO layer with a parallel scan (S5)

S5 replaces S4's bank of single-input, single-output SSMs with one multi-input, multi-output SSM of latent size P 2208.04933 §3.1. The continuous matrix is diagonalised, each diagonal mode gets a learnable timescale Δ, and zero-order hold discretises the result 2208.04933 §3.2 2208.04933 eq. 6. The diagonal recurrence runs in the time domain as a parallel scan, so it needs no frequency-domain kernel. The paper says its cost matches S4's when the state size is on the order of the feature size 2208.04933 §3.4. The eigenvalues start from a diagonalised HiPPO-N matrix with real part −½ 2208.04933 app. B.1.1.

Author-reported results: the LRA average is 87.46%, against 86.09% for S4-LegS, and Path-X reaches 98.58% against 96.35% 2208.04933 tab. 1. On 8 kHz speech, zero-shot from a 16 kHz model, it reports 94.53% against 91.32% for S4-LegS 2208.04933 tab. 2. On pendulum regression with irregular samples it reports an MSE of 3.41 × 10⁻³ against 3.94 for its own re-run of CRU, and about 86 times the speed per the same table 2208.04933 tab. 3. The LRA-Image score is lower than S4-LegS (88.00 against 88.65) [arxiv:2208.04933 tab. 1].

Irregular sampling changes Δ for each step, from the time gaps, not from the content 2208.04933 §3.3. The card does not compare S5 with Mamba on any task, so the two should not be ranked from this page.

Card: Simplified State Space Layers for Sequence Modeling.

2D selective scan for image restoration (MambaIR)

Images are two-dimensional, but an SSM reads a sequence. MambaIR flattens the feature map into four 1D sequences: rows top-to-bottom, columns left-to-right, and the reverse of each. It runs a selective scan on each one and sums the four outputs back into the 2D map 2402.15648 §3.5 [arxiv:2402.15648 fig. 2c]. The code gives each direction its own Δ, B and C projections and its own A and D parameters mambair_arch.py. The paper describes the four directions as corner-to-corner; the code's order differs (2402.15648 §3.5 versus mambair_arch.py).

The scan sits inside a residual block that also has a convolution bottleneck and channel attention. The block adds learnable per-channel scaled skips 2402.15648 §3.3 2402.15648 eq. 5 2402.15648 eq. 6. Card: MambaIR: A Simple Baseline for Image Restoration with State-Space Model.

Author-reported results on Set5, Set14, Urban100 and Manga109 show MambaIR above SwinIR at ×2, ×3 and ×4 classic SR 2402.15648 tab. 3. For example, at ×2 on Urban100 it reports 34.15 dB against 33.81 dB for SwinIR. On Gaussian colour denoising it leads SwinIR at all three noise levels on BSD68, Kodak24, McMaster and Urban100 2402.15648 tab. 5. On real denoising, it lands within 0.2 dB of Restormer on SIDD and DND 2402.15648 tab. 6.

Windowed scan with per-layer direction search (LocalMamba)

A flat row-by-row scan puts vertically adjacent patches far apart in the sequence. LocalMamba adds a local scan that reads each w × w window in full before moving to the next, with w = 2 and w = 7 in its search space 2403.09338 §4.1 2403.09338 §4.2. Each block runs four branches: a horizontal global scan, its flip, the local scan and its flip. Each branch has its own selective SSM, is unscanned, reweighted by channel attention, and the branches are summed 2403.09338 §4.1 2403.09338 fig. 3a. Scanning only reorders tokens, so the paper reports no added FLOPs 2403.09338 §4.3.

Which directions suit a layer is searched rather than fixed. The candidates are horizontal and vertical scans, each with its flip, plus the two local scans with their flips. A softmax over learnable per-layer weights mixes them in a supernet, and afterwards the four highest-probability directions are kept for each layer 2403.09338 §4.2 2403.09338 eq. 5. The paper reports 28 GB of memory for the search supernet at 20 blocks 2403.09338 §4.2. The searched layouts are reported in the paper as local scans at the first and last layers and global scans in the middle for LocalVim; this is an observation, with no quantitative analysis 2403.09338 §5.5 2403.09338 fig. 4.

Author-reported ImageNet-1K top-1: LocalVim-T reaches 76.2% at 1.5G FLOPs, against 73.1% for Vim-Ti, and LocalVMamba-T reaches 82.7% against 82.2% for VMamba-T 2403.09338 tab. 2. The fixed-direction LocalVim-T* without search reaches 75.8%, and removing the channel attention drops it to 75.2% 2403.09338 tab. 5. On COCO with Mask R-CNN at 1×, LocalVMamba-T scores 46.7 box AP against 46.5 for VMamba-T, and on ADE20K with UperNet it scores 47.9 mIoU in single-scale against 47.3 2403.09338 tab. 3 2403.09338 tab. 4. Those gains over VMamba-T are between 0.2 and 0.6 points.

Card: LocalMamba: Visual State Space Model with Windowed Selective Scan.

Hybrid Mamba-attention backbone (MambaVision)

MambaVision is a hierarchical image backbone with four stages 2407.08083 §3.1. The first two stages are plain residual convolution blocks. The last two are windowed layers, and inside them the first half of the layers use a Mamba-style mixer while the second half use multi-head self-attention 2407.08083 §3.2.2. Its ablation finds that this placement (Mamba first, attention last) beats the other arrangements tested, reaching 82.3% top-1 against 81.3% for a random placement 2407.08083 tab. 5.

The mixer is the part to get right. It replaces Mamba's causal convolution with an ordinary convolution, because a causal one only lets information flow in one direction 2407.08083 §3.2.2. It also adds a second, non-scan branch made of one convolution and a SiLU activation. Both branches are projected to half the channels, concatenated, and projected back 2407.08083 eq. 7. The ablation in 2407.08083 tab. 4 compares the causal-convolution baseline (80.5% top-1), a convolution-only mixer (80.9%), a gated combination (81.3%) and the final concatenation (82.3%).

Author-reported ImageNet-1K results, at 224 input unless noted, put the Tiny model (31.8M parameters) at 82.3% top-1 and 6298 img/s on one A100 at batch 128. For comparison the same table lists ConvNeXt-T at 82.0% and 3196 img/s, and Swin-T at 81.3% and 2758 img/s 2407.08083 tab. 1. The largest model, L2 (241.5M parameters), reaches 85.3% at 1021 img/s 2407.08083 tab. 1. The table also lists VMamba-T at 82.6% and 1282 img/s; those numbers are the MambaVision authors' table, not VMamba's paper. Dense tasks follow the same pattern: with Cascade Mask R-CNN on COCO, MambaVision-T reports 51.1 box AP against 50.4 for Swin-T and ConvNeXt-T 2407.08083 tab. 2, and with UperNet on ADE20K it reports 46.0 mIoU against 44.5 for Swin-T 2407.08083 tab. 3. With ImageNet-21K pre-training, the paper reports 86.1% for L at 224 2407.08083 §5.3.

Card: MambaVision: A Hybrid Mamba-Transformer Vision Backbone.

Scalar-decay SSM as masked attention (SSD, Mamba-2)

If each state transition is a single scalar times the identity, the SSM's whole input-to-output map is a lower-triangular matrix. That matrix is a product of a 1-semiseparable mask, built from cumulative products of the scalars, with the matrix C Bᵀ 2405.21060 §5.1. Read this way, C plays the role of queries, B of keys and the input X of values, so the layer is masked linear attention with a decay mask 2405.21060 §5.3. The two forms, recurrent and quadratic, are exact duals in this case 2405.21060 §5.3.

The paper's algorithm, called SSD, exploits the duality for speed. It splits the sequence into chunks of length Q and handles each part with the form that suits it 2405.21060 §6:

  • inside a chunk, the quadratic form, with a zero starting state;
  • the state at the end of each chunk, as one batched matrix product;
  • a short scalar recurrence across the chunk states, which gives the true state at each chunk boundary;
  • the effect of that carried-in state on each chunk's outputs, again as one batched product.

The authors state training cost of O(TN²) FLOPs and O(TN) memory when the head size and chunk length both equal N 2405.21060 §6, theorem 6.1. The paper's listing of the full layer is in 2405.21060 §6, listing 1.

The Mamba-2 block built on SSD computes the gate, the SSM inputs and the step sizes from one projection at the start. It adds one extra normalisation layer before the output projection, following NormFormer 2405.21060 §7.1. The paper's head-pattern ablation favours the head sharing that Mamba uses 2405.21060 tab. 5. The authors describe the block's A as a single scalar per head, which is the restriction that makes SSD possible. SSD does not cover Mamba's per-channel diagonal A 2405.21060 §5 [arxiv:2405.21060 §7.2].

Author-reported results: SSD is 2 to 8 times faster than Mamba's fused scan at state size 64, and faster than FlashAttention-2 from sequence length 2K, about 6 times faster at 16K 2405.21060 fig. 10 2405.21060 §9.3. On seven zero-shot tasks, Mamba-2-2.7B averages 60.2 against 59.9 for the Mamba-1 2.8B model in the same table 2405.21060 tab. 1. Adding six attention layers to a 2.7B Mamba-2 model gives Pile perplexity 5.95, against 6.09 for pure Mamba-2 and 6.13 for Transformer++ 2405.21060 tab. 3. These hybrid comparisons are single runs with no repeats 2405.21060 tab. 3.

Card: Transformers are SSMs.

Hybrid Mamba-2 and attention LLM with MoE (Nemotron 3 Super)

Nemotron 3 Super is a 120.6B-total, 12.7B-active language model. Mamba-2 blocks are paired with mixture-of-experts layers, and a limited number of attention layers act as global anchors 2604.12374 §2.1.3 [arxiv:2604.12374 tab. 1]. The paper does not give the number or positions of the attention layers in the text; they appear only in the layer-pattern figure 2604.12374 fig. 2. The Mamba blocks use a state dimension of 128, 8 groups and 128 heads of size 64 2604.12374 tab. 1.

The SSM state is the cache that matters for decoding. In the paper's quantization study, reads of this cache from DRAM became the bottleneck, and the default cache is FP32 2604.12374 §4.3. Storing it in plain FP16 added 37 to 40% verbosity with BF16 or W8A8 weights, traced to round-to-nearest bias accumulating through the recurrence. Stochastic rounding with 5 Philox rounds brought the increase back to within about 2% of the FP32 baseline 2604.12374 §4.3 2604.12374 tab. 9. The paper says the stochastic rounding is supported in hardware on Blackwell GPUs, so it should not be assumed on other hardware 2604.12374 §4.3. The FP8 checkpoint stores the cache in FP16 while the Mamba GEMMs are FP8 2604.12374 tab. 6.

Author-reported throughput is 2.2 times that of GPT-OSS-120B and 7.5 times that of Qwen3.5-122B at 8k input and 64k output 2604.12374 §1 [arxiv:2604.12374 fig. 1]. The precisions and serving stacks differ per model, so the paper's comparison is not like-for-like 2604.12374 fig. 1.

Card: Nemotron 3 Super: Open, Efficient Mixture-of-Experts Hybrid Mamba-Transformer Model for Agentic Reasoning.

Bidirectional 3D scan for video (VideoMamba)

VideoMamba keeps the ViT layout. A 3D convolution with kernel and stride (1, 16, 16) turns a clip into non-overlapping spatiotemporal tokens, and a stack of blocks processes them with no downsampling 2403.06977 §3.2 2403.06977 eq. 7. Each block runs a selective scan forward and a second one on the reversed sequence, then adds the two outputs 2403.06977 §3.1. The authors state that the cost grows linearly with clip length 2403.06977 §3.2.

The token order is the main design choice. The paper compares several 3D scan orders, including spatial-first, temporal-first and hybrid forms. On Something-Something V2 the spatial-first bidirectional scan scores 65.1%, against 62.4% for temporal-first and 64.2% for the hybrid v2 order 2403.06977 fig. 7. Larger pure Mamba models overfit in the authors' experiments. They add self-distillation from a smaller trained VideoMamba, with an L2 loss on the final features added to the classification loss 2403.06977 §3.3 2403.06977 §4.1 2403.06977 fig. 6. For video self-supervision, the paper uses masked alignment to a CLIP ViT-B teacher with 80% masking and aligns only the final outputs 2403.06977 §3.4 2403.06977 §4.2.

Author-reported results: 76.9% top-1 on ImageNet-1K at 224 px for the Ti size, against 76.1% for Vim-Ti 2403.06977 tab. 2. Supervised Kinetics-400 at 64×384 px reaches 83.3%, against 83.0% for UniFormer-B at 32×224 px 2403.06977 tab. 3. On Breakfast with end-to-end training, Ti reaches 94.3%, against 88.2% for ViS4mer on Swin-B features 2403.06977 tab. 6. The masked-pretraining K400 result at 8×224 px is 82.0%, below the 85.7% that UMT-B reports in the same table 2403.06977 tab. 3. Memory and speed are plotted in 2403.06977 fig. 1; the numbers are not restated here.

Card: VideoMamba: State Space Model for Efficient Video Understanding.

Sensor-token fusion inside a PPO locomotion policy (LocoMamba)

LocoMamba does not model an image or a clip as a sequence for its own sake. It turns a quadruped's proprioceptive vector into one token through an MLP, and a depth image into spatial tokens through a CNN. Both are projected to width 128 and concatenated, with the proprioceptive token first 2508.11849 §3.1 2508.11849 eq. 2–7 2508.11849 tab. 1. Two stacked selective state-space layers process these tokens. The output is pooled into one feature: the proprioceptive token joined to the mean of the visual tokens 2508.11849 §3.2 2508.11849 eq. 12. Separate MLP heads give the Gaussian policy and the value estimate, and PPO trains the whole stack end to end 2508.11849 §3.3.

The visual token count is an explicit trade-off. On the training terrain, 32, 64 and 256 tokens give returns of 740.55, 762.34 and 797.46, but on rugged terrain 256 tokens collide far more often (4166.64 against 470.27 for 64) 2508.11849 tab. 7. The default of 64 is labelled as the authors' choice in that table, and the text does not state it 2508.11849 tab. 7.

Author-reported results, PyBullet, 10 runs each, training on the Thin Obstacle terrain: return 762.34 ± 156.53 against 511.96 ± 247.30 for a Transformer proprio-vision baseline, and collisions per episode 72.53 against 141.83 2508.11849 tab. 4. Zero-shot on unseen rugged terrain the return is 583.76 against 257.38, but the baseline's spread is larger than its mean 2508.11849 tab. 9. On zero-shot dynamic obstacles the return is 749.09 against 685.49, and collisions are 38.47 against 121.63 [arxiv:2508.11849 tab. 10]. The authors' 48.9% return gain on the training terrain is computed from these rows 2508.11849 §5.2. The paper reports no significance test.

The policy is also smaller: 300,070 parameters against 353,190, and 4.11 million FLOPs per step against 5.01 million 2508.11849 tab. 6. Throughput (104.68 against 98.87 samples per second) and memory were measured on a 4 GB laptop GPU 2508.11849 tab. 6 2508.11849 §4.1. The text calls the FLOPs comparable 2508.11849 §5.3, which the table figures do not support as a strong statement.

The state is carried from the end of one time step to the start of the next 2508.11849 §3.2. The paper does not say whether it resets at episode start, whether gradients pass through it during PPO updates, or how it is recomputed for shuffled minibatches 2508.11849 §4.4 [arxiv:2508.11849 alg. 1]. An implementation has to choose and document these.

Card: LocoMamba: Vision-Driven Locomotion via End-to-End Deep Reinforcement Learning with Mamba.

Mamba blocks over LiDAR voxels for 3D occupancy (OccMamba)

OccMamba predicts the semantic occupancy of a local 3D space from a LiDAR point cloud 2408.10618 §3. It has a semantic branch, a geometric branch and a BEV fusion network. The semantic branch voxelises the points, runs three stages of sparse 3D convolution, and after each stage projects the voxels to a bird's-eye-view (BEV) grid and applies a Mamba block there [arxiv:2408.10618 §3.1]. The geometric branch runs dense 3D convolutions with a Mamba block over the voxels after each stage, then flattens height into channels [arxiv:2408.10618 §3.1]. A BEV U-Net fuses the scales of both branches 2408.10618 §3.1. The paper's linear-cost claim covers the Mamba layers, not the whole network 2408.10618 §3.1.

The paper says Mamba's parameters depend on the input 2408.10618 §2, but its equations are the fixed-parameter form 2408.10618 eq. 1 2408.10618 eq. 4. The released code uses the selective mamba_ssm module with state size 16, convolution width 4 and expansion 2 completion.py. The code flattens the 3D voxels in row-major order before the scan, and the paper gives no scan order completion.py. An implementation has to choose both.

Author-reported on the SemanticKITTI hidden test set, OccMamba reaches 59.9 IoU and 25.0 mIoU at 22.1 FPS. The baselines are Co-Occ at 56.6 IoU and 1.1 FPS, and SSC-RS at 59.7 IoU and 16.7 FPS 2408.10618 tab. 2. On the validation set it has 23.8 M parameters and 505.1 GFLOPs, against 149.6 M and 501.8 GFLOPs for MonoScene. Its per-batch training memory is 3.5 GB against 20.3 GB 2408.10618 tab. 3. The saving is in parameters and memory, not in compute. Removing the Geo-Mamba blocks lowers validation mIoU from 25.2 to 24.7, and removing the Sem-Mamba blocks lowers it to 24.1 2408.10618 tab. 4.

OMEGA pairs OccMamba with AGR-Planner, which is not a state-space model. It optimises a B-spline trajectory from a kinodynamic A* guide 2408.10618 §4. In simulation, with the same planner, the authors report 98% planning success with OccMamba against 95% with SCONet 2408.10618 tab. 5. That comparison isolates the perception network only. Card: OMEGA: Efficient Occlusion-Aware Navigation for Air-Ground Robot in Dynamic Environments via State Space Model.

Matrix memory with exponential gating (xLSTM, not an SSM)

xLSTM extends the LSTM with exponential input and forget gates, a normaliser state and a stabiliser state 2405.04517 §2.2. Its mLSTM cell has a d × d matrix memory C, updated by adding the outer product of a value and a key, and read out with a query 2405.04517 §2.3. The cell has no hidden-to-hidden link, so it can be computed in parallel over the sequence 2405.04517 §2.3. Its sLSTM cell keeps a scalar memory with recurrent mixing inside each head, and the paper says it is not parallelisable 2405.04517 §2.2 2405.04517 §5 (i).

The state does not grow with length, but the default training path does. The parallel backend builds a T × T matrix per head backends.py, while recurrent decoding keeps only the state backends.py. The paper's own CUDA mLSTM kernel is about four times slower than FlashAttention or Mamba's scan 2405.04517 §5 (ii).

Author-reported results, on SlimPajama validation perplexity: at 15B tokens, xLSTM[1:0] reaches 13.43 against 13.70 for Mamba and 14.25 for Llama 2405.04517 tab. 1. At 300B tokens and 1.3B parameters it reaches 8.89 against 9.14 for Mamba and 9.44 for Llama 2405.04517 tab. 3. The exponential gates need a stabiliser to avoid overflow, and the paper's gate forms are not all the ones the released code runs 2405.04517 §2.2 backends.py.

Card: xLSTM: Extended Long Short-Term Memory.

When to use which

The variants answer different questions, so choose by task first.

SituationUseWhy
Discrete tokens (text, DNA) where input-dependent selection and a fused kernel matterSelective SSM (Mamba-1)Selective Copying 99.8% against 18.3% for S4 2312.00752 §4.1. Zero-shot average 59.7 at 1.4B against 55.2 for Pythia-1.4B 2312.00752 §4.2.2. Use selection for text and DNA, not for raw audio 2312.00752 app. E.4.1.
Long-range sequence classification, or irregularly sampled signals, where parameters should not depend on the contentDiagonal MIMO layer (S5)LRA average 87.46% against 86.09% for S4-LegS 2208.04933 tab. 1. 8 kHz zero-shot speech 94.53% against 91.32% 2208.04933 tab. 2. Its results are against S4 and CRU, not Mamba 2208.04933 Lineage.
Image restoration (SR, denoising) where you want a global receptive field at SwinIR-like cost2D selective scan backbone (MambaIR)Author-reported gains over SwinIR on SR and Gaussian denoising 2402.15648 tab. 3 2402.15648 tab. 5. GPU memory grows roughly like SwinIR's as the input grows, far below full attention; no numbers are given 2402.15648 §4.3 2402.15648 fig. 5.
Real denoising where the last few tenths of a dB matterRestormer or MambaIR, by datasetOn SIDD, Restormer scores 40.02 dB against 39.89 dB for MambaIR. On DND, MambaIR scores 40.04 dB against 40.03 dB 2402.15648 tab. 6. Both gaps are under 0.2 dB and come from the authors' own tables.
Lightweight SR where MACs are the budgetCheck both models' MACs before pickingAt every scale, MambaIR-light reports more MACs than SwinIR-light (e.g. 167.1G against 122.2G at ×2) for a similar parameter count 2402.15648 tab. 4.
Image classification or dense prediction, where a Vim- or VMamba-style backbone is the base and 2D locality mattersWindowed scan (LocalMamba)Author-reported +3.1 over Vim-Ti at 1.5G FLOPs and +0.5 over VMamba-T 2403.09338 tab. 2. The direction search needs a supernet holding all eight candidates per block, reported at 28 GB for 20 blocks 2403.09338 §4.2. The fixed-direction configs in the code skip the search local_vim.py.
Image classification or dense prediction, with throughput as a constraintHybrid backbone (MambaVision)At Tiny size it reports higher throughput than ConvNeXt-T and Swin-T with higher top-1 2407.08083 tab. 1. Throughput is measured on an A100 at batch 128 and depends on the scan kernel 2407.08083 tab. 1.
Maximum ImageNet accuracy at the largest sizeMambaVision-L2 or a transformer model, by budgetL2 reports 85.3% at 1021 img/s; MaxViT-L reports 85.1% at 376 img/s in the same table 2407.08083 tab. 1.
Video classification or recognition on long clips, where attention cost is the constraintBidirectional 3D scan (VideoMamba)Author-reported 65.1% with the spatial-first scan against 62.4% for temporal-first on SSv2 2403.06977 fig. 7. Breakfast end-to-end Ti at 94.3% against 88.2% for ViS4mer 2403.06977 tab. 6. Short-clip K400 results are close to attention baselines, not clearly above them 2403.06977 tab. 3.
Language model training where GPU throughput is the bottleneck and decoding should keep a fixed-size stateSSD / Mamba-2 blockAuthor-reported 2 to 8 times faster than Mamba's fused scan at state size 64 2405.21060 fig. 10. Zero-shot averages match or beat Mamba-1 at the same size on the paper's seven tasks 2405.21060 tab. 1. Results are for models up to 2.7B trained on the Pile 2405.21060 §9.2.
Language model that must recall exact details from far back in the contextHybrid: Mamba-2 with a few attention layersSix attention layers in a 2.7B model improve Pile perplexity over pure Mamba-2 and Transformer++ 2405.21060 tab. 3. At 350M, about 10% attention layers is reported as best, and their exact placement as not critical when spread out 2405.21060 tab. 2 2405.21060 §9.2.3. A 120B-scale MoE with Mamba-2 blocks and few attention layers is the Nemotron 3 Super design 2604.12374 §2.1.3.
Serving a large MoE model where decode memory traffic mattersHybrid Mamba-2 and MoE (Nemotron 3 Super)Author-reported 2.2 times and 7.5 times the throughput of two baselines at 8k/64k 2604.12374 §1. Keep the SSM cache at FP32, or use stochastic rounding if it is FP16; plain FP16 raised verbosity by 37 to 40% 2604.12374 tab. 9.
Language model where exponential gating and a matrix memory are wanted, and training memory for a T × T form is affordablexLSTM (mLSTM blocks)Author-reported 13.43 against 13.70 for Mamba at 15B tokens 2405.04517 tab. 1. The default parallel backend is quadratic in length for training backends.py. Its CUDA kernel is about four times slower than FlashAttention or Mamba's scan 2405.04517 §5 (ii).
Per-channel or non-scalar state transition is neededNot SSDSSD covers only a scalar decay per head, and the paper's results do not show a per-channel SSM can use the same algorithm 2405.21060 §5 2405.21060 §7.2. S5's diagonal state is also not scalar, so SSD does not apply to it.
LiDAR 3D semantic occupancy on an onboard computer, where parameter count and memory matter more than FLOPsMamba blocks in a BEV-fused occupancy network (OccMamba)Author-reported 22.1 FPS, against 16.7 for SSC-RS and 1.1 for Co-Occ, at 59.9 IoU on the hidden test set 2408.10618 tab. 2. Against MonoScene it has 23.8 M parameters against 149.6 M, but about the same GFLOPs (505.1 G against 501.8 G) 2408.10618 tab. 3. The FPS hardware is not stated 2408.10618 tab. 2, and the TensorRT deployment code is not released 2408.10618 §5.1.
Robot locomotion policy that fuses proprioception and depth, where a Transformer fusion's cost in tokens is the constraintSelective SSM fusion (LocoMamba)Author-reported in simulation only: return 762.34 against 511.96 for a Transformer baseline on the training terrain 2508.11849 tab. 4. Zero-shot gains on rugged and dynamic terrain have overlapping spreads 2508.11849 tab. 9 2508.11849 tab. 10. No hardware tests were run 2508.11849 §6, and the code release has no training code README.md.
Pure PyTorch stack, no CUDA kernel buildPartly coveredBoth image models import mamba_ssm's fused selective scan mambair_arch.py mamba_vision.py. The Mamba-2 repository includes a minimal PyTorch SSD layer ssd_minimal.py. The Mamba-1 reference scan is a Python loop meant for testing, not speed selective_scan_interface.py. None of the papers benchmarks a pure-PyTorch port.
Commercial product that reuses the official codeCheck the licence firstThe MambaIR repository is Apache-2.0 LICENSE. The MambaVision repository is non-commercial, and its pretrained weights are non-commercial too LICENSE README.md. Implement MambaVision from the paper rather than copying its code. The Mamba-2 repository is Apache-2.0 LICENSE. The Mamba-1 and S5 cards record their code licences in code_license.

Implementation sketch

Language-agnostic pseudocode of the common core. The papers' own equations are not always implementable as printed, so take the scan from an existing kernel rather than from the equations 2402.15648 eq. 2 mambair_arch.py. This sketch is the plain, unchunked recurrence. For scalar-decay SSMs the chunked form in the Mamba-2 variant above is usually faster on GPUs 2405.21060 §6. For a diagonal layer such as S5, the same recurrence can be computed as a parallel scan over pairs (a, b) with an associative operator 2208.04933 app. H.

Pseudocode
# Discrete recurrence over a sequence x of length L  [arxiv:2402.15648 eq. 3]
def ssm_scan(x, A_bar, B_bar, C, D):
    # hidden state has fixed size N, whatever L is
    h = zeros(N)
    y = []
    for x_k in x:
        # update memory once per step (B_bar, C, step size depend on x in Mamba)
        h = A_bar @ h + B_bar * x_k
        # read out, plus direct skip through D
        y.append(C @ h + D * x_k)
    return y

# 2D selective scan over an image feature map  [arxiv:2402.15648 §3.5]
def selective_scan_2d(feature):           # feature: (H, W, D)
    # four orders: rows, columns, and both reversed
    # [code: basicsr/archs/mambair_arch.py#L343-L344]
    rows = flatten_row_major(feature)
    cols = flatten_column_major(feature)
    seqs = [rows, cols, reverse(rows), reverse(cols)]
    # each direction has its own parameters
    outs = [ssm_scan_fused(s, params[i]) for i, s in enumerate(seqs)]
    # undo the flips and transposes, then sum the four
    return sum(realign(o) for o in outs)

Notes for the hybrid backbone:

  • Placement. Use Mamba-style mixers in the first half of the layers of the later stages and attention in the second half, as the ablation favours 2407.08083 tab. 5.
  • Windows and padding. At 224 input the last two stages fit in one window each, so attention and the scan see the whole map. When a feature map is not a multiple of the window size, the official code pads with zeros and does not mask the padding, so the scan sees padded tokens too mamba_vision.py.
  • Mixer. Follow the equation for the two branches and the concatenation 2407.08083 eq. 7. The paper's listing of the mixer is not runnable as written 2407.08083 alg. 1.

Contradictions

No cross-paper disagreement is known on the same task. The papers evaluate different tasks, so their numbers do not compete directly. One tension is worth noting: Mamba-1 says selection hurts raw audio 2312.00752 app. E.4.1, while S5 reports fixed-parameter results on 8 kHz speech 2208.04933 §6.2. They are different models on different setups, so this page does not treat it as a conflict. Within each paper, the text, the tables or the code disagree on some points. Both sides are given here; this page does not resolve them.

  • VideoMamba, distillation warm-up. The text gives 5 warm-up epochs for the M student, the ImageNet table 30 for M, and the distillation script 20 2403.06977 §4.1 2403.06977 tab. XI run224.sh.
  • Mamba-1, discretisation. The paper's eq. 4 gives a ZOH factor for B̄. The released code uses Δ·B·u for the input term, so the two agree only to first order in Δ 2312.00752 eq. 4 selective_scan_interface.py.
  • Mamba-1, Δ initialisation. The paper samples Δ uniformly in the range 0.001 to 0.1 2312.00752 §3.6. The code samples uniformly in log Δ over the same range mamba_simple.py.
  • LocoMamba, safety penalties. The introduction says safety is enforced by penalties for collisions and falls 2508.11849 §1. The reward has no collision or fall term; falls and unrecoverable collisions only end the episode 2508.11849 eq. 21 2508.11849 eq. 24.
  • LocoMamba, depth frames. Section 3.1 says the four depth frames are aggregated by the backbone. Section 4.2 stacks them as one observation 2508.11849 §3.1 2508.11849 §4.2.
  • LocoMamba, efficiency. Section 5.3 calls the policy FLOPs comparable. Table 6 gives 4.11 million against 5.01 million per step, about 18% fewer 2508.11849 §5.3 2508.11849 tab. 6.
  • S5, readout factor. The code returns twice the real part of the readout when conjugate symmetry halves the state. The paper states only that half the eigenvalues are used 2208.04933 §3.2 ssm.py.
  • S5, learning rates. The table gives LR 0.005 for LRA-Image, and the code script gives 0.0045 2208.04933 app. G.2 run_lra_cifar.sh.
  • MambaIR, equation vs code. The printed discretisation in eq. 2 is inconsistent (B̄ uses exp(A) while Ā uses exp(ΔA)), and the code does not implement it 2402.15648 eq. 2 mambair_arch.py.
  • MambaIR, scan order. The paper describes four corner-to-corner scans 2402.15648 §3.5. The code scans row-major, column-major and their reverses mambair_arch.py.
  • OccMamba, Mamba form. Section 2 says Mamba's parameters depend on the input, but the equations in section 3.1 show fixed parameters 2408.10618 §2 2408.10618 eq. 1. The code uses the selective module completion.py. This page follows the code's form when implementation detail is needed, and the paper's text for the claims.
  • LocalMamba, LocalVim gain. The introduction and abstract give +3.1 for LocalVim-T over Vim-Ti. The results text gives +2.7 2403.09338 §5.1. Table 2 gives 76.2 against 73.1, which is +3.1 2403.09338 tab. 2. The +2.7 matches the no-search LocalVim-T* (75.8 against 73.1) 2403.09338 tab. 5.
  • LocalMamba, token attention. The paper describes a channel branch and a token (spatial) branch in SCAttn 2403.09338 §4.1 2403.09338 fig. 3b. The code implements only the channel branch; the spatial gate is commented out multi_mamba.py.
  • MambaVision, ablation gain. The text gives a +0.9 mIoU gain from concatenation 2407.08083 §5.3. Its Table 4 gives 46.0 against 45.7, a gain of +0.3 2407.08083 tab. 4.
  • MambaVision, compute saving. The text says MambaVision-B uses 56% fewer GFLOPs than MaxViT-B 2407.08083 §5.1. Table 1 gives 15.0 against 23.4 GFLOPs, about 36% fewer 2407.08083 tab. 1.
  • MambaVision, appendix vs code. The appendix's architecture table lists stage widths and block counts that do not match the code; the code is the reference for values 2407.08083 tab. S.2.
  • SSD, chunk length. The paper's listing defaults to a chunk length of 64 2405.21060 §6, listing 1. The reference Mamba-2 layer defaults to 256 mamba2_simple.py. The paper gives no chunk length for its own experiments.
  • xLSTM, normaliser threshold. The main text divides by max(|n·q|, 1) 2405.04517 §2.3. The code divides by max(|n·q|, exp(−m)) plus a small epsilon, and the two agree only when the stabiliser is zero backends.py.
  • xLSTM, output gate. The paper uses a sigmoid of a linear map of the input 2405.04517 §2.3. The code uses SiLU on half of the up-projection, and adds a skip connection and group norm the paper shows only in its block figure layer.py 2405.04517 app. A.4.
  • SSD, inference cost. Theorem 6.1 gives O(TN) inference FLOPs 2405.21060 §6, theorem 6.1. The cost table gives O(N²) per decoding step 2405.21060 §6.3. The per-step figure is the one that applies to a recurrent decode with a state of size P × N.

Papers

Source and license

Compiled from the papers listed on this page, all published under CC BY, CC BY-SA or CC0, with citations. See each paper's page for its authors and license.