12.9  Further Reading

Over the course of this chapter, you have built the recurrent layers that modern long-context models pair with attention, traced their roots back to the LSTM, and measured where a fixed-size state runs out of capacity. Most of this literature is less than five years old, and not all of it will last. This section surveys the extensions and open questions the chapter left out, along with reference implementations and tutorials.

12.9.1 Recurrence and Attention Together

12.9.1.1 Hybrid Models in Practice

Section 12.8 ended on three questions: how few attention layers are enough, where in the stack they belong, and whether sliding-window attention can replace global attention. The matched 8B-parameter comparison of Waleffe et al. (2024) mixes 24 Mamba-2 layers with 4 attention layers (about 8% of all layers including MLPs), places a Mamba-2 layer first so no positional embeddings are needed, and spaces the attention layers evenly. At that ratio, the hybrid matched or exceeded a Transformer across all twelve standard benchmarks, whereas pure Mamba models lagged on five-shot MMLU and phone-book lookup.

Production models vary in their exact mix: Qwen3-Next (Qwen Team 2025) and Kimi Linear (Kimi Team 2025) use one attention layer in four around delta-rule recurrences (Section 12.7), Jamba (Lieber et al. 2024; Jamba Team 2024) uses one in eight, and Nemotron-H (NVIDIA 2025) retains Mamba-2 layers. Griffin (De et al. 2024) drops global attention entirely, interleaving two gated diagonal recurrence layers with one sliding-window attention layer (Section 10.6); as Section 12.8 predicts, exact lookup degrades once the context exceeds the window width.

12.9.1.2 Distillation from Transformers

Rather than pretraining a recurrent or hybrid model from scratch, one can convert a pretrained Transformer by initializing matrix-state layers from its attention projections (Section 12.6) and distilling. Wang et al. (2024) retain a subset of attention layers to form a hybrid, while Bick et al. (2024) progressively align attention maps, hidden states, and final outputs using 3B–5B tokens—under 1% of the original pretraining budget.

12.9.1.3 Between a Fixed State and a Full Cache

Two designs interpolate between fixed-size state and a full KV cache. Based (Arora et al. 2024) pairs a second-order Taylor approximation to \(\exp(\mathbf{q}^\top\mathbf{k})\) with exact sliding-window attention, trading state size directly against recall. Log-linear attention (Guo et al. 2025) maintains one matrix state per dyadic history block (doubling in length further into the past), so memory grows as \(O(\log T)\) and applies directly to Mamba-2 and Gated DeltaNet.

12.9.2 Writing to a Matrix Memory

12.9.2.1 Expressivity of Fixed-State Models

Some sequential tasks remain out of reach for diagonal or time-invariant linear recurrences regardless of state size. Consider tracking a ball under five cups across a sequence of swaps—composing permutations in the symmetric group \(S_5\). Merrill et al. (2024) prove that state space models with diagonal or fixed transitions (including S4 and Mamba), like Transformers, compute only functions in the constant-depth threshold circuit class \(\mathsf{TC}^0\). Composing permutations of five or more elements is complete for \(\mathsf{NC}^1\) (logarithmic-depth circuits) and therefore lies outside \(\mathsf{TC}^0\) unless \(\mathsf{TC}^0 = \mathsf{NC}^1\). (With three or four cups, the symmetric group is solvable and remains inside \(\mathsf{TC}^0\).)

Because the delta rule’s transition \(\mathbf{I} - \beta_t \mathbf{k}_t\mathbf{k}_t^\top\) is input-dependent and non-diagonal, the \(\mathsf{TC}^0\) barrier does not rule it out. However, Grazzi et al. (2025) show that in finite precision, any linear recurrence whose transition eigenvalues lie strictly in \([0, 1]\) cannot compute parity, and therefore cannot track swaps, at arbitrary lengths. Standard GatedDeltaNet uses \(\beta_t \in (0, 1)\) from a sigmoid and falls under this restriction. Allowing \(\beta_t \in (0, 2)\) lets the transition reach negative eigenvalues: at \(\beta_t = 2\) with key \((\mathbf{e}_i - \mathbf{e}_j)/\sqrt{2}\), \(\mathbf{I} - 2\mathbf{k}_t\mathbf{k}_t^\top\) is a reflection that swaps coordinates \(i\) and \(j\). Section 12.7.3.5 trains this variant on parity.

12.9.2.2 Generalized Delta Rules, Exponential Gates, and Network Memories

  • Generalized delta rules. RWKV-7 (Peng et al. 2025) unties the delta rule’s rank-one projection by decaying each coordinate at its own rate, erasing along one key vector, and writing along a distinct key vector, yielding an asymmetric transition capable of recognizing any regular language. DeltaProduct (Siems et al. 2025) composes multiple reflections \(\prod_i (\mathbf{I} - \beta_i\mathbf{k}_i\mathbf{k}_i^\top)\) per token so a single step can represent higher-rank permutations.
  • Exponential gates. A sigmoid input gate caps any single token’s write weight at \(1\). The mLSTM of xLSTM (Beck et al. 2024, 2025) uses exponential input gates paired with a running normalizer state and the online log-max stabilization of Section 10.5.
  • Network memories. TTT (Sun et al. 2024) and Titans (Behrouz et al. 2025) generalize the online gradient view of Section 12.7 by replacing the matrix \(\mathbf{S}_t\) with a linear layer or small MLP updated by per-token gradient steps (with momentum and weight decay in Titans). Whether nonlinear fast weights recall more associations per byte of state than a matrix of equal parameter count remains an open question.

12.9.3 State Space Models and Long Convolutions

12.9.3.1 Memory by Polynomial Projection

Section 12.4 initialized S4D’s rates as \(\lambda_n = -n\). That choice originates in HiPPO (Gu et al. 2020), which maintains the coefficients of the best degree-\((N-1)\) orthogonal polynomial approximation to the input history \(x(s)\) (\(s \le t\)). Those coefficients satisfy a linear ODE with a fixed lower-triangular HiPPO matrix \(\mathbf{A}\). S4 (Gu, Goel, et al. 2022) made the system time-invariant (corresponding to Legendre polynomials over an exponentially warped history (Gu et al. 2023)) and decomposed \(\mathbf{A}\) into a normal matrix plus a low-rank correction for fast kernel evaluation. S4D (Gu, Gupta, et al. 2022) showed that keeping only the diagonal entries (complex eigenvalues or the real diagonal \(-1, \ldots, -N\)) recovers nearly the same performance with a fraction of the machinery. S5 (Smith et al. 2023) replaced the per-channel scalar SSMs with a single multi-input, multi-output diagonal SSM evaluated via parallel scan (Section 12.3.2), and Gu’s thesis (Gu 2023) synthesizes this line of work.

12.9.3.2 Successors of Mamba, Direct Linear Recurrences, and Long Convolutions

  • Mamba-2 and Mamba-3. Mamba-2 (Dao and Gu 2024) shares a scalar decay across each head to cast training into the matrix-multiply chunked form of Section 12.6. Mamba-3 (Lahoti et al. 2026) introduces trapezoidal discretization, complex states for rotational tracking, and multi-input updates that raise arithmetic intensity during autoregressive decoding.
  • Linear Recurrent Unit (LRU). Orvieto et al. (2023) parameterize a discrete diagonal recurrence directly with complex eigenvalues inside the unit disk and an input normalization \(\sqrt{1 - |\lambda|^2}\), matching continuous-time SSMs on the Long Range Arena and motivating the real-valued RG-LRU used in Griffin.
  • Long convolutions. H3 (Fu et al. 2023) chained a shift SSM with a multiplicative associative SSM, and Hyena (Poli et al. 2023) replaced the SSM kernel entirely with an implicitly parameterized full-length filter evaluated in \(O(T \log T)\) via the FFT. Because general long convolutions lack a compact recurrent state for \(O(1)\) decoding, language models have largely favored recurrent SSMs, while long convolutions remain popular in genomics.

12.9.4 Beyond Language

Outside language modeling, bidirectional scans over image patches power Vision Mamba (Zhu et al. 2024) and VMamba (Liu et al. 2024); multiscale S4 stacks model raw audio waveforms in SaShiMi (Goel et al. 2022); and million-nucleotide genomic contexts are modeled with long convolutions in HyenaDNA (Nguyen et al. 2023) or reverse-complement-equivariant bidirectional Mamba layers in Caduceus (Schiff et al. 2024).

12.9.5 Reference Implementations and Tutorials

Discussions