NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Flash PD-SSM: Memory-Optimized Structured Sparse State-Space Models

Aleksandar Terzić, Francesco Carzaniga, Nicolas Menet, Yannick Biehl, Michael Hersche, Thomas Hofmann, Abbas RahimiarXiv 2026

TL;DR

State-space models (SSMs) typically trade off expressivity for efficiency, with popular diagonal models (like Mamba) struggling to track complex, non-solvable state transitions. FLASH PD-SSM breaks this bottleneck by replacing the memory-heavy soft-selection mechanism of previous structured sparse SSMs with a discrete hard-selection routing mechanism. This reduces matrix-generation memory complexity from $O(LN^2)$ to $O(LN)$, delivering top-tier finite-state automaton (FSA) expressivity while running faster and using less memory than Mamba2.

What Problem Does This Paper Address?

Modern State-Space Models (SSMs) have emerged as strong alternatives to Transformers due to their linear computational scaling with sequence length. However, to remain efficient, most frontier SSMs restrict their transition matrices to diagonal forms. This structural constraint introduces a fundamental limitation: diagonal time-varying SSMs are mathematically incapable of emulating Finite State Automata (FSAs) with non-solvable transformation semigroups. In plain terms, they struggle with complex state-tracking, which is highly correlated with strong performance in coding and mathematical reasoning.

Recent work introduced the Permutation-Diagonal SSM (PD-SSM) to solve this by using structured sparse transition matrices that can emulate any $N$-state FSA. Unfortunately, PD-SSM had a fatal flaw: generating its input-dependent transition matrices required materializing large intermediate dense matrices, incurring a massive $O(LN^2)$ memory and compute cost (where $L$ is sequence length and $N$ is hidden state size). This made PD-SSM over 40× slower than highly optimized models like Mamba2, rendering it impractical for large-scale training.

Methods

FLASH PD-SSM eliminates this computational bottleneck through a combination of algorithmic redesign and hardware-aware kernel engineering:

  1. Novel Sparse Selection Mechanism: Instead of generating an input-dependent convex combination of dense dictionary matrices and then sparsifying them at every single token step, FLASH PD-SSM flips the order. It sparsifies a dictionary of $K$ dense matrices once at the beginning of the optimization step by selecting the largest element in each column. At each time-step, the model uses a discrete argmax to select exactly one pre-sparsified matrix from this dictionary based on input-dependent weights. This reduces the memory footprint from $O(LN^2)$ to $O(LN)$.
Figure 2: Left: PD-SSM. PD-SSM [53] sparsifies a convex combination of dense dictionary matrices. The column one-hot matrix generation process incurs significant computational and memory over- heads. Right: FLASH PD-SSM. We simplify the column one-hot generation process by directly selecting a single element from a dictionary of trainable structured sparse matrices. This preserves the theoretical guarantees and allows for significant runtime improvements.
  1. Surrogate Gradients: Because the hard-selection (argmax) operation is non-differentiable, the authors employ slope-annealed straight-through estimation (STE). In the forward pass, a discrete choice is made; in the backward pass, the gradient is approximated using a tempered softmax function.
  2. Hardware-Aware Chunk-Wise Kernel: To maximize hardware utilization, the authors implemented a custom Triton/CUDA kernel that partitions the sequence into chunks. It performs a three-phase parallel recurrence: a local scan and aggregate within chunks, a global carry propagation across chunk boundaries, and a final parallel pass to apply the carry corrections.

Datasets

The authors evaluated FLASH PD-SSM across a diverse array of benchmarks:

  • Synthetic State-Tracking: An FSA emulation suite consisting of four tasks (Cycle Nav, Even Pairs, Mod. Arith, Parity) designed to test length generalization.
  • Mechanistic Capabilities: The MAD (Mechanistic Architecture Design) benchmark, which probes in-context recall and memorization.
  • Multivariate Time-Series: The UEA time-series classification archive (featuring sequence lengths up to 17,000) and the PPG-DaLiA forecasting dataset.
  • Natural Language State-Tracking: An extended version of the Box dataset, modified to test challenging out-of-distribution (OOD) scenarios with up to 26 state transitions.
  • Language Modeling: Pretraining on a 100-billion token subset of FineWeb, evaluated via the lm-eval harness (including HellaSwag, PIQA, ARC, and LAMBADA).

Key Insights and Ideas

  • Sparsify First, Select Later: The core "aha" moment is that you do not need to dynamically blend dense matrices to achieve high expressivity. Pre-sparsifying the dictionary and performing a hard discrete selection yields the exact same theoretical FSA expressivity guarantees while fundamentally altering the underlying computational complexity.
  • Multi-Head Parameter Amortization: By setting the number of heads $H = \sqrt{D}$ and the dictionary size $K = \sqrt{D}$ (where $D$ is the embedding dimension), the parameter cost of the sparse matrix selector perfectly matches a single standard $D \times D$ linear layer, preventing parameter explosion.
  • Maximizing HBM Bandwidth: The custom 3-phase CUDA kernel achieves roughly 82% of the theoretical peak memory bandwidth on an NVIDIA A100 GPU, proving that the index gathers and thread synchronizations required by the architecture do not create hardware bottlenecks.

Key Results

Efficiency & Throughput

At a sequence length of 5120, FLASH PD-SSM achieves 18% faster training than DeltaNet and 4% faster training than Mamba2, while reducing peak memory consumption by more than 12% compared to both models.

Figure 1: FLASH PD-SSM is expressive, fast, and memory-efficient. Synthetic state-tracking accuracy on a collection of FSA emulation tasks [13, 57]. The runtime (measured relative to PD- SSM [53]) and memory consumption of FLASH PD-SSM and other popular SSMs are also reported. The maximum sequence length is 2048 and all models have hidden dimension 1024. The circle’s size indicates peak memory consumption during training. FLASH PD-SSM is the only SSM in the upper right quadrant, i.e., both highly expressive and fast.

Performance Benchmarks

  • Synthetic State Tracking: FLASH PD-SSM achieved a 96.3% average validation accuracy, vastly outperforming diagonal models like Mamba2 (58.9%) and DPLR models like Gated DeltaProduct (80.7%).
  • Natural Language State Tracking: When inserted into frontier hybrid architectures (Granite4 and NemotronH), FLASH PD-SSM improved out-of-distribution length generalization by up to 10% over Mamba2.
  • Language Model Pretraining: The authors introduced DELTA-PD, a hybrid model combining DeltaNet and FLASH PD-SSM layers. At the 230M parameter scale, DELTA-PD outperformed a pure DeltaNet baseline in both zero-shot accuracy (+1.0%) and throughput (253k tokens/s vs 168k tokens/s—a 1.5× speedup).
Figure 5: SSM Memory Comparison. Peak allocated memory comparison of FLASH PD- SSM in a parameter-matched setting. FLASH PD-SSM consumes notably less memory.

Limitations and Future Work

While FLASH PD-SSM delivers impressive empirical results, the authors note a couple of key limitations:

  • Gradient Bias: The use of straight-through estimators (STEs) can introduce biased gradients during training. A deeper theoretical explanation for why these estimators remain highly effective across such a wide variety of discrete sequential tasks is still lacking.
  • Pure Model Performance: In pure language modeling scenarios, a 100% FLASH PD-SSM architecture underperforms compared to hybrid variants. Consequently, its best use case is as a drop-in layer within hybrid architectures (like DELTA-PD) rather than a standalone backbone.

Summary updated

BibTeX
@misc{terzic2026flash,
  author = {Aleksandar Terzić and Francesco Carzaniga and Nicolas Menet and Yannick Biehl and Michael Hersche and Thomas Hofmann and Abbas Rahimi},
  title = {{Flash PD-SSM: Memory-Optimized Structured Sparse State-Space Models}},
  year = {2026},
  eprint = {2605.19150},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.19150},
}
Figure