Mamba: Linear-Time Sequence Modeling with Selective State Spaces

Albert Gu, Tri Dao

2023 · arXiv

Mamba: Linear-Time Sequence Modeling with Selective State Spaces

Problem

Framing

Linear-time sequence models had not matched Transformer quality on discrete, information-dense modalities like language. Mamba closes this gap by making SSM dynamics input-selective and pairing them with a hardware-aware recurrent scan, yielding linear scaling, 5\times inference throughput gains, and strong language results up to 3B parameters.

Currently Used Methods

Foundational

Proposed Method

Architecture

Mamba repeats a single homogeneous block. Each block uses an input projection, a short convolution, a selective SSM branch, and a multiplicative gate from the parallel branch; it removes attention and standalone MLP blocks by folding the SSM path into a gated MLP-style design.

Architecture diagram comparing H3, a gated MLP, and the final Mamba block; the Mamba block adds a Conv\rightarrowSSM path to the main branch with multiplicative gating.

Loss / Objective

The paper trains Mamba with the standard next-token autoregressive objective.

L=t=1Llogpθ(xtx<t)\mathcal{L} = - \sum_{t=1}^{L} \log p_\theta(x_t \mid x_{<t})

Sampling Rule / Algorithm

The selective SSM updates the hidden state with input-dependent discretized parameters.

ht=Atht1+Btxt,yt=Ctht\mathbf{h}_t = \overline{\mathbf{A}}_t \, \mathbf{h}_{t-1} + \overline{\mathbf{B}}_t \, \mathbf{x}_t, \qquad \mathbf{y}_t = \mathbf{C}_t \, \mathbf{h}_t At=exp(ΔtA),Bt=(ΔtA)1(exp(ΔtA)I)ΔtBt\overline{\mathbf{A}}_t = \exp(\Delta_t \mathbf{A}), \qquad \overline{\mathbf{B}}_t = (\Delta_t \mathbf{A})^{-1}\big(\exp(\Delta_t \mathbf{A}) - \mathbf{I}\big) \, \Delta_t \mathbf{B}_t

Training Procedure

Evaluation

Datasets

Metrics

Headline results

Ablations

Method Strengths and Weaknesses

Strengths

Weaknesses

Suggestions from the authors

Links

Prior Papers

Further Papers

No vault papers identified as further work yet.