Manuscript Offprint

arXiv:2611.03101

Diagonal Equivalence in State Space Models: Characterization, Retrieval Rank, and Selective Extensions

Dennis Rochau

Abstract

We classify real and complex state-space models (SSMs) with linear transitions, distinguishing fixed-basis diagonal equivalence from input-output equivalence and tracking coefficient-conditioning windows under coordinate changes. We characterize diagonal equivalence through commuting transition families whose members are diagonalizable over the chosen field. With time-shared token-local matrix maps, we identify this class's state-mediated kernels with unnormalized scalar-mode linear attention with multiplicative masks. Mamba 3's multiple-input, multiple-output (MIMO) construction lifts one value per local interface; SSD-MIMO routes independent values for local retrieval rank above one. HybridMamba combines Mamba 1's per-coordinate decay, Mamba 2-style heads and Mamba 3's complex rotations and two-endpoint writes, mixing real and rotating state blocks with different decay laws. They recover Mamba 1–3 single-input, single-output (SISO) configurations as exact special cases. On five large H100 bfloat16 workloads, our fused GPU kernels improve geometric-mean training time over official Mamba 1/3 in matched SISO recoveries, with Mamba 2 near parity at SSM-core scope. Memory tradeoffs depend on the baseline and metric: saved-for-backward versus peak allocation. In small-model multi-token recall experiments, both designs outperform Mamba 1–3 on the hardest tier; higher routing ranks perform best in gated or phase-diverse configurations. In single-seed language models with about 500M parameters, both improve on Mamba 1/2 in test loss at 2B tokens, but the routing gains do not translate into lower language-model loss. Our best configurations approach Mamba 3 SISO through 10B tokens while remaining behind it and Mamba 3 MIMO in language-model loss.

1 Introduction

Selective state-space models (SSMs) process sequences through a fixed-size recurrent state, with transition, write and read maps conditioned on a bounded window of inputs. They offer an alternative to the quadratic token interactions of dense self-attention (Vaswani et al., 2017; Dao et al., 2022; Dao, 2024). The state update remains affine in the state. Which state-space models are diagonal-equivalent, meaning that one fixed basis diagonalizes their transitions for every input and step? When can a model outside this class nevertheless admit an input-output-equivalent diagonal realization, and what coefficient-conditioning windows does that require? How can selective models within the class be extended?

For the fixed-basis question, the criterion is precise: over R\mathbb{R} or C\mathbb{C}, the entire realized transition family admits one diagonalizing basis exactly when its members commute pairwise and each is diagonalizable (Theorem 8). A transition need not be supplied as a diagonal matrix; what matters is one basis that works for every input and step. Noncommuting pairs therefore rule out diagonal equivalence for nondegenerate DeltaNet, DeltaProduct and RWKV-7 configurations, even when individual transitions are diagonalizable (Yang et al., 2024b; 2025; Siems et al., 2025; Peng et al., 2025). A defective transition obstructs diagonalization over both fields; over R\mathbb{R}, nonreal eigenvalues provide an additional obstruction.

LLM-based tools were used for manuscript revision, implementation assistance and consistency checks. The author reviewed the final content and takes responsibility for it.

Scalar interfaces: one value per state

SSD-MIMO: shared vector, sibling states

Figure

Figure 1: Local value routing, illustrated at equal total state width 4N. Left: four scalar interfaces, with Btr∈RN×1B_t^r \in \mathbb{R}^{N \times 1} and Ctr∈R1×NC_t^r \in \mathbb{R}^{1 \times N}. Right: one SSD-MIMO group at R=O=4R = O = 4 supplies the same vector to four sibling states, with Btr∈RN×4B_t^r \in \mathbb{R}^{N \times 4} and Ctr∈R4×NC_t^r \in \mathbb{R}^{4 \times N}, then combines their vector readouts as yt=∑rζr,tCtrhtry_t = \sum_r \zeta_{r,t} C_t^r h_t^r, with scalar sibling weights ζr,t\zeta_{r,t}. Both yield four output coordinates; parameter sharing and computation need not match; coefficient generation and feedthrough are omitted.

By this criterion, many widely used SSMs and gated linear recurrences, selective or not, are diagonal-equivalent (Table 1). The structured state space sequence model (S4) used a time-invariant SSM evaluated by convolution (Gu et al., 2022a) and belongs to this class when its learned transition is diagonalizable. Diagonal state spaces (DSS), diagonal S4 (S4D) and simplified state space layers (S5) developed diagonal and scan-based formulations (Gupta et al., 2022; Gu et al., 2022b; Smith et al., 2023). Mamba introduced input-dependent selection (Gu & Dao, 2024), Mamba 2 scalar-transition state space duality (SSD) (Dao & Gu, 2024), and Mamba 3 complex dynamics with a revised write rule (Lahoti et al., 2026). Further examples include the linear recurrent unit (LRU) (Orvieto et al., 2023), retention network (RetNet) (Sun et al., 2023), gated linear attention (GLA) (Yang et al., 2024a), matrix long short-term memory (mLSTM) (Beck et al., 2024), real-gated LRU (RG-LRU) (De et al., 2024), hierarchically gated recurrent network with state expansion (HGRN2) (Qin et al., 2024) and adaptive unitary state space model (AUSSM) (Karuvally et al., 2025). In a fixed diagonalizing basis, their recurrence cores therefore differ mainly in how they parametrize per-coordinate decay, phase, writes and reads.

Why the fixed basis matters. We study recurrences of the form

ht=Atht−1+Btut,h_{t}=A_{t}h_{t-1}+B_{t}u_{t}, yt=Ctht+Dtut,(1)y_{t}=C_{t}h_{t}+D_{t}u_{t}, \tag{1}

At one local interface in real state coordinates, ut∈RRu_t \in \mathbb{R}^R, ht∈RNh_t \in \mathbb{R}^N and yt∈ROy_t \in \mathbb{R}^O, with At∈RN×NA_t \in \mathbb{R}^{N \times N}, Bt∈RN×RB_t \in \mathbb{R}^{N \times R}, Ct∈RO×NC_t \in \mathbb{R}^{O \times N} and Dt∈RO×RD_t \in \mathbb{R}^{O \times R}. Thus RR counts supplied input features and OO counts local outputs; R=O=1R = O = 1 is the scalar, single-input, single-output (SISO) interface; R,O>1R, O > 1 gives a multiple-input, multiple-output (MIMO) interface, without requiring R=OR = O. The coefficient maps may depend on a wider conditioning input than utu_t.

Within the characterized class, one fixed change of coordinates turns the state evolution into independent diagonal recurrences and transforms the writes and reads accordingly. This fixed-basis property is stronger than input-output equivalence: with invertible transitions, a prefix-dependent change of state coordinates yields identity transitions and preserves outputs, but may require the full input prefix in the coefficient maps (Lemma 10). A fixed change of basis preserves the original conditioning window. Affine composition admits parallel scans for states and gradients even with non-diagonal transitions; diagonal structure makes the transition compositions coordinatewise, avoiding dense matrix products. Scalar transitions shared across state coordinates also yield a common history mask and the chunked matrix-multiply form of SSD (Dao & Gu, 2024); general diagonal transitions may require separate masks per coordinate, and coefficient sharing and map costs decide which form is efficient. With time-shared token-local maps, the state-mediated (write-state-read) kernels are exactly those of the masked linear attention class defined here. The correspondence preserves the complete output, including the initial-state contribution and direct feedthrough DtutD_{t}u_{t} (Theorem 24).

Our taxonomy records transition families, input windows and local interfaces, complementing dynamical-system (Sieber et al., 2024), structured linear controlled differential equation (Walker et al., 2025) and test-time regression (Wang et al., 2025) formulations.

Two axes within the class. Our designs extend different parts of this common structure (Figure 1; Section 5). SSD-MIMO routes multiple independent values through MIMO interfaces, with decay shared across state coordinates within each scan head; Mamba 3's implemented MIMO construction instead lifts one supplied scalar per subsystem. HybridMamba (HM) combines per-coordinate decay, head sharing, complex rotation and the two-endpoint write through SISO interfaces. Neither design combines full MIMO routing with independently selected per-coordinate decay. These are distinctions in local interfaces and transition structure, rather than a whole-architecture expressivity ordering.

Evidence and contributions. Multi-query, multi-key, variable-length associative recall (MQMKVAR) combines multi-query associative recall (MQAR)'s layout (Arora et al., 2023a) with the multi-token keys and variable-length values of Mechanistic Architecture Design (MAD)'s fuzzy in-context recall (Poli et al., 2024), introducing controlled prefix and substring overlap to test recall under ambiguous keys (Figure 2). We evaluate three difficulty tiers, routing width, gates and transition mixtures. Our contributions are:

  1. A structural framework and taxonomy. We distinguish fixed-basis diagonal equivalence from input-output equivalence and give a head-organized taxonomy of SSMs over R\mathbb{R} and C\mathbb{C} by transition families, coefficient-conditioning windows, and local state and interface widths (Section 3). Applying classical simultaneous diagonalization, we identify the diagonal-equivalent class and its obstructions. We place many established architectures within this class, including models formulated with non-diagonal transitions. We track how moving frames change coefficient windows, bound local retrieval rank and characterize token-local masked-linear-attention representations (Sections 2–4).

  2. Two designs with validated baseline recovery. We introduce SSD-MIMO to route multiple independent values through each local interface, and HybridMamba to combine per-coordinate decay, head sharing, complex rotations and two-endpoint writes within one model. Explicit parameter maps recover Mamba 1, Mamba 2 and Mamba 3 SISO in exact arithmetic. Copied-weight tests check outputs, input gradients and parameter gradients against the official implementations, with finite-precision agreement and its limits reported in Section 5.6.

  3. Optimized GPU kernels. Our native kernels support the two designs' real and complex dynamics, read/write gates, variable initial states and differentiable state continuation. SSD-MIMO supports SISO and MIMO interfaces, including unequal input and output widths (R≠OR \neq O). For SISO baseline recoveries on H100 with bfloat16 (bf16), we outperform the official Mamba 1 and Mamba 3 implementations in geometric-mean training speed at both scan and full-mixer scope across five workloads varying batch size, sequence length and inner model width. Our Mamba 2 recovery is near parity with the official implementation at scan scope but slower at full-mixer scope on average; individual shapes can reverse these speed comparisons. Section 5.5 reports per-shape times and memory.

  4. Multi-token recall findings. On MQMKVAR's multi-token, overlapping-key tasks, both designs outperform the Mamba 1–3 baselines on the hardest tier in our small-model setting. Routing two or four independent values per local interface gives SSD-MIMO its strongest results on the hardest tier; HybridMamba mixtures lead on the intermediate tier. These gains occur in configurations with write gates or differing sibling phases; their causal roles are not isolated. Section 6.1 defines the tiers and reports the shared learning-rate sweep and baseline budget differences.

  5. Language-modelling findings. In approximately 500M-parameter models trained on FineWeb-Edu (Penedo et al., 2024), both SSD-MIMO and HybridMamba improve on Mamba 1 and Mamba 2

Figure

Figure 2: MQMKVAR recall combines MQAR (Arora et al., 2023a) with MAD's fuzzy recall (Poli et al., 2024). Dashed outlines mark k11k8k_{11}k_8, a proper prefix of k11k8k3k_{11}k_8k_3; dotted outlines mark the longer key's suffix k8k3k_8k_3. Queries match keys from their first token. By convention, proper-prefix queries start their targets at the first padding token ∅\emptyset, which confirms key completion; other answers start at their last key token. Targets align with the input positions predicting them; “-” and all context positions carry no loss. Earlier answers never enter the query input. “…” elides context entries, queries and variable-length, loss-masked padding gaps between queries. Results: Section 6.1; protocol: Appendix E.1.

in test loss at 2B tokens under the same training recipe. HybridMamba with 75% complex dynamic rows stays near Mamba 3 SISO through 10B tokens, slightly behind on loss; the tested SSD-MIMO configurations also remain close, while Mamba 3 MIMO has the lowest loss. The recall gains from wider routing described above do not translate into lower language-model loss in these experiments. These comparisons use one training seed per configuration; downstream outcomes and the role of routing are discussed in Section 6.2.

Relation to prior analysis. The fixed-basis criterion is classical simultaneous diagonalization (Horn & Johnson, 2013, Sec. 1.3), and the local rank bound is the matrix-product rank inequality; held-input discretization and affine scans use variation of constants (Teschl, 2012, Ch. 3) and prefix composition (Blelloch, 1993, Sec. 1.4). S5 diagonalizes a multidimensional-input/output system (Smith et al., 2023, Sec. 3), and Sieber et al. (2024, Sec. 3) compare recurrent architectures in one representation.

Recurrent/attention correspondences include the recurrent evaluation of linear attention (Katharopoulos et al., 2020), SSD's structured and scalar-mask forms (Dao & Gu, 2024, Secs. 3–5) and its extension to diagonal SSMs with a necessary and sufficient condition for a 1-semiseparable masked-attention dual (Hu et al., 2025), implicit attention with surrounding gates and convolutions (Zimerman et al., 2024, Sec. 3), GateLoop's cumulative transitions (Katsch, 2023, Sec. 3.3) and Mamba 3's complex-to-rotary equivalences (Lahoti et al., 2026, Props. 2–4). Order restrictions from commuting dynamics are known for diagonal controlled differential equations (Cirone et al., 2024, Thm. 4.3), a simultaneously diagonalizable, zero-forcing automaton encoding (Terzić et al., 2025, Prop. 1) and finite-precision group tracking (Shakerinava et al., 2026, Sec. 4).

Building on these results, we make explicit the whole realized transition family, state field, conditioning window and supplied-value interface. We distinguish a fixed basis from a prefix-dependent frame, and a kernel factorization from one with token-local generating maps. Our interior-swap test excludes shared token-local scalar-mode representations of a given observable kernel.

Implementation. We implement SSD-MIMO and HybridMamba in a PyTorch library with fused Triton/Gluon GPU kernels (Tillet et al., 2019). The code is publicly available at https://github.com/d-rochau/0rbitSSM. The SSD-MIMO scan extends the SSD decomposition used by Mamba 2/3 to routed contractions, rotation and the two-endpoint write; one backward kernel is modelled on Mamba 3's. The per-coordinate scan extends Mamba 1's selective scan to rotation and mixed decay laws. Tuned for NVIDIA Hopper and Blackwell, the kernels are timed against Mamba on an H100 (Section 5.5). All scans support differentiable initial/final states in whole-sequence, continued and step evaluation, including training through states carried across segments.

References (100)

Couldn't load all references. Reload the page to try again.