Papers › Mamba: Linear-Time Sequence Modeling with Selective State Spaces

Mamba: Linear-Time Sequence Modeling with Selective State Spaces

1 Dec 2023arXiv:2312.00752archive 2025-07-28

Albert Gu, Tri Dao

Foundation models, now powering most of the exciting applications in deep learning, are almost universally based on the Transformer architecture and its core attention module. Many subquadratic-time architectures such as linear attention, gated convolution and recurrent models, and structured state space models (SSMs) have been developed to address Transformers' computational inefficiency on long sequences, but they have not performed as well as attention on important modalities such as language. We identify that a key weakness of such models is their inability to perform content-based reasoning, and make several improvements. First, simply letting the SSM parameters be functions of the input addresses their weakness with discrete modalities, allowing the model to selectively propagate or forget information along the sequence length dimension depending on the current token. Second, even though this change prevents the use of efficient convolutions, we design a hardware-aware parallel algorithm in recurrent mode. We integrate these selective SSMs into a simplified end-to-end neural network architecture without attention or even MLP blocks (Mamba). Mamba enjoys fast inference (5× higher throughput than Transformers) and linear scaling in sequence length, and its performance improves on real data up to million-length sequences. As a general sequence model backbone, Mamba achieves state-of-the-art performance across several modalities such as language, audio, and genomics. On language modeling, our Mamba-3B model outperforms Transformers of the same size and matches Transformers twice its size, both in pretraining and downstream evaluation.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2312.00752")

Code

Syntology Ran 18 of 62 code samples harvested from 14 repositories linked to this paper; 44 have no recorded run. Of those that ran: 4 ran · our draft was wrong; 2 ran · fixture could not drive it; 12 ran with no contract checked.

By repository: community (archive-listed): 62 samples from 14 repositories, 18 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

35 repositories listed; official and paper-mentioned ones first.

state-spaces/mamba officialmentioned in papermentioned on GitHubpytorch report
radarFudan/mamba officialmentioned on GitHubpytorchApache-2.0 report
AmazingDay1/TAME mentioned on GitHubpytorch report
Jiaxin-Ye/DepMamba mentioned on GitHubpytorch report
Leeroo-AI/mergoo mentioned on GitHubpytorchLGPL-3.0 report
aiot-mlsys-lab/famba-v mentioned on GitHubpytorch report
anzeyimana/deepkin mentioned on GitHubpytorch report
areffarhadi/mamba-asr mentioned on GitHubpytorchGPL-3.0 report
catalpaaa/demansia mentioned on GitHubpytorch report
haiyang-w/tokenformer mentioned on GitHubpytorchApache-2.0 report
havenhq/mamba-chat mentioned on GitHubpytorchApache-2.0 report
human9000/nd-mamba2-torch mentioned on GitHubpytorch report
hustvl/vim mentioned on GitHubpytorch report
irmvlab/point-mamba mentioned on GitHubpytorch report
jindongjiang/slotssms mentioned on GitHubpytorchMIT report
johnma2006/mamba-minimal mentioned on GitHubpytorchApache-2.0 report
jsie7/ssm-benchmark mentioned on GitHubpytorchMIT report
kaviezhang/meshmamba mentioned on GitHubpytorch report
khfs/DuplexMamba mentioned on GitHubjaxGPL-3.0 report
lab-emi/cleanumamba mentioned on GitHubpytorch report
lmd0311/pointmamba mentioned on GitHubpytorchApache-2.0 report
mzeromiko/vmamba mentioned on GitHubpytorch report
nus-hpc-ai-lab/dyvm mentioned on GitHubpytorch report
shendb2022/htd-mamba mentioned on GitHubpytorch report
thearkaprava/ms-temba mentioned on GitHubpytorchApache-2.0 report
tommyip/mamba2-minimal mentioned on GitHubpytorchApache-2.0 report
vvvm23/mamba-jax mentioned on GitHubjaxApache-2.0 report
weitunglin/pixmamba mentioned on GitHubpytorch report
weiwang31/icemamba mentioned on GitHubpytorch report
xi-j/mamba-asr mentioned on GitHubpytorchGPL-3.0 report
zhangyezhuo/mamca mentioned on GitHubpytorchGPL-3.0 report
zhu-0108/mts-unmixers mentioned on GitHubpytorchnot reachable when probed 2026-09-17 — repositories for recent papers often appear after camera-ready report
zyphra/blackmamba mentioned on GitHubpytorch report
zzmtsvv/mamba-interface mentioned on GitHubjax report
KyanChen/RSMamba pytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

62 samples harvested; 18 ran; 0 honoured the contract we drafted; 44 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

4ran · our draft was wrong
2ran · fixture could not drive it
12ran
44unverified

Licence: 28 of the 62 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 14 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

BiAttn weitunglin/pixmamba/classification/models/pixmamba.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · b2b4897f1f260e1e · report
LinearActivation lab-emi/cleanumamba/src/network/S4/MambaS4.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 76fa2650a64a7d15 · report
Mamba nus-hpc-ai-lab/dyvm/Semantic_Segmentation/mamba-1p1p1/mamba_ssm/modules/mamba_simple.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · a99d863241faf517 · report
Mamba catalpaaa/demansia/custom-mamba/mamba_ssm/modules/mamba_simple.py community (archive-listed) ran · metamorphic tier: deterministic GPL-3.0 (copyleft) · pointer only · 66eac000db0774c9 · report
Mamba hustvl/vim/mamba-1p1p1/mamba_ssm/modules/mamba_simple.py community (archive-listed) ran Apache-2.0 (permissive) · 2aeed50d3dee6266 · report
MambaBlock zzmtsvv/mamba-interface/jax/modules.py community (archive-listed) ran no licence file found · pointer only · a58b40a1cca60e8b · report
MambaBlock anzeyimana/deepkin/deepkin/models/mamba.py community (archive-listed) ran · metamorphic tier: invariant MIT (permissive) · ad10c82da33733f2 · report
RMSNorm human9000/nd-mamba2-torch/torchnssd/nd_mamba2.py community (archive-listed) ran · metamorphic tier: invariant fingerprinted no licence file found · pointer only · ba026d72b685bee1 · report
SS2D weitunglin/pixmamba/classification/models/pixmamba.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · c6eb39247d306bdd · report
SS2D weiwang31/icemamba/Model/IceMamba/IceMamba_6_VSSB.py community (archive-listed) ran no licence file found · pointer only · 75f8a49558b26e64 · report
get_logger lab-emi/cleanumamba/src/network/S4/MambaS4.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 3fcbb53cc7333590 · report
get_num_layer_for_vit thearkaprava/ms-temba/seg/mmcv_custom/layer_decay_optimizer_constructor.py community (archive-listed) ran fingerprinted Apache-2.0 (permissive) · 24385f6e21ea88d7 · report
new_data_aug_generator thearkaprava/ms-temba/vim/augment.py community (archive-listed) ran Apache-2.0 (permissive) · 4a0feeebf8ac43a8 · report
pscan_forward anzeyimana/deepkin/deepkin/models/mamba.py community (archive-listed) ran · fixture could not drive it MIT (permissive) · 3ccd019afab6e874 · report
resize thearkaprava/ms-temba/vim/models_MSTemba.py community (archive-listed) ran · fixture could not drive it Apache-2.0 (permissive) · 55bc02c6846634c4 · report
segsum human9000/nd-mamba2-torch/torchnssd/nd_mamba2.py community (archive-listed) ran · our draft was wrong fingerprinted no licence file found · pointer only · d5e983b865a3413d · report
silu human9000/nd-mamba2-torch/torchnssd/nd_mamba2.py community (archive-listed) ran · our draft was wrong fingerprinted no licence file found · pointer only · 8558535d4b8ed416 · report
ssd human9000/nd-mamba2-torch/torchnssd/nd_mamba2.py community (archive-listed) ran no licence file found · pointer only · d81ce48746793832 · report
FFTConv lab-emi/cleanumamba/src/network/S4/MambaS4.py community (archive-listed) unverified no licence file found · pointer only · e62f17401cf26b98 · report
InferenceCache human9000/nd-mamba2-torch/torchnssd/nd_mamba2.py community (archive-listed) unverified no licence file found · pointer only · 0be091c646cafedd · report
Kernel lab-emi/cleanumamba/src/network/S4/MambaS4.py community (archive-listed) unverified no licence file found · pointer only · 6e0d3f18a6d838b9 · report
Mamba AmazingDay1/TAME/mamba_ssm/modules/mamba_simple.py community (archive-listed) unverified Apache-2.0 (permissive) · 01433a18b73a69d8 · report
Mamba2 human9000/nd-mamba2-torch/torchnssd/nd_mamba2.py community (archive-listed) unverified no licence file found · pointer only · b8656f4ec2336e2c · report
Mamba2Config human9000/nd-mamba2-torch/torchnssd/nd_mamba2.py community (archive-listed) unverified no licence file found · pointer only · cba45ceb264445f9 · report
MambaConfig anzeyimana/deepkin/deepkin/models/mamba.py community (archive-listed) unverified MIT (permissive) · 47df96dc59196907 · report
MambaS4 lab-emi/cleanumamba/src/network/S4/MambaS4.py community (archive-listed) unverified no licence file found · pointer only · b6e3bc590d74b59c · report
ParallelMambaBlock haiyang-w/tokenformer/megatron/model/mamba/mamba.py community (archive-listed) unverified Apache-2.0 (permissive) · b853ef0ddbe24ac6 · report
S4Block lab-emi/cleanumamba/src/network/S4/MambaS4.py community (archive-listed) unverified no licence file found · pointer only · 58b5b2e41748edc1 · report
SSMKernel lab-emi/cleanumamba/src/network/S4/MambaS4.py community (archive-listed) unverified no licence file found · pointer only · b8fab631b07b9ceb · report
SSMKernelDPLR lab-emi/cleanumamba/src/network/S4/MambaS4.py community (archive-listed) unverified no licence file found · pointer only · cced358b4d4bb38d · report
SSMKernelDiag lab-emi/cleanumamba/src/network/S4/MambaS4.py community (archive-listed) unverified no licence file found · pointer only · d5649c5229d3c6f2 · report
append_nvcc_threads thearkaprava/ms-temba/mamba-1p1p1/setup_AS.py community (archive-listed) unverified Apache-2.0 (permissive) · db4a88f1431b30bd · report
associative_operator zzmtsvv/mamba-interface/jax/modules.py community (archive-listed) unverified no licence file found · pointer only · 92d457e0ce6c4038 · report
build_dataset thearkaprava/ms-temba/vim/datasets.py community (archive-listed) unverified Apache-2.0 (permissive) · d58967bba23da4e6 · report
build_transform thearkaprava/ms-temba/vim/datasets.py community (archive-listed) unverified Apache-2.0 (permissive) · ebeb7b6e20a434cf · report
cast_eqx_layer vvvm23/mamba-jax/mamba_jax/modelling/equinox/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 1cbbea4b9de815f6 · report
chunk_dataset vvvm23/mamba-jax/dataset.py community (archive-listed) unverified Apache-2.0 (permissive) · 1bbd9644f0c6f236 · report
combination lab-emi/cleanumamba/src/network/S4/MambaS4.py community (archive-listed) unverified no licence file found · pointer only · 2e5e1b8467df7fb2 · report
compute_c_state_diversity_loss_simple thearkaprava/ms-temba/vim/models_MSTemba.py community (archive-listed) unverified Apache-2.0 (permissive) · 8f3c3db8de4abd45 · report
cross_selective_scan weiwang31/icemamba/Model/IceMamba/IceMamba_6_VSSB.py community (archive-listed) unverified no licence file found · pointer only · 6367281f3513cb50 · report
dplr lab-emi/cleanumamba/src/network/S4/MambaS4.py community (archive-listed) unverified no licence file found · pointer only · 0e3d9394e01f8e81 · report
eval_model thearkaprava/ms-temba/vim/MSTemba_main.py community (archive-listed) unverified Apache-2.0 (permissive) · ad88c39d5b497053 · report
get_cuda_bare_metal_version thearkaprava/ms-temba/mamba-1p1p1/setup_AS.py community (archive-listed) unverified Apache-2.0 (permissive) · faaf3d02abfa732c · report
get_pt_checkpoint vvvm23/mamba-jax/mamba_jax/modelling/equinox/loader.py community (archive-listed) unverified Apache-2.0 (permissive) · 546a5f60b7dbd8fe · report
grad_wrapper vvvm23/mamba-jax/benchmark.py community (archive-listed) unverified Apache-2.0 (permissive) · 0a8ec528f858d85d · report
init_mamba_from_raw_pytree vvvm23/mamba-jax/mamba_jax/modelling/equinox/loader.py community (archive-listed) unverified Apache-2.0 (permissive) · 37fea50236b0973b · report
log2 anzeyimana/deepkin/deepkin/models/mamba.py community (archive-listed) unverified MIT (permissive) · bf2818a19b4d3706 · report
make_dataset thearkaprava/ms-temba/vim/charades_dataloader.py community (archive-listed) unverified Apache-2.0 (permissive) · 5984ddd05552649a · report
make_experiment_directory vvvm23/mamba-jax/train_utils.py community (archive-listed) unverified Apache-2.0 (permissive) · be231a069d3f7c48 · report
mamba_inner_with_mask nus-hpc-ai-lab/dyvm/Semantic_Segmentation/mamba-1p1p1/mamba_ssm/modules/mamba_simple.py community (archive-listed) unverified no licence file found · pointer only · 19e594df117ee0c3 · report
mamba_ssm vvvm23/mamba-jax/mamba_jax/kernels/interface.py community (archive-listed) unverified Apache-2.0 (permissive) · a6bd393ea522c000 · report
mamba_ssm vvvm23/mamba-jax/mamba_jax/kernels/reference.py community (archive-listed) unverified Apache-2.0 (permissive) · 10cfd3bf57dd2545 · report
npo2 anzeyimana/deepkin/deepkin/models/mamba.py community (archive-listed) unverified MIT (permissive) · da2a26ac4e6fac71 · report
pad_npo2 anzeyimana/deepkin/deepkin/models/mamba.py community (archive-listed) unverified MIT (permissive) · 1eed9cc6741a3c54 · report
preprocess havenhq/mamba-chat/trainer/data.py community (archive-listed) unverified Apache-2.0 (permissive) · 2e14c40a76acb232 · report
pretokenize_dataset vvvm23/mamba-jax/dataset.py community (archive-listed) unverified Apache-2.0 (permissive) · 8227c505af8b8afd · report
pscan anzeyimana/deepkin/deepkin/models/mamba.py community (archive-listed) unverified MIT (permissive) · 98d508bb5b28dd76 · report
pt_to_raw_pytree vvvm23/mamba-jax/mamba_jax/modelling/equinox/loader.py community (archive-listed) unverified Apache-2.0 (permissive) · ea69e8168673d498 · report
run_network thearkaprava/ms-temba/vim/MSTemba_main.py community (archive-listed) unverified Apache-2.0 (permissive) · 5d474c2e4ca27948 · report
setup_text8_dataset vvvm23/mamba-jax/dataset.py community (archive-listed) unverified Apache-2.0 (permissive) · 22fcb344f3b02930 · report
ssm lab-emi/cleanumamba/src/network/S4/MambaS4.py community (archive-listed) unverified no licence file found · pointer only · bd2682f3bd8b38fc · report
wandb_init vvvm23/mamba-jax/train_utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 000e6765f1790cbf · report

Tasks

2D Pose EstimationCommon Sense ReasoningComputational EfficiencyLanguage ModelingLanguage ModellingLong-range modelingMambaSentence CompletionState Space Models

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Common Sense Reasoning ARC (Easy) Mamba-2.8B (0-shot) Accuracy 69.7 #35 of 47 Archive leaderboard report
Language Modelling LAMBADA Mamba-2.8B Accuracy 69.2 #25 of 37 Archive leaderboard report
Language Modelling LAMBADA Mamba-2.8B Perplexity 4.23 #25 of 37 Archive leaderboard report
Sentence Completion HellaSwag Mamba-2.8B Accuracy 66.1 #58 of 89 Archive leaderboard report
Sentence Completion HellaSwag Mamba-1.4B Accuracy 59.1 #61 of 89 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Introduced by this paper: Mamba

1x1 ConvolutionAbsolute Position EncodingsAdamAttentionBPEConvolutionDense ConnectionsDropoutGated ConvolutionGated Linear UnitLabel SmoothingLayer NormalizationLinear LayerMambaMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections