---
title: "Transformers are SSMs — paper by Dao and Gu (2024)"
description: "How structured state space duality connects recurrence with attention, enables faster computation, and shapes the Mamba-2 architecture."
canonical: "https://research.elamur.ai/free/en/papers/dao-2024-transformers-ssms-generalized-models-efficient/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/dao-2024-transformers-ssms-generalized-models-efficient/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2024](https://md.research.elamur.ai/free/en/papers/2024/) / Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality

# Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality

Paper · 2024 · Tri Dao and Albert Gu

**Authors:** [Tri Dao](https://md.research.elamur.ai/free/en/authors/tri-dao/) and [Albert Gu](https://md.research.elamur.ai/free/en/authors/albert-gu/) · **Year:** 2024 · **Venue:** arXiv:2405.21060 · **Licence:** [CC BY 4.0 (arXiv)](http://creativecommons.org/licenses/by/4.0/)

[**75** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W4399317989) · [licence](http://creativecommons.org/licenses/by/4.0/)

- [PDF](https://arxiv.org/pdf/2405.21060)
- [arXiv 2405.21060](https://arxiv.org/abs/2405.21060)
- [OpenAlex](https://openalex.org/W4399317989)

## Deep dive: Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality

How structured state space duality connects recurrence with attention, enables faster computation, and shapes the Mamba-2 architecture. · about 39 minutes to read

**In this deep dive**

1. [Summary](#dd-summary)
2. [Ideas worth borrowing](#dd-ideas-worth-borrowing)
3. [How Mova uses it](#dd-how-mova-uses-it)
4. [The problem and its context](#dd-the-problem-and-its-context)
5. [The method, step by step](#dd-the-method-step-by-step)
6. [Experiments and results](#dd-experiments-and-results)
7. [What the ablations show](#dd-what-the-ablations-show)
8. [Limitations](#dd-limitations)
9. [What came after](#dd-what-came-after)

### Summary

Processing a long passage creates a tension between remembering enough and computing efficiently. A [Transformer](https://md.research.elamur.ai/free/en/concepts/transformer/) can compare each position with earlier positions through attention, but those comparisons become expensive as the passage grows. A state space system takes a different approach: it continually updates a fixed-size memory. Mamba had already shown that this approach could compete with Transformers on language modeling at the scales studied. The remaining problem was practical as well as theoretical. Its recurrent computation did not benefit from the same hardware operations and engineering methods that made attention efficient. This paper develops a mathematical connection that lets the authors bring those methods across.

The connection begins with a change of representation. Rather than describing a state space transformation only as a recurrence, the authors write it as multiplication by a structured matrix. The relevant structure is called semiseparability: blocks connecting earlier inputs to later outputs have bounded rank, with the bound determined by the recurrent state dimension. From the attention side, the authors generalize linear attention into structured masked attention, where a structured matrix controls interactions between positions. These perspectives meet in structured state space duality, or SSD. At their intersection, the same transformation has both a recurrent computation and an attention-like computation. This is an exact equivalence for the specified family, instead of an approximation of ordinary softmax attention.

That equivalence leads to an algorithm that uses different computations at different scales. Within short chunks, it applies the attention-like form using matrix multiplication. Between chunks, it communicates through compact recurrent states. The resulting SSD implementation runs 2–8× faster than Mamba’s optimized selective scan in the reported comparisons. It also accommodates state expansion at least 8× larger with little slowdown. Against [FlashAttention-2](https://md.research.elamur.ai/free/en/papers/dao-2023-flashattention-2-faster-attention-better/), the reported crossover occurs around sequence length 2K; at 16K, SSD is 6× faster. These measurements concern the sequence-processing operation. The authors separately caution that a complete Mamba-2 network can still train less efficiently than a Transformer at short sequence lengths because their surrounding layer compositions differ.

Mamba-2 combines this SSD operation with changes to the surrounding block. Input-dependent projections move to the block entrance, where they can be calculated together, and an additional normalization helps stability. A shared vocabulary of heads makes it possible to compare parameter-sharing patterns and arrange computation for tensor parallelism. The design reduces synchronization requirements per block and also supports splitting long sequences between devices and packing examples without padding. In Pile experiments using Chinchilla-style scaling, the authors report favorable tradeoffs among perplexity, computation, and training time relative to Mamba and Transformer++. Their 2.7B-parameter Mamba-2, trained on 300B tokens, also surpasses the reported downstream results of Mamba-2.8B, Pythia-2.8B, and Pythia-6.9B.

The broader result is a way to reason jointly about mathematical structure, memory capacity, and hardware execution. Larger recurrent states improve the synthetic recall task, while a small proportion of attention layers improves the hybrid language systems. Those findings also define the boundary of the claims. SSD compresses history into a chosen state size; softmax attention retains access to a growing history. The paper connects particular attention variants with particular state space transformations, and shows how useful algorithms follow from that connection. It does not establish that fixed-state recurrence reproduces every capability of conventional attention.

### Ideas worth borrowing

Separate the transformation from its execution. A recurrence specifies what a sequence operation does, but it need not dictate how the operation is evaluated. The authors expose the underlying matrix and then consider several multiplication algorithms for it. This separation is useful whenever an apparently sequential procedure has algebraic structure: a streaming implementation, a parallel training implementation, and a blocked implementation may all calculate the same function. It encourages engineers to preserve semantics while choosing execution strategies for the workload.

Use structure to control expensive interactions. SSD does not make earlier tokens irrelevant. It restricts how their influence can reach later outputs, so that cross-boundary interactions factor through a bounded state. The reusable idea is to ask what intermediate representation carries everything needed across a partition. If that representation is small, a computation that appears to require many pairwise interactions may instead communicate through compact summaries. The same reasoning can guide both algorithms within a device and partitioning across devices.

Optimize for available operations. An algorithm with linear sequence-length complexity can still execute poorly if its work consists of small scalar operations and large intermediate tensors. SSD keeps linear scaling while moving most work into matrix multiplication. Its lesson for [efficient computation](https://md.research.elamur.ai/free/en/topics/efficient-models/) is that arithmetic counts, temporary storage, and hardware utilization must be considered together. A somewhat different local calculation can be worthwhile when it exposes the operations that the accelerator handles well.

Combine local density with global compression. The authors use dense, attention-like calculation inside a chunk and a recurrent summary between chunks. Dense interaction is affordable over a short span, while compressing communication prevents its cost from expanding across the complete sequence. This pattern applies wherever local subproblems can be solved independently and their long-range effects admit a compact representation. The crucial condition is that the combination rule preserves the intended transformation.

Treat parameter sharing as an experimental variable. Head patterns determine which channels receive distinct inputs, distinct expansion directions, or distinct readout directions. The authors find different quality even when total state capacity is controlled. A parameter budget therefore does not fully describe an architecture. Researchers can borrow the practice of varying where parameters are independent while keeping overall resources comparable, especially when transferring a successful arrangement from one computational family to another.

Design communication together with the block. Moving selective projections to the entrance of Mamba-2 changes which quantities each device can calculate independently. That architectural choice removes an internal synchronization requirement. The general lesson for [GPU and parallel computing](https://md.research.elamur.ai/free/en/topics/gpu-parallel-computing/) is that communication costs often originate in dependency structure. Rearranging dependencies can be more effective than optimizing the communication operation after the architecture has already forced it.

Test transferred techniques instead of assuming they transfer. SSD makes methods from linear attention available to state space systems, but the tested kernel approximations do not clearly improve on simple activations. The additional structured mask changes the computational setting in which those methods operate. A mathematical bridge supplies plausible experiments; it does not guarantee that every technique developed on one side will help on the other.

### How Mova uses it

For [Mova](https://md.research.elamur.ai/free/en/projects/mova/), the small transparent language system implemented in Rust, the strongest immediate connection is an approach to inspectable computation. SSD gives a precise relationship between a compact state update and the contribution of earlier inputs to later outputs. That could support a component whose behavior can be examined both incrementally and over a complete sequence. There is no established Mova implementation of SSD or Mamba-2 to describe, so these are possible applications rather than claims about existing functionality.

A useful first application would be a small recurrent sequence component with an explicit state representation. Its interface could distinguish the input, the transition controlling retention, the expansion into memory, and the readout from memory. Those distinctions come directly from the paper’s formulation. They would make it easier to describe what the component stores and how it produces an output, even though the mathematical decomposition alone would not make learned memory contents understandable.

The dual representations also suggest a concrete way to check an implementation. Over a short sequence, Mova could calculate the transformation directly from the matrix representation and compare it with incremental state updates. A blocked implementation could then be checked against the same reference. The point would be to verify that changing execution strategy preserves the function. The paper’s equivalence supports this possibility; it does not supply evidence that such checks already exist in Mova.

A further possibility concerns the handling of separate examples. The paper describes concatenating variable-length sequences while preventing state from crossing their boundaries. A transparent system could make these boundaries explicit in its execution trace. That would help explain when memory is retained within an example and when it is reset before another example begins. Such an interface would require careful agreement between the boundary convention and the state update, rather than merely inserting separators into text.

The hardware results should remain separate from these potential uses. A Rust implementation would not inherit the reported acceleration simply by adopting the equations. The gains depend on arranging work around efficient matrix operations, avoiding large intermediate states, and choosing an appropriate execution strategy. For a small system, the simplest recurrence might be preferable until measurement justifies a more elaborate implementation.

Finally, the hybrid experiments offer a useful constraint on architectural ambition. If Mova were to explore compressed sequence memory, this paper would support testing it alongside a mechanism that can refer directly to earlier context. It would not support assuming that a bounded state replaces every form of retrieval. The value for Mova is a precise, testable design vocabulary: compact memory, explicit state boundaries, equivalent execution forms, and a clear distinction between implementation correctness and language capability.

### The problem and its context

#### Remembering a sequence has a computational cost

A [language model](https://md.research.elamur.ai/free/en/concepts/language-model/) predicts a continuation from the preceding context. The architecture determines how information from that context remains available. In a causal Transformer, attention lets a position interact with positions that came before it. During training, calculating those interactions produces the familiar quadratic dependence on sequence length. During generation, stored keys and values preserve access to the earlier context, so the cache grows as the sequence grows.

A structured state space system keeps a recurrent memory instead. Each new input changes that memory, and an output is read from the updated state. The state can remain fixed in size as more tokens arrive. This offers linear dependence on sequence length during training and a bounded memory representation during generation.

The tradeoff is that the state must carry the useful information forward. Attention can retain representations of the preceding tokens and consult them again. A recurrent system must compress their effects into the available state. This difference matters particularly on tasks that ask for a specific association from a crowded context.

The paper starts from the observation that selective state space systems had become competitive enough to make their computational shortcomings consequential. Mamba could match or exceed Transformer performance in the small-to-medium-scale language experiments described by the authors. Yet its algorithms and implementation techniques had developed somewhat separately from the extensive work on efficient attention.

The authors therefore seek a connection that does practical work. A shared mathematical account could explain similarities between the families, reveal which distinctions remain, and make established optimization techniques available to state space architectures.

#### From fixed dynamics to selective memory

Earlier structured state space approaches, including S4 and diagonal variants, used restricted transition matrices so that their sequence transformations could be evaluated efficiently. The transition governs how information already in the state evolves. Without useful structure, applying that transition repeatedly can be too expensive for a deep network.

An important earlier setting is linear time invariance. Here the dynamics remain unchanged across sequence positions. Such a transformation can also be expressed as a convolution, with a global kernel determined by the state space parameters. That gave earlier systems a useful pair of execution modes: convolution for parallel training over a known sequence, recurrence for generation as inputs arrive.

Mamba introduced selective state space computation in which the parameters can depend on the input and vary across time. The resulting system can retain some inputs and suppress others. The paper presents this selectivity as important for information-dense sequences such as language, especially when a larger state provides more storage capacity.

The change also removes the straightforward convolutional execution used by time-invariant systems. Input-dependent dynamics cannot generally be replaced by a single fixed convolution kernel. Mamba consequently relied on an optimized selective scan to make recurrent evaluation practical.

That implementation avoided the most obvious memory problem: expanding every position into its full hidden state and writing all those expanded tensors to memory. Nevertheless, its core work still consisted of operations that did not exploit matrix multiplication hardware as effectively as attention did. This is the immediate algorithmic problem that SSD addresses.

#### Linear attention had already opened a bridge

The paper’s principal predecessor is linear attention. Its central observation is that some attention calculations can be reorganized without constructing all pairwise scores. A different multiplication order accumulates information in a recurrent representation and then reads it out for each query.

This offered a precedent for combining parallel training with efficient generation. The same attention function could have a quadratic formulation and a recurrent formulation. The authors build on that idea, but seek a broader and more systematic account.

A causal mask complicates the familiar matrix-associativity argument. Without a mask, regrouping matrix products is direct. With a mask, only certain source positions contribute to each output, so the equivalence requires careful handling of indices. The paper uses tensor contractions to make these dependencies explicit.

The key question then becomes broader than whether attention can be reordered. Which masks permit fast multiplication? If the mask itself has a compressed representation and a fast algorithm, it can support efficient attention-like computation. This leads to structured masked attention.

The paper describes RetNet and GateLoop as related steps in this direction. RetNet uses a decay structure, while GateLoop introduces input-dependent decay. These connections help place SSD in an existing line of recurrent and attention-inspired work, rather than presenting it as the first system to combine both viewpoints.

#### Structured matrices supply the common language

A general matrix over sequence positions can represent every interaction separately. Such a representation is expensive because its size grows quadratically. A structured matrix instead encodes regularities that allow it to be stored and multiplied more cheaply.

Sparse and low-rank matrices are familiar examples, but the paper also discusses other structures used in sequence architectures. The important point is methodological: the matrix’s representation determines which algorithms are available.

Semiseparable structure is particularly appropriate for recurrence. Imagine separating a sequence into an earlier part and a later part. Every influence crossing that boundary must pass through the recurrent state. Hence, the corresponding block of the sequence transformation cannot contain arbitrarily many independent directions of influence. Its rank is bounded by the state dimension.

This gives a concrete meaning to history compression. The entire sequence transformation can have rich behavior, while cross-boundary blocks remain constrained by the capacity of the state connecting them. The whole matrix need not be low rank.

The paper turns this observation into an equivalence between state space transformations and semiseparable matrix multiplication. From that point onward, choosing a recurrent algorithm becomes one option among several ways to multiply by the same matrix.

### The method, step by step

#### Begin with the transformation being calculated

The authors distinguish a sequence operation from the neural block surrounding it. A sequence operation receives vectors indexed by position and returns vectors indexed by position. Projections, gates, normalization, and residual connections can wrap that operation inside a larger architecture.

For a matrix transformation, the sequence operation has the following form:

```
Y = MX
```

Here X is the input sequence, Y is the output sequence, and M is a matrix acting along the sequence axis. If the sequence has length T and each position contains P channels, X and Y have shape (T, P), while M has shape (T, T). The same M acts on every channel within the head.

This description does not require M to be independent of the input. In a selective system, input-derived parameters determine M. The matrix formulation describes the transformation after those parameters have been specified. That qualification matters: linearity in the values being transformed does not imply that the complete neural block is linear in its original input.

The aim is to identify M without necessarily constructing it. Its entries explain the function; its compressed representation enables efficient calculation.

#### Expand the recurrent history

A state space transformation uses an internal state to connect earlier inputs to later outputs. The authors expand that recurrence to express the state at a position as the accumulated influence of all preceding inputs:

```
hₜ = Σₛ₌₀ᵗ Aₜ:ₛˣ Bₛ xₛ
```

Here hₜ is the state at position t, xₛ is the input at position s, and Bₛ maps that input into the state. The notation Aₜ:ₛˣ represents the ordered product of transitions from position s toward position t. The summation includes the current input and all earlier inputs. An empty transition product acts as the identity.

The expansion shows the path taken by an earlier input. It first enters memory through B, then passes through the transitions between its position and the output position. The readout applies C:

```
yₜ = Σₛ₌₀ᵗ Cₜᵀ Aₜ:ₛˣ Bₛ xₛ
```

Here yₜ is the output at position t, and Cₜᵀ reads the state into the output. The superscript T indicates transpose. The other symbols retain their preceding meanings.

This yields the entries of the full sequence matrix:

```
Mⱼᵢ = Cⱼᵀ Aⱼ ⋯ Aᵢ₊₁ Bᵢ
```

Here i identifies an input position and j an output position. Bᵢ inserts the earlier input into memory, the A factors propagate it, and Cⱼᵀ reads its contribution. Entries above the diagonal are zero in the causal setting because a later input cannot affect an earlier output.

The formula is also the sequentially semiseparable representation used throughout the paper. Its importance is not merely that recurrence can be expanded into a large matrix. The expansion identifies the matrix family and therefore exposes algorithms associated with that family.

#### Understand the rank restriction

Consider a rectangular block that takes inputs from an earlier segment and produces outputs in a later segment. The matrix formula can be factored around the boundary between those segments.

The earlier side maps its inputs into a boundary state. The later side maps that boundary state into outputs. Between them, the state dimension limits the number of independent directions that can pass across the boundary.

The paper formalizes this through semiseparability. For an order-N semiseparable matrix, the appropriate blocks entirely contained on or below the diagonal have rank bounded by N. The converse connection also holds: matrices with this structure admit a sequentially semiseparable representation.

This equivalence supplies a useful interpretation of state size. N is not simply a parameter controlling the length of a hidden vector. It also bounds the rank of interactions across temporal partitions. Increasing N can increase the complexity of the history-dependent information that crosses such partitions.

The authors additionally distinguish theoretical compression from practical execution. General semiseparable matrices have compact representations and fast multiplication algorithms, but obtaining a suitable representation from unrestricted transitions can require expensive preprocessing. Their implemented SSD operation therefore uses stronger transition structure.

#### Isolate the scalar recurrence

A fundamental building block is the scalar state update:

```
hₜ = aₜ hₜ₋₁ + bₜ
```

Here hₜ is a scalar state, aₜ controls retention of the preceding state, and bₜ supplies the new contribution. The initial state can be specified separately; the paper generally assumes a zero initial state unless stated otherwise.

Repeated substitution produces a lower-triangular matrix whose entries are products of the a terms. Multiplication by that matrix is equivalent to evaluating the recurrence.

This primitive includes cumulative addition when the retention factors are the multiplicative identity. It also connects to cumulative multiplication when the additive contribution vanishes. The paper calls the general operation a cumulative product sum, or cumprodsum.

The scalar case is important because both diagonal state space computation and the proposed SSD algorithm can reduce parts of their work to independent copies of this operation. It provides the connection between a structured mask and a recurrent update.

#### Recast attention as a contraction

The conventional softmax attention expression is:

```
Y = softmax(QKᵀ)V
```

Here Q contains queries, K contains keys, and V contains values. QKᵀ forms pairwise scores between positions, softmax normalizes those scores, and multiplication by V combines the corresponding values into Y.

The paper’s exact duality concerns kernel attention instead of this complete softmax transformation. Kernel attention uses feature representations of queries and keys so that their interaction is expressed by an inner product. The feature map is absorbed into Q and K for the theoretical discussion.

With a positional or causal mask, the operation becomes:

```
Y = (L ∘ QKᵀ)V
```

Here L is the mask matrix, and ∘ means elementwise multiplication. Q, K, V, and Y retain their roles. The mask specifies how strongly each source position can influence each target position.

The same operation can be expressed through tensor contraction:

```
Y = contract(TN, SN, SP, TS → TP)(Q, K, V, L)
```

Here T is the target length, S is the source length, N is the query-and-key feature dimension, and P is the value dimension. The labels describe which axes each argument carries. Axes absent from the output are summed over; TP identifies the output axes.

This notation exposes the available calculation orders. One can first combine queries and keys into pairwise scores, apply the mask, and then combine values. Alternatively, one can expand values using keys, apply the mask across positions, and contract the expanded representation using queries.

The function remains the same. The intermediate arrays and execution cost change.

#### Generalize the mask rather than only the features

For ordinary causal linear attention, L is the lower-triangular matrix that permits every earlier position to contribute. Multiplication by this matrix is a cumulative sum. That is the operation that makes the alternate contraction order efficient.

The authors generalize this observation. The mask need not contain identical allowed entries. What matters computationally is whether multiplying by L has a fast structured algorithm.

Structured masked attention therefore permits a broader class of masks. The paper discusses decay masks, Toeplitz structure, and Fourier structure as examples of different possible positional interactions. The proposed SSD operation concentrates on a semiseparable mask.

This is a useful shift in emphasis. A mask is usually introduced as a restriction on attention. Here it also becomes an algorithmic object: its representation determines whether the operation can be calculated efficiently without expanding all position pairs.

The distinction between subquadratic evaluation and efficient generation remains important. A structured mask may support a fast complete-sequence algorithm without necessarily having the bounded recurrent form needed for constant-cost incremental updates.

#### Restrict transitions to obtain SSD

The crucial state space specialization is:

```
Aₜ = aₜI
```

Here Aₜ is the transition at position t, aₜ is a scalar, and I is the identity matrix over the state dimension. Every state coordinate within the head therefore receives the same decay factor at that position.

This is more restrictive than giving each state coordinate its own diagonal transition. The benefit is that the transition product can be separated from the interaction between the input expansion and output readout.

The resulting sequence matrix is:

```
M = L ∘ (CBᵀ)
```

Here M is the sequence transformation, B and C contain the position-specific state expansion and readout vectors, and L contains the accumulated scalar transitions. The transpose converts the pairwise inner products between C and B into a matrix over positions.

For the causal case, the mask entries are:

```
Lᵢⱼ = aᵢ × ⋯ × aⱼ₊₁ for i ≥ j; Lᵢⱼ = 0 for i < j
```

Here i is an output position and j an input position. Each a term is the scalar transition encountered between them. The empty product on the diagonal is the multiplicative identity. The overview describes these input-dependent factors as bounded in [0, 1].

This is precisely a masked kernel-attention expression under the correspondence between C and queries, B and keys, and X and values. The recurrence and attention-like calculation are exact alternatives for this specified transformation.

The decay products also provide positional information. Distance matters through the transitions encountered, and those transitions depend on the input. Thus positional influence is governed by retained information, rather than added solely through a fixed positional convention such as the rotary embeddings associated with [RoFormer](https://md.research.elamur.ai/free/en/papers/su-2021-roformer-enhanced-transformer-rotary-position/).

#### Combine the forms through blocks

Neither evaluating every position recurrently nor constructing the complete pairwise matrix makes the best use of the duality. The proposed algorithm divides the sequence into chunks.

Computing SSD through chunks and boundary states The steps in order.

The first part calculates each chunk as though its incoming state were zero. This accounts for every influence originating within that chunk. Since these are short, independent subproblems, their attention-like form can use batched matrix multiplication efficiently.

The second part calculates what each chunk contributes to its outgoing state, again assuming a zero incoming state. This compresses its inputs into the information needed by later chunks.

The third part combines those summaries with the transition across chunk boundaries. It is a recurrence over chunks rather than over individual tokens. The operation can use the scalar scan methods discussed in the appendix.

The final part maps the correct incoming state into each chunk’s outputs. Adding that contribution to the locally calculated output accounts for both sources of influence: inputs within the chunk and inputs before it.

This decomposition follows the matrix structure directly. Diagonal blocks contain within-chunk interactions. Off-diagonal blocks factor through the recurrent state. Their low-rank representation makes it unnecessary to calculate every cross-chunk pair separately.

The paper illustrates the decomposition with T=9 and chunk length Q=3. The example is small enough to display all blocks, but its purpose is general: every later chunk receives earlier information through the boundary-state factorization.

#### Track dimensions and computational cost

The authors distinguish state expansion N, head width P, and chunk length Q. The hidden state associated with a head has shape (N, P). It stores an expanded representation for each value channel.

A convenient balanced setting is:

```
N = P = Q
```

Here N is the state dimension, P is the head dimension, and Q is the chunk length. Matching them makes the major batched multiplications operate on similarly shaped matrices.

In that setting, the principal training arithmetic scales as:

```
Training FLOPs = O(TN²)
```

Here T is sequence length, N is the state dimension, and O expresses asymptotic growth. The quadratic dependence is on state width, while dependence on sequence length remains linear.

The principal complete-sequence memory requirement scales as:

```
Training memory = O(TN)
```

Here T and N retain those meanings. This matches the size order of the input and output when the head dimension equals N.

The persistent recurrent state has the following size order:

```
Inference state memory = O(N²)
```

Here N again denotes state dimension under the balanced head-width setting. This is independent of how many sequence positions have already been processed.

These expressions should be read with their dimensions attached. Linear sequence scaling does not mean that increasing the state is free. SSD improves the hardware execution of the expanded state computation and avoids storing every intermediate state, but capacity still carries arithmetic and storage costs.

The recurrence between chunks operates on a shorter sequence of summaries. The authors report that this residual scan contributes little to the GPU implementation’s overall work. Most computation takes the form of matrix multiplication.

#### Turn the operation into the Mamba-2 block

The SSD operation is only the inner sequence transformation. Mamba-2 also changes how the surrounding block produces its inputs.

In Mamba, an initial projection produces the sequence that enters a convolution, and selective parameters are subsequently derived from that branch. This creates a dependency between the expanded input and the parameter projections.

Mamba-2 derives the selective parameters directly from the original block input. The projections that produce A, B, C, and X can therefore occur together at the entrance. This arrangement reduces parameters slightly and makes the block easier to partition between devices.

The block retains a gating branch and places an additional normalization before the final output projection, after the multiplicative gate. The authors report that preliminary larger-scale experiments motivated this change because of training instability.

The architecture also adopts head dimensions more like those used in attention. Original Mamba has P=1, so each channel has separate dynamics. SSD commonly uses P values of 64 or 128, sharing a sequence transformation across a wider group of channels.

#### Make head sharing explicit

A head pattern specifies which tensors vary independently across heads. In a fully multi-head arrangement, each head has its own input, expansion, and readout parameters.

Other arrangements share some tensors. A multi-contract pattern varies the readout across heads while sharing input and expansion. A multi-expand pattern varies the expansion instead. The multi-input pattern gives heads different input channels while sharing B and C.

That last pattern corresponds to the arrangement inherited from Mamba. In attention terminology, the authors call it multi-value attention. The paper finds it preferable among the tested alternatives.

The connection also supports grouped variants. As with [grouped-query attention](https://md.research.elamur.ai/free/en/papers/ainslie-2023-gqa-training-generalized-multi-query/), some parameters can be shared within groups rather than across all heads. Mamba-2 uses the analogous grouped-input or grouped-value vocabulary.

This sharing structure matters for distributed execution. A device can hold complete local heads or groups and calculate their selective dynamics without first recovering a tensor distributed across other devices.

#### Extend the same decomposition to systems

Tensor parallelism divides a layer’s work across devices. In the original Mamba dependency structure, the selective projections create an internal communication requirement, in addition to the communication needed to combine final outputs.

Mamba-2’s entrance projections permit the local pieces to be generated independently. With appropriately grouped normalization, the block requires only the final output reduction. The architecture therefore addresses synchronization through its dependency graph.

For long sequences, context parallelism uses the same principle as chunking. A device processes a sequence segment, and its influence on the following segment is represented by a recurrent state. The paper contrasts this with attention, where query blocks must interact with key blocks distributed across workers.

Variable-length processing follows from state control. Several examples can be concatenated into a longer stream, provided information is prevented from crossing example boundaries. The paper describes doing this by zeroing the transition at the appropriate boundary so that unrelated sequences do not share recurrent history.

These are architectural and algorithmic capabilities. Their presence should not be confused with a reported end-to-end distributed scaling result for every system configuration.

#### Train and evaluate the resulting architecture

The main language experiments use the Pile. Scaling experiments use the GPT2 tokenizer and training-token budgets that increase with parameter count under the Chinchilla protocol. Fully trained downstream systems use the GPT-NeoX tokenizer and 300B training tokens.

Training uses AdamW, a gradient clipping value of 1.0, weight decay of 0.1, and no dropout. The learning rate warms up and then follows cosine decay. The improved recipe includes RMSNorm, removal of linear biases, and larger peak learning rates than the corresponding GPT3 settings.

The synthetic recall experiments follow a separate curriculum. They vary how many associations must be remembered, use random distractor tokens, and sweep learning rates and widths. This creates an evaluation of context memory that is more targeted than general language pretraining.

The authors released the [implementation](https://github.com/state-spaces/mamba) and pretrained checkpoints through the state-spaces/mamba repository. That release supports examination of both the inner SSD calculation and the larger architecture described by the paper.

### Experiments and results

#### Distinguish the questions being measured

The evaluation addresses several questions that should remain separate. Synthetic associative recall tests whether information survives in context. Pile perplexity measures predictive quality during language pretraining. Zero-shot tasks examine transfer to downstream evaluations. Kernel benchmarks measure execution speed.

Improvement on one axis does not establish improvement on every other axis. A faster scan does not by itself demonstrate better language prediction, and better average perplexity does not prove that every earlier association can be recovered.

The paper is strongest when these results are read together. SSD makes a larger state practical; the recall experiments show why that additional capacity can matter; the language experiments check that the revised architecture remains competitive on broader prediction tasks.

#### Associative recall under crowded conditions

The multi-query associative recall task presents key–value associations and later asks for the value corresponding to a previously encountered key. Several associations must remain available simultaneously.

The authors use a more difficult setup than the usual variant discussed in their background. Positions outside the associations and queries contain random tokens. The experiments also increase association counts and sequence lengths while using small networks.

Sequence lengths are 256, 512, and 1024. The evaluation uses T/4 key–value pairs for a sequence of length T, and the vocabulary contains 8192 entries. These conditions make the task a direct test of retaining many distinct associations among distractors.

The curriculum cycles through datasets with T/32, T/16, T/8, and T/4 associations. Each dataset contains roughly 250,000 examples, and training makes 8 passes through each. The paper describes roughly 270M examples overall.

All compared systems use 2 layers. Widths are swept over 32, 64, 128, and 256. The attention baseline receives positional embeddings, and the comparison also includes Based, which combines several sequence-processing mechanisms.

Mamba-2 performs substantially better than Mamba-1 in this setup. The improvement persists when the state dimension is held at N=16. This is an important control because it shows that the result cannot be attributed entirely to allowing a larger state.

Increasing Mamba-2’s state dimension to N=64 and N=256 further improves recall. This supports the proposed relationship between state capacity and the number of associations that can be retained.

The authors also report strong performance relative to vanilla attention in the synthetic comparison. That result belongs to this deliberately constrained task, architecture size, and training procedure. It should not be generalized into a claim that compressed recurrence is universally better at retrieval.

#### Scaling language prediction on the Pile

The scaling experiments compare Mamba-2 with Mamba and Transformer++. The latter is a strengthened Transformer recipe incorporating choices associated with PaLM and LLaMa, rather than only an older baseline configuration.

The plotted range runs from approximately 125M to approximately 1.3B parameters. Training budgets follow the Chinchilla approach, so larger systems receive proportionally more tokens. The scaling setup uses the GPT2 tokenizer.

The authors assess quality through perplexity. Lower perplexity means that the trained system assigns greater probability to the evaluation sequence under the paper’s language-prediction objective.

They report that Mamba-2 matches or improves on Mamba and Transformer++ across the studied scaling comparisons. The paper describes a favorable frontier when quality is compared against theoretical computation and actual training time.

That conclusion is conditional on the training recipes and parameter range. It is evidence that the hardware-oriented restrictions in SSD do not erase language quality in these experiments. It is not evidence about every larger scale or every possible training allocation.

The choice of Transformer++ matters to interpretation. The comparison includes a stronger recipe with rotary embeddings, gated feed-forward computation, and revised normalization. The reported competitiveness is therefore more informative than a comparison restricted to the standard GPT3 architecture.

#### Fully trained downstream evaluations

For downstream evaluation, Mamba-2 is trained on 300B Pile tokens with the GPT-NeoX tokenizer. Pythia is a particularly informative baseline because the paper identifies matching data, tokenizer, and training length.

The evaluations use the EleutherAI language evaluation harness. The tasks include LAMBADA, HellaSwag, PIQA, and [WinoGrande](https://md.research.elamur.ai/free/en/papers/sakaguchi-2019-winogrande-adversarial-winograd-schema-challenge/). Additional evaluations cover the ARC variants and OpenBookQA.

The paper reports that Mamba-2 improves on Mamba at the corresponding sizes and generally reaches the level of larger Pythia systems. Its highlighted example is Mamba-2 at 2.7B parameters, which exceeds the reported downstream performance of Mamba-2.8B, Pythia-2.8B, and Pythia-6.9B.

The Pile perplexity comparison uses the validation split and is restricted to systems with the matching dataset and tokenizer specified by the authors. This restriction is necessary because [tokenization](https://md.research.elamur.ai/free/en/concepts/tokenization/) changes the units over which prediction probabilities are evaluated.

The downstream results complement perplexity, but remain benchmark evidence. They show that the revised architecture’s gains are not confined to the synthetic task or to its internal training objective. They do not establish comprehensive language understanding or exhaustive context retrieval.

#### What the execution benchmarks establish

The core speed comparison evaluates SSD against Mamba’s fused selective scan and FlashAttention-2. SSD gains access to tensor cores by organizing its principal work as matrix multiplication.

Against the fused scan, the reported speed advantage is 2–8×. The paper also emphasizes the ability to increase state expansion substantially with little slowdown, whereas the selective scan becomes slower as that expansion grows.

The state-expansion benchmark fixes sequence length at 4K. This isolates the execution consequences of increasing memory capacity, instead of changing capacity and sequence length simultaneously.

Against FlashAttention-2, SSD becomes faster around sequence length 2K. At 16K, the introduction reports a 6× advantage. These results support the claim that the blocked algorithm combines favorable sequence scaling with effective hardware execution.

The authors add an important qualification about complete-network speed. A Transformer typically alternates attention and feed-forward layers, while a pure Mamba-2 architecture uses SSD blocks throughout. Feed-forward layers are highly efficient matrix computations. A favorable SSD-versus-attention kernel comparison therefore does not guarantee that the complete pure Mamba-2 architecture trains faster at a short context such as 2K.

#### Capacity accounting in the kernel experiments

The feature-map experiments provide a concrete comparison of the state dimensions produced by different constructions. This is a capacity measurement, instead of a quality score.

Resulting state dimension in the 130M kernel ablation The Taylor construction produces a different state dimension from the direct and quadratic settings.

**The numbers**

| System or setting | state dimensions |
| --- | --- |
| Mamba-2 default (this paper) | 64 |
| ReBased quadratic map | 64 |
| Based Taylor map | 73 |

In the 130M setting, the expanded kernel variants first project into 8 dimensions. The paper explicitly gives the resulting dimensions as 64 for ReBased and 73 for Based. The direct Mamba-2 comparison uses N=64.

Here, “higher” indicates additional state coordinates, not an established quality ranking. The authors do not find that the more elaborate feature construction clearly improves the trained system. The comparison instead shows why feature-map experiments must account for the state actually produced after expansion.

### What the ablations show

#### Parallel projections help beyond implementation convenience

The block ablations examine the changes surrounding the inner sequence operation. The authors keep SSD as the internal transformation while comparing the alternative block arrangements.

This control is essential. Comparing complete Mamba-1 and Mamba-2 architectures would change both the sequence operation and its surrounding projections. It would therefore be difficult to identify which part caused a measured difference.

Producing selective parameters alongside the main input projection slightly improves quality and reduces parameters. Its larger practical advantage is compatibility with tensor parallelism: local projections no longer depend on reconstructing the expanded input branch across devices.

The result illustrates that a systems-motivated modification can also be neutral or favorable for predictive quality. It does not establish that entrance projections would improve every recurrent architecture, because the experiment concerns the particular SSD block and training setup.

#### The extra normalization addresses a distinct problem

The additional normalization yields a modest quality improvement in the reported ablation. The authors also connect it to improved stability in preliminary experiments at larger scale.

These are related but different observations. A lower evaluation loss after training is an outcome metric. Avoiding instability concerns whether training proceeds reliably at all.

The placement matters. Mamba-2 applies the added normalization after the multiplicative gate and before the final projection. This is not identical to normalizing the attention kernel or dividing by a softmax-like denominator.

The paper relates the change to NormFormer and to normalization choices in attention-derived recurrent systems. That connection provides motivation, while the controlled block comparison supplies evidence for the chosen arrangement.

#### Equal state capacity does not imply equal quality

The head-pattern ablations compare different allocations of independent and shared projections. All tested patterns retain distinct decay parameters across heads.

The authors control total recurrent capacity through the product of head count, head width, and state dimension:

```
Total state size = HPN
```

Here H is the number of heads, P is the input or value width within each head, and N is the state dimension. The expression counts the expanded recurrent state across heads.

Despite matching this quantity, the multi-input or multi-value pattern performs better than the multi-query and multi-key alternatives. The fully multi-head variants fall between these choices.

The reported head experiments use N=64 and P=64. They include 125M systems trained on 2.5B tokens and 360M systems trained on 7B tokens.

The implication is structural. Capacity depends not only on how many state coordinates exist but also on how inputs enter them and how outputs read them. Sharing B and C while varying the input channels imposes a different organization from varying B or C while sharing the inputs.

The authors also examine aggressive sharing in which B, C, and X each have a shared head. Distinct A parameters still give separate sequence transformations. Once parameter counts are matched, these multi-head arrangements perform similarly to each other.

This analysis cautions against transferring multi-query attention mechanically. Its cache-saving motivation in attention does not automatically make it the best sharing pattern for an SSM.

#### Kernel approximations do not provide the expected gain

The paper tests feature maps associated with cosFormer, Random Feature Attention, and Performer. It also examines Based and ReBased constructions that expand the feature representation.

These experiments are motivated by the SSD–attention connection. If B and C play roles corresponding to keys and queries, methods that modify query–key interactions become available as architectural variants.

Based uses a Taylor approximation to the exponential interaction:

```
exp(x) ≈ 1 + x + x²/2
```

Here x is a scalar interaction value, exp is the exponential function, and the right-hand side is the quadratic approximation considered in the ablation.

Its corresponding feature construction is:

```
ψTaylor(x) = concatenate(1, x, (1/√2)(x ⊗ x))
```

Here x is a feature vector, ⊗ denotes its outer product with itself, and concatenate joins the constant, linear, and quadratic features. ψTaylor names the resulting feature map.

ReBased instead uses a quadratic feature representation with preceding layer normalization. The authors interpret that normalization as an alternative to the default pointwise activation.

The feature expansions require smaller initial B and C projections to keep capacity and parameter budgets comparable. The authors adjust layer counts where necessary because those smaller projections also change parameter counts.

Overall, the tested approximation methods do not clearly beat simpler pointwise nonlinearities. The default remains Swish, following the earlier Mamba convention. The authors suggest that omitting the activation might be worth examining, but do not establish that as a preferred replacement.

#### A softmax-like denominator can destabilize training

The authors also test normalizing the attention-like interaction by a denominator. Computationally, the denominator can be obtained by applying the same transformation to a constant input channel.

This is an elegant reuse of the sequence operation, but its numerical behavior is a separate question. Most tested variants become unstable when the denominator is added. ReLU receives a small benefit.

The negative result should remain specific. It concerns the normalization choices tested inside SSD. It does not establish that all normalized linear attention is unstable or that every possible SSD normalization would fail.

The authors suggest a reason that direct transfer may disappoint: many kernel methods were designed around approximating softmax attention without SSD’s additional input-dependent mask. Once the mask changes the interaction, a more faithful softmax approximation need not be a better objective.

#### A little attention improves the hybrid

The controlled hybrid experiments hold parameter count, training conditions, and data fixed while varying layer composition. This makes them particularly useful for understanding whether SSD and attention supply interchangeable behavior.

At 350M parameters, the authors use 48 layers and train on 7B Pile tokens with the GPT-2 tokenizer. The best tested balance places approximately 10% of layers in attention.

At the 2.7B scale, the comparison uses 64 layers and 300B Pile tokens. Pure Mamba-2 uses 64 SSD layers. Its attention hybrid uses 58 SSD layers and 6 attention layers. The authors report that this small addition improves quality over both pure Mamba-2 and Transformer++.

Their interpretation is that SSD provides an effective general sequence transformation, while attention allows direct reference to earlier context. This is a hypothesis consistent with the result, rather than a demonstrated decomposition of what individual layers learn.

Replacing some SSD computation with gated feed-forward layers reduces quality in the reported comparison but can improve execution efficiency. The experiments therefore expose a practical design space rather than identify a universally optimal block mixture.

### Limitations

#### The authors explicitly restrict the attention equivalence

The title is broader than the exact mathematical result. The authors explain that the connection concerns selected attention variants. SSD does not contain standard softmax attention as a general special case.

The exact duality requires the specified finite-feature kernel formulation and structured mask. From the state space side, the implemented SSD operation uses scalar-identity transitions. These restrictions are central to obtaining the attention-like matrix form.

The authors also acknowledge the expressivity tradeoff relative to Mamba’s more general diagonal transitions. Sharing a scalar transition across state coordinates gives up some flexibility in exchange for efficient matrix computation.

This does not mean that the resulting architecture must have worse language quality. The experiments show that it can remain competitive while gaining execution efficiency. It does mean that the theoretical connection should not be extended beyond its assumptions.

#### The converse theorem uses a technical recurrence definition

The paper characterizes efficient autoregressive transformations using a bounded-order dependence on previous outputs:

```
yₜ = μₜxₜ + ℓₜ₁yₜ₋₁ + ⋯ + ℓₜₖyₜ₋ₖ
```

Here xₜ is the current input, yₜ the current output, μₜ its direct-input coefficient, and ℓₜⱼ the coefficient on an earlier output. The parameter k bounds how many preceding outputs appear.

Under this definition, the paper derives a semiseparable representation. The result explains why a bounded recurrent mask has the relevant matrix structure.

A careful reading should retain the definition when repeating the theorem. It is not an unrestricted classification of every possible nonlinear sequence system or every conceivable fast generation algorithm.

The authors themselves introduce the definition as technically narrow. Their broader motivation concerns efficient recurrence, but the formal conclusion follows from the stated linear autoregressive setting.

#### Fixed memory remains a representational constraint

The authors explicitly contrast SSD’s selected state size with attention’s growing cache. SSD retains a compressed history whose capacity is controlled through N. Attention preserves access to the earlier representations.

The recall experiments demonstrate that increasing the state helps and that Mamba-2 improves over Mamba-1. They do not remove the underlying requirement to compress history.

The paper discusses copying and in-context learning as areas where the difference remains important, citing [Repeat After Me](https://md.research.elamur.ai/free/en/papers/jelassi-2024-repeat-after-me-transformers-better/). Its own results leave open how broadly the MQAR improvement transfers to other forms of exact contextual retrieval.

The authors also do not identify which architectural change explains Mamba-2’s recall advantage when state size is controlled. That uncertainty prevents a simple causal account of the improvement.

#### Kernel acceleration and application acceleration differ

The authors explicitly note the whole-network issue at short sequence lengths. An SSD layer can compare favorably with attention while a pure SSD network remains less efficient than a Transformer whose layer budget includes highly efficient feed-forward computation.

A careful-reader limitation follows: kernel benchmarks should not be treated as universal application-speed multipliers. End-to-end performance also depends on layer composition, projections, normalization, sequence length, and implementation.

Likewise, fixed-size state does not mean negligible memory. Larger N increases recurrent storage, and the number of heads and head width also contribute. The gain is independence from processed sequence length, with a chosen capacity cost.

The theoretical efficiency result for unrestricted state space transitions has another explicit qualification: preprocessing is excluded. The paper notes that such preprocessing can be expensive and hardware-unfriendly. The practical algorithm therefore relies on additional structure.

#### The experimental scope bounds the quality claims

The principal language evidence concerns the Pile and the reported architecture sizes and training budgets. The scaling comparison and downstream pretraining also use different tokenizer settings for their respective purposes.

A careful reader should therefore interpret the results within those evaluation regimes. They do not establish the same quality–efficiency ordering for every corpus, language, context requirement, or deployment workload.

The benchmark suite broadens the evaluation beyond perplexity, but it is still a finite collection of tasks. Strong zero-shot results do not establish comprehensive reliability, and favorable synthetic recall does not settle all memory-intensive behavior.

The distributed-execution sections describe mechanisms for tensor parallelism, context partitioning, and variable-length processing. They should not be read as a complete empirical characterization of distributed scaling under every device count or interconnect.

#### Several proposed directions remain open

The authors suggest extending structured-matrix algorithms to more general diagonal transitions. They also propose exploring other structured masks, noncausal variants, and additional representations of semiseparable matrices.

These are research directions, not demonstrated extensions of the released method. Likewise, the paper raises the possibility of transferring [interpretability](https://md.research.elamur.ai/free/en/topics/interpretability/) methods from attention to state space systems without establishing that the resulting explanations are sufficient.

The work’s most defensible general claim is methodological: identifying the structured transformation exposes useful algorithms and architectural choices. The success of each further transfer still requires its own analysis and experiment.

### What came after

#### Hybrid architectures became a clear direction of follow-up

The later research record includes several works whose stated subjects combine Mamba-style recurrence with attention. Their titles support identifying a common direction, while offering less detail about exactly which SSD mechanisms each adopts.

[An Empirical Study of Mamba-based Language Models](https://md.research.elamur.ai/free/en/papers/waleffe-2024-empirical-study-mamba-based-language/) places the family under broader empirical examination. Its connection to this paper is the need to evaluate architectural tradeoffs beyond a single inner operation. SSD supplies a mathematical account and an efficient building block; empirical studies ask how such building blocks behave as complete language systems.

[Jamba-1.5](https://md.research.elamur.ai/free/en/papers/lenz-2024-jamba-1-5-hybrid-transformer/) explicitly studies hybrid Transformer–Mamba systems at scale. This follows a direction already supported by the SSD paper’s controlled mixtures: compressed recurrent processing and direct attention can coexist in one architecture. The later title does not establish that it uses the same layer proportions or the same SSD implementation.

[Hymba](https://md.research.elamur.ai/free/en/papers/dong-2024-hymba-hybrid-head-architecture-small/) and [Falcon-H1](https://md.research.elamur.ai/free/en/papers/zuo-2025-falcon-h1-family-hybrid-head/) both identify hybrid-head design as their subject. That makes them relevant to a distinct part of the SSD contribution: treating head structure and parameter sharing as explicit architectural choices. Their titles alone do not specify which tensors are shared or how their arrangements compare with Mamba-2’s multi-input pattern.

[Nemotron-H](https://md.research.elamur.ai/free/en/papers/blakeman-2025-nemotron-h-family-accurate-efficient/) and [NVIDIA Nemotron Nano 2](https://md.research.elamur.ai/free/en/papers/basant-2025-nvidia-nemotron-nano-2-accurate/) likewise present hybrid Mamba–Transformer architectures. The latter additionally identifies reasoning as part of its focus. These works illustrate the continued relevance of hybrid design, but the available descriptions do not support assigning specific quality or efficiency gains to their use of SSD.

#### Distillation asks how knowledge moves between architectures

[The Mamba in the Llama](https://md.research.elamur.ai/free/en/papers/wang-2024-mamba-llama-distilling-accelerating-hybrid/) addresses distillation and acceleration of hybrids. [Transformers to SSMs](https://md.research.elamur.ai/free/en/papers/bick-2024-transformers-ssms-distilling-quadratic-knowledge/) directly frames the problem as transferring knowledge from quadratic computation into a subquadratic architecture.

These subjects extend a question made sharper by SSD. Mathematical equivalence explains an intersection between certain transformations, but it does not make trained softmax-attention parameters automatically interchangeable with recurrent parameters.

Distillation approaches that boundary from the training side. The stated objective is to transfer useful behavior across architectures with different history representations. This is distinct from merely choosing a faster algorithm for the same SSD function.

The connection is therefore conceptual and practical: SSD identifies what can already be shared exactly, while distillation investigates how behavior beyond that intersection might be transferred through learning. The titles do not establish how completely such transfer succeeds.

#### Efficient attention continued along several paths

[Kimi Linear](https://md.research.elamur.ai/free/en/papers/kimi-team-2025-kimi-linear-expressive-efficient/) presents an attention architecture organized around expressivity and efficiency. [MiniMax-01](https://md.research.elamur.ai/free/en/papers/minimax-2025-minimax-01-scaling-foundation/) and [MiniMax-M1](https://md.research.elamur.ai/free/en/papers/minimax-2025-minimax-m1-scaling-test/) identify lightning attention as a central component, with the latter also focusing on test-time computation.

These works belong to the wider research area illuminated by SSD: sequence operations whose execution differs from conventional dense softmax attention. The supplied titles do not establish equivalence to SSD or identify their masks and recurrent transitions.

[MoBA](https://md.research.elamur.ai/free/en/papers/lu-2025-moba-mixture-block-attention/) focuses on mixtures of block attention for long contexts. [MInference 1.0](https://md.research.elamur.ai/free/en/papers/jiang-2024-minference-1-0-accelerating-pre/) instead targets long-context prefilling through dynamic sparse attention.

Their relationship to SSD is useful precisely because the mathematical choices differ. SSD exploits a structured factorization through recurrent state. The later titles identify block selection and sparsity as other ways to reduce attention-related cost. A citation connection does not make these mechanisms the same.

Together, these directions reinforce the paper’s distinction between an operation’s function and its execution strategy. Efficiency can come from changing which interactions exist, compressing how interactions are represented, or choosing a better calculation order. Those choices require separate analysis.

#### Systems work pursued communication and serving

[Linear Attention Sequence Parallelism](https://md.research.elamur.ai/free/en/papers/sun-2024-linear-attention-sequence-parallelism/) is directly aligned with the SSD paper’s discussion of distributing sequence computation. Its title identifies linear attention and sequence partitioning as the focus.

The shared question is what information must cross a device boundary. SSD’s answer is a recurrent state that summarizes the preceding segment. The later work’s title supports the relevance of the problem, without specifying that it uses precisely the same state-passing algorithm.

[Mooncake](https://md.research.elamur.ai/free/en/papers/qin-2024-mooncake-kvcache-centric-disaggregated-architecture/) studies a serving architecture centered on the key–value cache. That subject highlights the other side of SSD’s memory comparison: architectures that retain token history must organize and move that history efficiently.

This is a systems complement to the state space argument. Compressing history changes the storage requirement; improving a cache-centered serving design addresses the cost of retaining it. The later title does not establish a measured comparison between those choices.

[KernelBench](https://md.research.elamur.ai/free/en/papers/ouyang-2025-kernelbench-llms-write-efficient-gpu/) asks whether language systems can produce efficient GPU kernels. Its connection is to the implementation layer on which SSD’s practical gains depend. The paper’s mathematical improvement matters because it exposes matrix operations that can be implemented effectively; evaluating kernel generation concerns how well such implementation work can be performed.

#### Evaluation and interpretation remained necessary

[HELMET](https://md.research.elamur.ai/free/en/papers/yen-2024-helmet-evaluate-long-context-language/) focuses on thorough long-context evaluation. [How to Train Long-Context Language Models](https://md.research.elamur.ai/free/en/papers/gao-2025-how-train-long-context-language/) addresses the corresponding training problem.

Both subjects matter to the limits of SSD’s original evidence. Efficient processing of a longer sequence is a computational capability. Learning to use that sequence and demonstrating reliable access to its information require training and evaluation suited to those questions.

[The Hidden Attention of Mamba Models](https://md.research.elamur.ai/free/en/papers/ali-2025-hidden-attention-mamba-models/) takes up the attention perspective on Mamba. The SSD paper itself discusses this work in connection with transferring interpretability ideas. It is therefore more accurately treated as a related line of investigation than as evidence of a simple chronological progression from SSD.

The sequence-matrix formulation explains why that line is plausible: recurrence can be expressed through contributions between positions. But obtaining an attention-like representation does not, on its own, establish how faithfully a visualization explains the full neural computation.

Across these follow-ups, the recurring contribution of SSD is a set of precise questions. What history is retained? Through which state or interaction structure does it pass? Which parts can be calculated independently? What behavior is lost or gained when the representation changes? Those questions connect architecture, training, evaluation, and implementation without assuming that every efficient sequence system solves them in the same way.

## Cite

Cite as Tri Dao and Albert Gu. 2024. Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality. arXiv:2405.21060.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.48550/arxiv.2405.21060](https://doi.org/10.48550/arxiv.2405.21060) · [arXiv 2405.21060](https://arxiv.org/abs/2405.21060)

```bibtex
@misc{dao2024transformers,
  title = {{Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality}},
  author = {Tri Dao and Albert Gu},
  year = {2024},
  doi = {10.48550/arxiv.2405.21060},
  eprint = {2405.21060},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2405.21060}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
