Inferensys

Glossary

State Space Model (SSM)

A sequence modeling architecture that uses a linear time-invariant system to process long-range dependencies with linear computational complexity, offering a performant alternative to the quadratic scaling of self-attention for whole-genome analysis.
Architect reviewing LLM integration architecture on laptop, system diagrams visible, modern technical office setup.
LINEAR-TIME SEQUENCE ARCHITECTURE

What is a State Space Model (SSM)?

A State Space Model (SSM) is a sequence modeling architecture that uses a linear time-invariant system to process long-range dependencies with linear computational complexity, offering a performant alternative to attention for whole-genome analysis.

A State Space Model (SSM) is a deep learning architecture inspired by classical control theory that models sequential data by propagating a hidden state through time using linear differential equations. Unlike self-attention mechanisms with quadratic complexity, SSMs process sequences with linear computational complexity, making them exceptionally efficient for extremely long genomic sequences spanning millions of base pairs.

The Mamba model, a selective SSM variant, introduces input-dependent parameters that allow the model to dynamically filter or retain information along the sequence, overcoming the fixed dynamics of earlier SSMs. This selective mechanism enables Mamba to match or exceed transformer performance on tasks like variant effect prediction and enhancer-gene linking while scaling linearly with sequence length, making it a compelling architecture for whole-genome foundation models.

ARCHITECTURE DEEP DIVE

Key Features of State Space Models

State Space Models (SSMs) represent a paradigm shift in sequence modeling, offering linear computational complexity while maintaining the ability to capture long-range dependencies critical for whole-genome analysis.

01

Linear Time-Invariant Dynamics

At its core, an SSM defines a continuous-time system using a state equation and an observation equation. The system evolves a hidden state h(t) based on the input x(t) through learned matrices (A, B, C, D). Unlike transformers, this formulation processes sequences with O(N) linear complexity rather than quadratic, making it inherently scalable to chromosome-length sequences spanning millions of base pairs. The HiPPO matrix (High-order Polynomial Projection Operators) provides a mathematically optimal initialization for the state transition matrix A, enabling the model to memorize long-range dependencies by compressing input history into an orthogonal polynomial basis.

O(N)
Computational Complexity
100k+
Token Context Window
02

Selective Scan Mechanism (Mamba)

The Mamba architecture introduces a critical innovation over traditional SSMs: input-dependent parameters. Unlike earlier models (S4, H3) where matrices A, B, and C are fixed for all inputs, Mamba makes B and C functions of the current token. This selective state space allows the model to filter irrelevant information and focus on pertinent genomic features dynamically. For example, when scanning a gene locus, the model can selectively retain exon boundary signals while discarding intronic noise. This selection is implemented via a parallel scan algorithm on modern GPU hardware, achieving efficient training despite the recurrent formulation.

5x
Throughput vs. Transformers
Selective
State Filtering
03

Discretization for Genomic Sequences

To process discrete nucleotide tokens (A, C, G, T), the continuous-time SSM must be converted into a discrete recurrence. This discretization step uses a learnable step size Δ and a formula such as the bilinear transform or zero-order hold to convert continuous matrices (A, B) into their discrete counterparts (Ā, B̄). The step size Δ acts as a gate, controlling how much the current input influences the hidden state. In genomic applications, a larger Δ allows the model to focus sharply on a splice site or start codon, while a smaller Δ enables smooth integration of broader chromatin context.

Δ
Learnable Step Size
Zero-Order Hold
Discretization Rule
04

Hardware-Aware Parallel Scan

A naive recurrent implementation of SSMs is slow on GPUs due to sequential dependencies. Mamba overcomes this with a hardware-aware parallel scan algorithm implemented in Triton or custom CUDA kernels. The scan computes the full sequence of hidden states efficiently by performing a prefix sum operation on a parallel processor. Crucially, intermediate states are materialized in fast SRAM rather than slower HBM (High Bandwidth Memory), avoiding the memory bottleneck that plagues attention-based models. This kernel fusion strategy enables processing of 1-million-token genomic sequences without memory overflow.

SRAM
Kernel Memory Tier
Triton
Implementation Language
05

Long-Range Dependency Benchmarking

SSMs excel on tasks requiring synthetic long-range reasoning that confound transformers. On the Long Range Arena (LRA) benchmark, S4 and Mamba achieve near-perfect accuracy on the Path-X task (classifying 16,384-pixel images), where standard transformers fail entirely. In genomics, this translates to directly modeling enhancer-gene interactions spanning hundreds of kilobases without truncating the input. SSMs can ingest an entire topologically associating domain (TAD) as a single sequence, learning regulatory grammar across distal elements that are separated by vast intergenic distances.

99%+
Path-X Accuracy
100 kb+
Genomic Receptive Field
06

Convolutional Mode for Training

For efficient training, the linear time-invariant SSM can be expressed as a global convolution between the input sequence and a fixed kernel derived from the SSM parameters. This allows the entire sequence to be processed in parallel during training using Fast Fourier Transforms (FFTs). The convolutional kernel implicitly encodes the model's long-range memory profile. During inference, the model switches to its recurrent mode, generating predictions token-by-token with constant memory. This dual representation—convolutional for training, recurrent for inference—provides the best of both paradigms for genomic foundation models.

FFT
Training Algorithm
Recurrent
Inference Mode
ARCHITECTURAL TRADE-OFFS

SSM vs. Self-Attention: A Technical Comparison

A direct technical comparison of State Space Models (Mamba) and Self-Attention (Transformer) mechanisms for long-range genomic sequence modeling.

FeatureState Space Model (SSM)Self-Attention (Transformer)Sparse Attention

Computational Complexity

O(N) Linear

O(N²) Quadratic

O(N log N) or O(N√N)

Memory Footprint (Inference)

Constant (no KV cache)

Linear growth with sequence length

Reduced linear growth

Long-Range Dependency Capture

Theoretically unbounded via HiPPO

Global receptive field

Local window with global tokens

Training Parallelization

Requires associative scan

Fully parallelizable

Partially parallelizable

Hardware Efficiency on GPU

Optimized for SRAM-bound kernels

Compute-bound; high FLOP utilization

Moderate; irregular memory access

Sequence Length Extrapolation

Strong; continuous-time formulation

Weak; requires RoPE or ALiBi

Moderate; window-limited

Selective Information Filtering

Content-Aware Computation

Pre-training on Human Genome (chr1)

Feasible on single A100 80GB

Requires model sharding

Feasible with window size tuning

STATE SPACE MODELS

Frequently Asked Questions

Clear, technically precise answers to the most common questions about State Space Models (SSMs) and their application in computational genomics.

A State Space Model (SSM) is a sequence modeling architecture that defines a linear time-invariant system to map an input sequence to an output sequence through a latent state. Unlike transformers, which compute pairwise interactions between all tokens, an SSM maintains a fixed-size hidden state that is recursively updated as it processes each element of the sequence. The core mechanism is governed by four parameters—state matrix A, input projection B, output projection C, and skip connection D—which together define how new information is incorporated into the state and how the state influences the output. This formulation allows SSMs to process sequences with linear computational complexity relative to sequence length, making them exceptionally efficient for modeling the extremely long-range dependencies found in whole-genome sequences, where regulatory elements can be separated by millions of base pairs.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.