TSLib Mamba
The Mamba selective state space model set up as a time series forecaster in the Time Series Library.
Time series · 646 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Time series
- Parameters
- 120.6K
- Operations
- 646
- Framework
- PyTorch
- Recurrent
- No
- Published
- 2023
- Cited by
- 7,581 (as of 12 November 2026)
- Authors
- Albert Gu, Tri Dao
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m3035
- Graph hash
- d9074ecf5e6b9c6eedfa45fc5a75b9a8fdd120f8e75e1d51546f3fb8ab78cb86
- Skeleton hash
- 39668a607f183aa3cf635f7b2158bb5caac8dd0f1834854527a554ba75591dc0
- Architecture hash
- 4d466b09048184d7378699b4278b2ad152061dac286fd977941fca2d7bb1dd66
- Diagram SHA-256
- 3ffe2d2c24a2c7e66a69cbc3c1cecf15ad18ba8e0d9cd99a4d6a40736720e699
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
This model is the Mamba sequence architecture as included in the Time Series Library (TSLib). TSLib is an open-source library for deep time series analysis. The TSLib model relies on the mamba_ssm package, which has to be installed separately. The main module of the Mamba code repository is the Mamba block, which wraps a selective state space model (SSM).
In a selective SSM the parameters are functions of the input, so the model can selectively propagate or forget information along the sequence depending on the current token. This change prevents the use of efficient convolutions, so the authors designed a hardware-aware parallel algorithm that runs in recurrent mode. The resulting architecture has no attention and no MLP blocks. Its block design combines the H3 block of earlier SSM architectures with the MLP block of modern neural networks. Computation and memory scale linearly in sequence length during training.
The paper presents Mamba as a general sequence model backbone and evaluates it on language, audio, and genomics. On language modeling, it reports that the Mamba-3B model outperforms Transformers of the same size and matches Transformers twice its size.
Key idea. The paper integrates selective state space models into a simplified architecture without attention or MLP blocks that scales linearly in sequence length.
- mamba
- tslib mamba
- mamba time series
- mamba forecaster
- selective state space model
- state space model
- ssm
- time series forecasting
- linear-time sequence modeling
- time series library
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{gu2024mambalineartimesequencemodeling,
title={Mamba: Linear-Time Sequence Modeling with Selective State Spaces},
author={Albert Gu and Tri Dao},
year={2024},
eprint={2312.00752},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2312.00752},
}