Skip to main content
p4r4d0xb0x
Rustacean, AI, OSS Enthusiast
View all authors

S4: How to Read Long Sequences with Structured State Spaces

· 7 min read
p4r4d0xb0x
Rustacean, AI, OSS Enthusiast

The bottleneck in long-sequence modeling is not simply that “there are many tokens.” A model must pass signals from the distant past to the current output while preserving parallelism during training and keeping memory movement manageable during inference. Efficiently Modeling Long Sequences with Structured State Spaces approaches this problem by addressing both the mathematical properties and the computational structure of state space models (SSMs). The key is not to compute the entire SSM indiscriminately, but to structure the state matrix, diagonalize it stably, and reduce the computation to Cauchy kernel operations.

Conceptual diagram showing a long input sequence transformed into a structured state space and kernel computation

This article is based on the publicly available arXiv abstract and API metadata. Numerical results and components explicitly stated in the abstract are described as “results reported by the paper”; detailed hyperparameters, code implementation, and the complete experimental procedure remain outside the verified scope.

H3: The Memory and Comparison Capabilities SSMs Missed in Language Modeling

· 7 min read
p4r4d0xb0x
Rustacean, AI, OSS Enthusiast

State space models (SSMs) can scale almost linearly with sequence length, but that alone does not replace attention in language modeling. Hungry Hungry Hippos: Towards Language Modeling with State Space Models does not reduce this gap to vague insufficient expressiveness; it divides the problem into two capabilities. Existing SSMs are weak at accurately recalling earlier tokens and at comparing tokens with one another within a sequence. Building on that diagnosis, the paper proposes the H3 layer, the FlashConv computation method, and hybrid models that retain some attention.

Conceptual diagram representing token memory and comparison in an H3 state space layer

This article is based only on the arXiv abstract and public metadata. The figures and model sizes below are results reported by the paper’s abstract; the detailed experimental settings and implementation reproducibility require checking the full paper.

Mamba: Approaching Content-Based Reasoning with Selective State Spaces

· 7 min read
p4r4d0xb0x
Rustacean, AI, OSS Enthusiast

State space models (SSMs) may process long sequences in linear time, but weaknesses emerge in tasks such as language, where the model must decide what to remember based on token meaning. Mamba: Linear-Time Sequence Modeling with Selective State Spaces revisits this problem from the perspective that “the state remains fixed and processes every input by the same rule.” The proposal can be summarized in one sentence: change the SSM parameters according to the input so that information is selectively passed on or forgotten based on the current token.

Mamba state-space flow selectively passing and forgetting information according to input tokens

This draft uses only claims confirmed by the publicly available arXiv abstract and metadata. The detailed internal block structure, exact kernel implementation, and conditions of each experiment require additional verification against the full paper and code.

Why Does Mamba-2 Resemble the Transformer? Reading SSMs Through SSD

· 7 min read
p4r4d0xb0x
Rustacean, AI, OSS Enthusiast

Conceptual diagram connecting state space models and attention through a structured matrix

The bottleneck in models that handle long sequences is not simply the number of parameters. Training must process every position in a long sequence in parallel, while generation must read past information for every new token. The Transformer gains powerful global attention, but accepts computation and memory costs that grow with sequence length. State space models (SSMs) in the Mamba family maintain a recurrent state to keep the state size fixed during generation, yet their training and GPU utilization are harder to describe as straightforwardly as the Transformer's.

Tri Dao and Albert Gu's paper does not set these two families up as competing boxes. Its central question is whether SSMs and attention can be expressed in the same structural language. The paper uses structured semiseparable matrices to organize the relationship between the two families, then proposes the core Mamba-2 layer and the SSD algorithm from that perspective. The discussion below is based on the abstract, methods, and experiments in the arXiv paper and HTML; it does not add results from running reproduction code.

Griffin's Compromise: Combining Gated Linear Recurrence with Local Attention

· 7 min read
p4r4d0xb0x
Rustacean, AI, OSS Enthusiast

Sequence-model architecture where linear recurrence and local attention alternate

The Transformer became the standard for language modeling through its ability to compare every position directly, but generation requires continually storing past keys and values. Traditional recurrent neural networks (RNNs), by contrast, update one state per token and therefore have low inference cost, but are difficult to parallelize along the time axis and to train at scale. The Griffin paper does not treat this as a choice between two alternatives. It proposes Hawk, a gated linear recurrence, and Griffin, which mixes local attention into Hawk, assigning different time ranges of memory to each component.

The abstract reports that Hawk surpasses reported Mamba performance and that Griffin reaches performance competitive with Llama-2 using more than six times fewer training tokens. It also claims hardware efficiency during training similar to the Transformer, low latency and high throughput during inference, and extrapolation to sequences longer than the training length. This article uses the abstract and the original experimental conditions as evidence; it does not add external reproduction results or new comparisons.

RWKV-5 Eagle and RWKV-6 Finch: Expanding the State into a Matrix and Making Recurrence Dynamic

· 8 min read
p4r4d0xb0x
Rustacean, AI, OSS Enthusiast

Conceptual diagram of RWKV time-mixing blocks and matrix-state updates

The Transformer's approach to long context is powerful, but generation incurs the cost of storing and reading past keys and values. RWKV computes an attention-like weighted average as a recurrence, aiming to retain time-axis parallelism during training while using a fixed-size state per token during generation. The paper “Eagle and Finch” extends RWKV-4 in two stages. Eagle (RWKV-5) expands a vector state into a multi-head matrix state, while Finch (RWKV-6) makes decay and token shift input-dependent.

The abstract reports competitive results across several benchmarks after training four Eagle models (0.46B–7.5B) and two Finch models (1.6B and 3.1B). It also introduces a multilingual corpus with 1.12 trillion tokens, a tokenizer based on greedy matching, and models and code released under Apache 2.0. This article is based on the structure and abstract of arXiv 2404.05892v4 and does not expand “competitive” into a claim of universal victory for any particular model.

xLSTM: How to Scale Recurrent Memory Again

· 6 min read
p4r4d0xb0x
Rustacean, AI, OSS Enthusiast

LSTM introduced gates and memory to handle long-range dependencies, but in the era of large language models it was overtaken by the Transformer's parallel self-attention. xLSTM asks a simple question: can LSTM remain competitive at the scale of billions of parameters if it is combined with modern stabilization techniques and hardware-friendly computation rather than discarded? The answer presented in the paper's abstract is not to simply make the old LSTM larger, but to scale the gating and memory updates themselves.

Conceptual diagram connecting recurrent memory cells with a matrix state

Mamba-3: Connecting Linear Inference to Practical Sequence-Modeling Quality

· 6 min read
p4r4d0xb0x
Rustacean, AI, OSS Enthusiast

When processing long contexts, Transformer costs appear as growing attention computation and the memory burden of the KV cache. Linear models offer a better cost structure in theory, but can lose quality in state tracking and hardware efficiency. This is the gap Mamba-3 targets. Rather than treating “linear complexity” as a slogan, the paper redesigns recurrence and state updates around the idea that actual data movement during inference and the expressiveness of the state matter.

Conceptual diagram of state-space recurrence and multiple input/output paths

Hidden State Poisoning: When Mamba's Efficient State Becomes an Attack Surface

· 6 min read
p4r4d0xb0x
Rustacean, AI, OSS Enthusiast

The appeal of the Mamba family is its efficiency in processing long sequences with a fixed-size state. But that compressed state can itself become a security boundary. Hidden State Poisoning Attacks against Mamba-based Language Models studies Hidden State Poisoning Attacks (HiSPA), a phenomenon in which a particular short input phrase partially overwrites the model's hidden state and breaks its ability to retrieve stored information. Based on the abstract and public metadata, this article organizes the attack concept, reported evaluations, and operational questions that need to be checked.

Conceptual diagram of an attack path that overwrites a Mamba hidden state

Resona: Using Retrieval to Improve Context Copying in Linear Recurrent Models

· 6 min read
p4r4d0xb0x
Rustacean, AI, OSS Enthusiast

A linear recurrent model updates a small state as it reads tokens, offering a different choice from a Transformer in computation and memory cost for long inputs. But it reveals a weakness when it must find and reproduce a specific fact that is already in context. “Copy the string seen a moment ago exactly” is a different problem from summarizing everything into a compressed state. Resona proposes a simple and extensible framework that seeks to close this gap through retrieval.

Conceptual diagram of retrieving relevant tokens from input context and copying them into a linear recurrent state