Mamba: Linear-Time Sequence Modeling with Selective State Spaces
TLDR
Mamba is a novel linear-time sequence model using selective state space parameters that enables efficient, content-based reasoning and outperforms Transformers on long sequences across multiple modalities.
Key contributions
- Introduces input-dependent selective state space models (SSMs) that adaptively propagate or forget information along sequences.
- Develops a hardware-aware parallel recurrent algorithm enabling efficient inference despite losing convolutional speedups.
- Achieves state-of-the-art results on language, audio, and genomics tasks with 5× faster inference and linear scaling to million-length sequences.
Why it matters
This paper addresses the critical challenge of scaling sequence models efficiently without sacrificing performance by enhancing state space models with content-based adaptability and hardware-optimized algorithms. By doing so, it provides a powerful alternative to Transformers that is both faster and more scalable, enabling practical modeling of extremely long sequences in diverse domains such as language, audio, and genomics.
Original Abstract
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$\times$ 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.
📬 Weekly AI Paper Digest
Get the top 10 AI/ML arXiv papers from the week — summarized, scored, and delivered to your inbox every Monday.