All models

mLSTM

The matrix-memory LSTM cell from xLSTM, wrapped in its residual block with pre up-projection.

Language · 74 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (24 KB)

Open in a new tab

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

Parameters
109.4K
Operations
74
Framework
PyTorch
Recurrent
No
Published
NeurIPS 2024
Cited by
292 (as of 26 October 2026)
Authors
Maximilian Beck, Korbinian Pöppel, Markus Spanring and others
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m21653
Graph hash
8f8a02f4547ecbb268fc0774a9ec46dd5a961e97bdc0bf0c3a0e7a82b54cebf8
Skeleton hash
4d8184220d80d9a48e7cc70329c71affb48b006cc6560b46772f3521cf47083e
Architecture hash
d820764bde0663f7cf8b024d3e247d4464257e4e9555eb1d0f3ade4c21c2ed8a
Diagram SHA-256
60ccd21f511fe26d8683311efda675e8538683d0e292f38552af29aca0c3f375
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

mLSTM is the matrix-memory cell introduced in the xLSTM paper, one of two modifications of the LSTM memory structure made there. To raise storage capacity, the paper enlarges the LSTM memory cell from a scalar to a matrix, so retrieval is performed via a matrix multiplication.

The matrix stores key-value pairs with a covariance update rule. That rule is fitted into the LSTM framework: the forget gate corresponds to a decay rate, the input gate to a learning rate, and the output gate scales the retrieved vector. A normalizer state, the weighted sum of key vectors, accompanies the matrix. Because mLSTM has no memory mixing, its recurrence can be reformulated in a parallel version.

In xLSTM the cell sits in a residual block with pre up-projection, chosen because the memory capacity becomes larger in the high-dimensional space. In that block the input is first up-projected with projection factor 2. The cell input then passes through a dimension-wise causal convolution with kernel size 4 before entering a learnable skip connection. An ablation in the paper found that the matrix memory benefits from this block structure and that the convolution within it is important. The memory itself requires no parameters, though the paper calls it computationally expensive.

Key idea. The xLSTM paper turns the LSTM memory cell from a scalar into a matrix updated by a covariance rule, giving mLSTM, a fully parallelizable cell with exponential gating.

  • mlstm
  • matrix lstm
  • xlstm
  • extended long short-term memory
  • matrix memory
  • covariance update rule
  • exponential gating
  • mlstm block
  • recurrent neural network
  • language modeling

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{beck2024xlstmextendedlongshortterm,
      title={xLSTM: Extended Long Short-Term Memory}, 
      author={Maximilian Beck and Korbinian Pöppel and Markus Spanring and Andreas Auer and Oleksandra Prudnikova and Michael Kopp and Günter Klambauer and Johannes Brandstetter and Sepp Hochreiter},
      year={2024},
      eprint={2405.04517},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2405.04517}, 
}