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.
Glossary
State Space Model (SSM)

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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
| Feature | State 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 |
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.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
State Space Models like Mamba are part of a broader computational ecosystem for efficient long-sequence modeling. These related concepts define the architectural alternatives, training objectives, and downstream applications that contextualize SSM performance in genomics.
Linear-Time Sequence Modeling
The defining computational advantage of SSMs over standard attention mechanisms. While self-attention scales quadratically with sequence length O(L²), SSMs achieve linear complexity O(L) by maintaining a compressed hidden state that summarizes all prior history. This enables processing of whole human chromosomes (millions of base pairs) in a single forward pass without chunking or approximation strategies required by transformer-based genomic models.
Selective State Spaces (Mamba)
The key innovation in the Mamba architecture that distinguishes it from earlier SSMs like S4. Traditional SSMs use time-invariant parameters (A, B, C matrices are fixed regardless of input). Mamba introduces input-dependent selectivity, where the state transition parameters become functions of the current token. This allows the model to selectively propagate or forget information—analogous to an attention gate—while retaining linear complexity. For genomics, this means the model can learn to ignore intronic regions while focusing on coding sequences and regulatory elements.
Hyena Hierarchy
An alternative sub-quadratic architecture that replaces self-attention with implicit long convolutions parameterized by a multiplicative gating mechanism. Hyena achieves O(N log N) complexity by interleaving long convolutional filters with element-wise gating operations. Unlike SSMs which maintain an explicit recurrent state, Hyena uses a convolutional mode for efficient training and can match transformer quality on genomic benchmarks while being significantly faster for sequences exceeding 100k base pairs.
HiPPO Matrix Initialization
The mathematical foundation for high-quality SSM state representations. HiPPO (High-order Polynomial Projection Operators) theory defines a class of matrices that optimally compress continuous signal history into a fixed-dimensional state vector. The HiPPO-LegS (Legendre Scaled) matrix ensures the state captures information uniformly across all timescales, preventing the exponential forgetting of distant past tokens. This initialization is critical for SSMs to model ultra-long-range dependencies in genomic sequences without gradient vanishing.
Hardware-Aware Parallel Scan
The algorithmic technique that makes SSM training efficient on GPUs despite their recurrent formulation. Instead of sequential recurrence, the linear state update is reformulated as a parallel prefix scan operation, enabling computation across all sequence positions simultaneously. Mamba's implementation uses kernel fusion to avoid materializing the full state matrix in GPU memory, achieving wall-clock speeds competitive with optimized FlashAttention implementations while processing sequences orders of magnitude longer.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us