Mamba-360: Survey of State Space Models as Transformer Alternative for Long Sequence Modelling: Methods, Applications, and Challenges
Badri Narayana Patro Vijay Srinivas Agneeswaran


Electric and magnetic waveguides in graphene:

 
quantum and  classical
    
David Barranco^b[davidbarran95@gmail.com, ORCID: http://orcid.org/0009-0001-7405-1543
0009-0001-7405-1543], 
Şengül Kuru^a[sengul.kuru@science.ankara.edu.tr, ORCID: http://orcid.org/0000-0001-6380-280X0000-0001-6380-280X], 
Javier Negro^b[jnegro@uva.es,
ORCID: http://orcid.org/0000-0002-0847-64200000-0002-0847-6420]

 
^aDepartment of Physics, Faculty of Science, Ankara University, 06100 Ankara, Türkiye

^bDepartamento de Física Teórica, Atómica y Optica, Universidad de Valladolid,
 47011 
Valladolid, Spain
    
=====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================





Sequence modeling is a crucial area across various domains, including Natural Language Processing (NLP), speech recognition, time series forecasting, music generation, and bioinformatics. Recurrent Neural Networks (RNNs) and Long Short Term Memory Networks (LSTMs)  have historically dominated sequence modeling tasks like Machine Translation, Named Entity Recognition (NER), etc. However, the advancement of transformers has led to a shift in this paradigm, given their superior performance. Yet, transformers suffer from O(N^2) attention complexity and challenges in handling inductive bias. Several variations have been proposed to address these issues which use spectral networks or convolutions and have performed well on a range of tasks. However, they still have difficulty in dealing with long sequences. State Space Models(SSMs) have emerged as promising alternatives for sequence modeling paradigms in this context, especially with the advent of S4 and its variants, such as S4nd, Hippo, Hyena, Diagnol State Spaces (DSS), Gated State Spaces (GSS), Linear Recurrent Unit (LRU), Liquid-S4, Mamba, etc. In this survey, we categorize the foundational SSMs based on three paradigms namely, Gating architectures, Structural architectures, and Recurrent architectures. This survey also highlights diverse applications of SSMs across domains such as vision, video, audio, speech, language (especially long sequence modeling), medical (including genomics), chemical (like drug design), recommendation systems, and time series analysis, including tabular data. Moreover, we consolidate the performance of SSMs on benchmark datasets like Long Range Arena (LRA), WikiText, Glue, Pile, ImageNet, Kinetics-400, sstv2, as well as video datasets such as Breakfast, COIN, LVU, and various time series datasets. The project page for Mamba-360 work is available on this webpage.<https://github.com/badripatro/mamba360>.








§ INTRODUCTION

Recurrent Neural Networks (RNNs) have long been the cornerstone of sequence modeling, excelling in tasks like machine translation and next-word prediction. RNNs predict the next state given the current input token and the previous state. However, RNNs allow us to look at only the last state and current input for predicting the next state, implying that output is restrictive. Recurrent Neural Networks (RNNs) can efficiently handle sequences of length L without requiring memory resources greater than O(1). However, due to gradient calculations being limited to the hidden state and current input, RNNs may not have a sufficient look-back window or memory capacity. Moreover, RNNs struggle with the exploding or vanishing gradient problem and lack sufficient memory for long sequences without an exponential increase in computational complexity. To address these limitations, Long Short-Term Memory (LSTM) networks were introduced. While LSTMs mitigate some issues of traditional RNNs, they introduce complexity with their gating mechanisms and exhibit challenges in transfer learning.


Transformers have emerged as a revolutionary alternative, offering solutions to the shortcomings of both RNNs and LSTMs, and have become the dominant paradigm in the fields of NLP and vision. By employing attention mechanisms, transformers enable each token to interact with every other token in the input sequence, thereby capturing long-range dependencies efficiently. However, the O(N^2) attention complexity of transformers poses scalability challenges, especially for processing long sequences in domains like genomics and high-resolution image analysis. This implies though Transformers perform quite well on many sequence processing tasks, they have certain inefficiencies, especially with respect to the amount of memory and computing required, which grow quadratically with sequence length. In this context, our study explores the landscape of sequence modeling and introduces State Space Models (SSMs) as a promising paradigm. By leveraging SSMs, we aim to address the inefficiencies of traditional RNNs and transformers while offering scalable solutions for sequence processing tasks across diverse domains.








State Space Models (SSMs) have emerged as compelling alternatives to transformers, particularly for processing long sequences. SSMs can be conceptualized as RNNs with fixed lengths, which do not grow with input length This brings significant efficiency benefits in terms of inference speed and computation/memory complexity compared to transformers. However, despite their efficiency advantages, SSMs often fall short of the performance gap with state-of-the-art transformers in certain data modalities, notably in vision tasks.


A notable drawback of SSMs is their compromise on core capabilities essential for certain sequence processing tasks, such as copying long input sequences<cit.>, in-context learning, and induction heads<cit.>. This work presents a comprehensive survey of the field of state space models, highlighting their strengths and weaknesses compared to state-of-the-art transformers. We discuss how task-oriented SSMs are better suited than transformers for specific tasks, such as those in the long-range arena tasks <cit.> while acknowledging the superior performance of transformers in computer vision tasks like image recognition and instance segmentation. 


In our survey, we observe that SSMs, especially exemplified by models like Mamba, demonstrate competitive performance with transformers across various domains and tasks. For instance, in the realm of Language Domain Tasks, SSMs exhibit commendable performance, particularly in standard regression in-context learning (ICL) tasks. Notably, SSMs outshine transformers in tasks such as sparse parity learning¹. However, in the domain of Video and Audio Tasks, while transformers show promise in natural language processing, their effectiveness in multimodal tasks, such as video and audio understanding, remains relatively unexplored. Addressing this gap, ongoing research endeavors aim to leverage the long-range modeling capacity of Large Language Models (LLMs) to enhance video understanding. 

Furthermore, our survey highlights the need for further investigation into the relative strengths of SSMs and transformers across a range of tasks, including time series prediction, recommendation systems, reinforcement learning, and various medical domain tasks. These domains offer fertile ground for exploring how SSMs and transformers can complement each other, providing insights into their respective capabilities and limitations.



This work incorporates four important aspects including:


  * Understanding of State Space Models (SSMs): This work discusses the fundamentals of SSMs, and explains their inner workings and mathematical underpinnings.

  * Categorization and Recent Advances of SSMs: It provides a systematic categorization of SSMs, shedding light on recent developments in this field. By organizing SSMs, researchers gain insights into their unique characteristics and potential applications.


  * Application of SSMs Across Domains: The study explores how SSMs find utility in diverse domains, from natural language processing to medical diagnostics. Understanding these applications helps practitioners tailor SSMs to specific tasks effectively.


  * Performance Comparison of SSMs with Transformers: By consolidating state-of-the-art results, the work evaluates SSMs alongside Transformers. This comparative analysis informs us about the strengths and limitations of each approach for specific domains and tasks. 




In summary, we introduce the basics of State Space Models (SSMs) and discuss their fundamental principles, including their mathematical formulation and conceptual framework, in Section-<ref>. In Section <ref>, we outline recent advances in the SSM literature, showcasing recent breakthroughs and shedding light on cutting-edge research and innovations. In Section-<ref>, we explore the applications of SSMs in modeling long sequences, examining their efficacy and performance in comparison to other models. In Section-<ref>, we discuss the performance of SSMs in modeling long sequences and compare it with that of state-of-the-art Transformers. We show that while SSMs achieve efficiencies compared to Transformers, they still fall short of the performance of state-of-the-art Transformers in certain domains. The evolution of sequential data modeling approaches from Recurrent Neural Networks (RNNs), Convolutional Neural Networks (CNNs), Transformers, to State-Space Models (SSMs) reflects a trajectory of innovations addressing diverse challenges in capturing temporal dependencies, spatial hierarchies, global interactions, and dynamic systems behavior as shown in figure-<ref>.








§ BASICS OF STATE SPACE MODELS


State-space models offer a powerful framework for modeling dynamic systems, particularly by enabling the representation of high-order derivatives through the utilization of only first-order derivatives and vector quantities. For instance, consider the second-order differential equation describing the dynamics of a damped mass-spring system:


    m d^2y(t)/dt^2 + c dy(t)/dt + ky(t) = u(t),


where u(t) represents the external force acting on the mass and y(t) denotes the vertical position. Here, dy(t)/dt and d^2y(t)/dt^2 stand for the first and second derivatives of y respectively.

To express this equation solely in terms of first-order derivatives and vector quantities, we introduce the state vector:


    x(t) := [ y(t); ẏ(t) ].


Though this transition results in dealing with a vector equation instead of a scalar one:


    ẋ(t) = [    0    1; -c/m -k/m ] x(t) + [ 0; 1 ] u(t).


The position y(t) is then expressed as a linear function of the state:


    y(t) = C x(t),


with C = (1,0).



 §.§ Spring-Mass-Damper system

The spring-mass-damper system is a classic example used to illustrate principles of dynamics and control theory. Here's the basic mathematical formulation of the state-space model for the spring-mass-damper system. Consider a spring-mass-damper system consisting of a mass m connected to a wall via a spring with spring constant k and a damper with a damping coefficient c.  The goal is to describe the system's behavior using state variables. The displacement of the mass is represented as x, its velocity as ẋ, and the external force applied to the mass as F. 

1. State Variables: We'll define two state variables: x_1: Displacement of the mass from its equilibrium position (position of the mass relative to the spring's rest position). The ẋ_1: Velocity of the mass.

2. System Dynamics: The dynamics of the spring-mass-damper system can be expressed using Newton's second law of motion as follows:
     
    mẍ_1 = -kx_1 - cẋ_1

     where ẍ_1 represents the acceleration of the mass. The first term -kx_1 represents the spring force (proportional to displacement). The second term -cẋ_1 represents the damping force (proportional to velocity).

3. State-Space Formulation:

A state-space model represents the dynamics of a system using a set of first-order differential equations. It's a powerful framework for describing linear time-invariant (LTI) systems. Its fundamental components are:

    
  * State Vector (x): The state vector contains the state variables that describe the system's internal state. Let's denote it as 𝐱, where 𝐱∈ℝ^n.

    
  * Input Vector (u): The input vector represents the control or external input to the system. Denote it as 𝐮, where 𝐮∈ℝ^m.
    
    
  * Output Vector (y): The output vector contains the measurable quantities of interest. Denote it as 𝐲, where 𝐲∈ℝ^p.
    
    
  * System Dynamics: The state dynamics are described by the first-order differential equation. In the Time-Invariant (LTI) case, the matrices 𝐀, 𝐁, 𝐂, and 𝐃  remain constant over time. The LTI state dynamics become

    
  * 
    𝐱̇ = 𝐀𝐱 + 𝐁𝐮

     where:𝐱 = [x_1, ẋ_1]^T is the state vector. 𝐮 represents the input (external force or control input). 𝐀∈ℝ^n × n is the dynamics matrix. 𝐁∈ℝ^n × m is the input matrix. The state matrix A is defined as 𝐀 = [    0    1; -k/m -c/m ], the input matrix 𝐁 = [   0; 1/m ]
     𝐱̇ represents the time derivative of 𝐱.


  * The output equation relates the output to the state and input:
     
    𝐲 = 𝐂𝐱 + 𝐃𝐮

     where 𝐂∈ℝ^p × n is the output or sensor matrix. 𝐃∈ℝ^p × m is the feedthrough matrix.  𝐂 = [ 1 0 ] and 𝐃 = 0
     




4. Interpretation:  The state vector 𝐱 contains information about the mass's position and velocity.  The input vector 𝐮 could represent an external force applied to the mass.  The output vector 𝐲 is typically the displacement x_1. In this system, the state vector 𝐱 represents the position and velocity of the mass. The state dynamics are governed by the equations of motion derived from Newton's second law. The input u represents any external force applied to the mass, which in this case is assumed to be zero.



5. Stability and Control: Stability analysis involves examining the eigenvalues of the matrix 𝐀.  Control design can be achieved by adjusting the control input 𝐮 to achieve desired behavior (e.g., damping out oscillations).




 §.§ State Space Models





  §.§.§ Definition

Linear state-space equations provide a versatile framework for modeling discrete-time dynamical systems:


    x(t+1) = Ax(t) + Bu(t),    y(t) = Cx(t) + Du(t),    t=0,1,2,…


Here, x(t) in 𝐑^n represents the system's state at time t, encapsulating its condition. u(t) in 𝐑^p contains control variables, while y(t) in 𝐑^k comprises specific outputs of interest. Matrices A, B, C, and D are of appropriate sizes.

Essentially, a linear dynamical model assumes that the state at the next time step is a linear combination of the state at previous time steps and, potentially, other exogenous inputs. Additionally, it posits that the output is a linear function of the state and input vectors.

In contrast, a continuous-time model takes the form of a differential equation:


    d/dt x(t) = A x(t) + Bu(t),    y(t) = Cx(t) + Du(t),    t ≥ 0.


Lastly, time-varying models incorporate matrices A, B, C, D that change over time, offering a more flexible representation of dynamic systems.




  §.§.§ Model Formulation:


To model a large sequence we use state space models instead of Multi-headed self-attention due to its complexity. The state space model<cit.> is commonly known as a linear time-invariant system that maps the input stimulation x(t) ∈ℛ^L to a response y(t) through a hidden space h(t) ∈ℛ^N. Structured state space sequence models (S4) are a recent class of sequence models for deep learning that are broadly related to RNNs, CNNs, and classical state space models. Mathematically,  The Continuous-time Latent State spaces can be modeled as linear ordinary differential equations that use evolution parameter A ∈ℛ^N× N and projection parameter B ∈ℛ^N× 1 and C ∈ℛ^N× 1 as follows:


    ẋ(t)    = Ax(t) + Bu(t) 
    
        y(t)    = Cx(t) + Du(t)





  §.§.§ Discrete-time SSM: 


The discrete form of SSM uses a time-scale parameter  to transform continuous parameters A, B, and C to discrete parameters A, B and C using fixed formula  A=f_A(,A), B=f_B(,A,B). The pair f_A,f_B is the discretization rule that uses a zero-order hold (ZOH)  for this transformation. The equations are as follows.


    x_k   = A x_k-1 + B u_k    A   = (I - /2 ·A)^-1(I + /2 ·A)    
    
      y_k    = C x_k    B   = (I - /2 ·A)^-1B   C   = C
      .





  §.§.§  Convolutional Kernel Representation


The discretized form of recurrent SSM in equation-<ref> is not practically trainable due to its sequential nature. To get efficient representation, we model continuous convolution as discrete convolution as it is a linear time-invariant system. 
For simplicity let the initial state be x_-1 = 0.
Then unrolling (<ref>) explicitly yields: 

    x_0    = B u_0    
      x_1    = AB u_0 + B u_1    
      x_2    = A^2 B u_0 + AB u_1 + B u_2    …
    
      y_0    = CB u_0    
      y_1    = CAB u_0 + CB u_1    
      y_2    = CA^2 B u_0 + CAB u_1 + CB u_2
         …

This can be vectorized into a convolution (<ref>) with an explicit formula for the convolution kernel (<ref>).

    y_k    = CA^k B u_0 + CA^k-1B u_1 + … + CAB u_k-1 + CB u_k
        
    
        y    = K∗ u 
        .


    K∈ℝ^L :=
      𝒦_L(A, B, C) := (CA^i B)_i ∈ [L] = (CB, CAB, …, CA^L-1B)
      .

K in equation (<ref>) can be represented as a single (non-circular) convolution which can be computed very efficiently with FFTs.However, computing K in (<ref>) is non-trivial and is modelled as a K the SSM convolution kernel or filter.

Specifically, we model input sequence using the state-of-the-art state space model Mamba<cit.>. Mamba identifies a critical weakness in existing models: their inability to perform content-based reasoning.
To address this, Mamba introduces selective state spaces (SSMs) that allow the model to selectively propagate or forget information along the sequence length dimension based on the current token.  While we apply the Mamba block for the vision task, we face the problem of stability issues (loss convergence issue) compared to other models like S4 or Hippo.  We are providing one type of solution for the instability issue by preserving only negative eigenvalue. To perform this we need an extra module which we call the channel mixing, which was missing in the mamba block. We combine the channel mixing module with the Sequence mixing module and make a simplified Mamba Based Architecture (SiMBA) as shown in SiMBA<cit.>.  The input token sequence 𝐗_𝚕-1 is first normalized by the normalization layer. Next, we linearly project the normalized sequence to the 𝐱 and 𝐳 with dimension size E. Then, we process the 𝐱 from the forward and backward directions. 
For each direction, we first apply the 1-D convolution to the 𝐱 and get the 𝐱'_o. We then linearly project the 𝐱'_o to the 𝐁_o, 𝐂_o, Δ_o, respectively. 
The Δ_o is then used to transform the 𝐀_o, 𝐁_o, respectively. 




§ RECENT ADVANCES IN  STATE SPACE MODELS

Attention-based transformers have revolutionized natural language processing and other sequence-to-sequence tasks. However, they encounter certain limitations, especially when dealing with long input sequences, especially when dependencies extend beyond the attention window size. This constraint is particularly crucial in applications such as high-resolution imagery analysis and genomics. Efforts to address these limitations have been surveyed by Efficient 360 <cit.>, focusing on optimizing and improving efficiency in terms of computational complexity. Various aspects of transformers, including spectral analysis, fairness considerations, approximation methods, robustness enhancements, and computational complexity optimizations, have been discussed. In this report, we discuss these limitations and explore state space models (SSMs) as an alternative approach. 


    
  * Computational Complexity:<cit.> Transformers exhibit high computational demands, particularly with large models. This complexity poses challenges for both training and deploying them on resource-constrained devices.

  
  * Large Memory Requirements:<cit.> Transformers necessitate significant memory resources for storing embeddings and intermediate activations. This can hinder scalability, especially for very long sequences, as they may surpass available memory capacity.

  
  * Fixed Sequence Length:<cit.> Transformers rely on fixed-size input sequences due to positional embeddings. Efficiently handling variable-length inputs presents a notable challenge in transformer-based architectures.

  
  * Attention Mechanism Scalability

While attention is a powerful mechanism, it has a quadratic scaling with input sequence length. This makes it less efficient for very long sequences<cit.>.

  
  * Lack of Causality in Standard Attention

The standard self-attention mechanism used in transformers doesn't inherently capture causality. It treats all positions equally, which can be problematic for tasks where causality matters<cit.>.



Despite advancements, attention-based transformers still struggle with long sequences, leading to unsolved challenges in long-range benchmarks such as the path-X task. To address these limitations, State-space models(SSMs) offer a promising alternative approach to this issue, with pioneering models like S4 being among the first to effectively tackle the path-X problem. SSMs efficiently model long sequences while capturing long-term dependencies. In the following sections, we categorize and discuss key state space models from the literature. The categorization of key state space models is illustrated in Figure <ref>:


    
  * Structured SSMs: These models, based on S4 and its variants, include Hippo, H3, HyenaHierarchy, Liquid-S4, S4nd, DSS, and Global convolutions and its variants including LongConv, FFTFlashConv and SG-Conv as well as certain foundational models such as LD-Stack and its derivative S5. They provide a principled way to handle long-range dependencies.
    
    
  * Recurrent SSMs: These models are based on RNNs and their variants, such as RWKV, LRU, and HGRN, offering an alternative to attention-based approaches for sequence modeling.
    
    
  * Gated SSMs: GSS, Mega, and TNN fall into this category, leveraging gating techniques to enhance performance on long sequences.
    
    
  * Miscellaneous SSMs: MambaFormer, Mamba-Byte, and Mamba-MoE explore various techniques beyond the standard attention mechanism, combining ideas from different categories for efficient sequence modeling


It should however be noted that Mamba, for instance, is derived from both Hippo (a structured SSM) and is also incorporating gating technology. This is depicted in the diagram with arrows. Similarly, GSS, one of the foundational models in the structured category, is derived from DSS but also uses gating. Similarly, S5 is derived from one of the foundational models LDStack and S4.
State space models offer promising solutions for handling long sequences, and their efficiency and effectiveness make them valuable alternatives to attention-based transformers in certain scenarios.











 §.§ Structured State Space Models

Structured State Space Models (SSMs) encompass various innovative approaches to sequence modeling, including S4, HiPPO, H3, and Liquid-S4. These models leverage sophisticated mechanisms such as polynomial projection operators, multi-input multi-output systems, and convolutional kernels to capture long-range dependencies efficiently. They demonstrate competitive performance across diverse benchmarks, showcasing their effectiveness in handling sequential data with improved computational efficiency.

 

  §.§.§ Structured State Space Sequence (S4)<cit.>

 S4<cit.> is a novel type of sequence model designed to capture long dependencies within sequences based on the state space model (SSM), typically continuous-time in nature. S4 introduces three important mechanisms: 1. Higher-Order Polynomial Project Operator (HiPPO): HiPPO operates on state and input transition matrices to memorize signal history effectively, enabling the model to capture long-term dependencies. 2. Diagonal Plus Low-Rank Parametrization: S4 conditions the SSM matrix (A) with a low-rank correction to stabilize it, ensuring diagonalizability and stability. 3. Efficient (convolutional) Kernel Computation: S4 leverages FFTs and iFFTs for efficient computation of transition matrices, reducing the overall complexity to O(Nlog(N)). S4 introduces a new parameterization for the SSM which conditions matrix (A) with a low-rank correction, making it stable and diagonalizable. This transformation reduces the SSM computation to a well-studied Cauchy kernel. As a result, S4 models achieve strong empirical results while being computationally efficient. S4 was the first state space model to solve the path-X task in the LRA benchmark and reduces the computational complexity to O(Nlog(N)). S4 performs exceptionally well across various benchmarks. It achieves 91% accuracy on sequential CIFAR-10 without data augmentation or auxiliary losses. S4 closes the gap to transformers on image and language modeling tasks while being faster. Subsequent efforts, including Hippo and Long Convolutions, aimed to enhance state space models' efficiency but demonstrated a performance gap compared to state-of-the-art transformers. 




  §.§.§ High-Order Polynomial Projection Operators (HiPPO)<cit.>
 HiPPO<cit.> are applied to state and input transition matrices to effectively memorize signals' history. It was observed that there was no known mathematical interpretation of the specific matrix used in S4, originally defined for time-variant dynamical systems but employed in time-invariant state space models (SSMs). Hippo <cit.> provided a mathematical interpretation of S4 as exponentially warped Legendre polynomials, explaining S4's capacity to capture long-range dependencies. The HiPPO framework is an intriguing concept that combines state space models (SSMs) with generalized orthogonal basis projections. Hippo comprises four variants, with one using the truncated Fourier basis polynomial known as Hippo-FouT, while the second variant uses LagT, based on Lagurre polynomials. The third variant uses LegT which is based on Legendre polynomials and the fourth is LegS, which uses Legendre polynomials with a sliding window. Hippo significantly enhances the S4's performance to 86% on the long-range arena benchmark and 96% on the most difficult task like path-X.




  §.§.§ Hungry Hungry HiPPO (H3)  <cit.>

H3  <cit.> identified two key challenges that prior state space models (SSMs) faced: one is difficulty in recalling earlier tokens,i.e,  traditional SSMs struggled to effectively retain information from earlier tokens within a sequence and the second is difficult in comparing the tokens across different sequences.  To overcome these limitations, H3 introduces a novel approach using three key components of their method, Stacked SSMs with Multiplicative Interactions, FlashConv for Training Efficiency, and a State-Passing Algorithm for Scaling. H3 employs a novel approach by stacking two SSMs with multiplicative interactions between their input and output projections. This design allows for enhanced memory retention and cross-sequence comparisons.  Additionally, H3 introduces FlashConv, a method aimed at enhancing training efficiency on modern hardware. FlashConv utilizes a fused block Fast Fourier Transform (FFT) algorithm specifically designed for sequences up to 8K in length. Moreover, to scale SSMs beyond the 8K sequence length limit, H3 incorporates a state-passing algorithm. This algorithm effectively splits the input into the largest possible chunks that can fit within the SRAM memory of the GPU. Despite these advancements, there remains a perplexity gap between H3 and transformers (with 1.3B parameters). However, H3 exhibits superior performance over transformers in zero-shot and few-shot learning scenarios, particularly evident on superglue benchmark tasks. Impressively, H3 achieves a 2× speedup on the long-range arena benchmark and enables hybrid language models to generate text 2.4× faster than transformers.





  §.§.§ Global Convolution

Long Convolution <cit.> authors conjecture that SSMs rely on sophisticated mathematical structures to train effectively in deep networks. They generate a convolutional kernel as long as the input sequence, by repeatedly multiplying a hidden state matrix. This process leads to instability and needs hand-crafted initializations and hyper-parameter tuning.  To address these challenges, the authors introduce the main contribution of parametrizing long convolutional kernels directly. Typical implementations of long convolutions utilize Fast Fourier Transform (FFT), which can sometimes be slower than quadratic attention due to certain system constraints.  Long Convolutions solve these problems by using simple techniques like regularization (smoothening and squashing) and an IO-aware algorithm known as FlashButterfly. Impressively, Long Convolution outperforms transformers on the WikiText103 benchmark by reducing perplexity by 0.2 with 30% fewer parameters.
Furthermore, Long Convolution claims to be 7.2 times faster than transformers on the LRA speed benchmark. Another related effort is FlashFFTConv <cit.>, which utilizes two sparse convolutional algorithms (frequency-sparse convolution and partial convolution). FlashFFTConv employs a matrix decomposition technique that computes FFT using matrix multiplication, enabling kernel fusion for long sequences by reducing I/O operations. Similar approaches include Structural Global Convolution (SGConv) <cit.> and Hyena Hierarchy <cit.>.



  §.§.§ Hyena Hierarchy (HH)<cit.>

HH <cit.> is a state space model (SSM) proposed to address the perplexity gap with attention-based transformers. Attention mechanisms incur quadratic costs in sequence length, limiting the accessibility of context. While existing methods employ sub-quadratic layers based on low-rank and sparse approximations, they often require dense attention layers to match the performance of transformers. HH addresses this by demonstrating that previous sub-quadratic attention alternatives exhibit a perplexity gap with attention, particularly evident in long text sequences. Hyena employs a sub-quadratic approach that replaces attention with implicitly parametrized long convolutions and data-gating. HH has shown that the tipping point between HH and attention occurs at approximately 6K sequence length - at 100K sequence length, HH is 100 times faster than Flash attention, a highly optimized form of attention. Additionally, HH has nearly closed the performance gap with transformers on the pile benchmark, showcasing its effectiveness in handling long sequences efficiently while maintaining competitive performance with attention-based models.



  §.§.§ RWKV <cit.>

RWKV <cit.> is a recent recurrent neural network (RNN) designed for language modeling, incorporating a linear attention approximation mechanism known as the "WKV" mechanism. RWKV utilizes LTI (linear time-invariant) recurrences and is conceptualized as the ratio of two state space models (SSMs). RWKV is based on a linear attention approximation, which differs from the traditional self-attention mechanism used in transformers.
The authors of RWKV observe that while transformers have revolutionized natural language processing (NLP) and various other domains, they suffer from quadratic computational and memory complexity. In contrast, RNNs offer linear scaling in both memory and computational complexity but face performance gaps compared to transformers. However, RNNs often lag behind transformers in terms of parallelization and scalability. RWKV claims to be a hybrid model combining the strengths of both RNNs and transformers. However, it's essential to note that, to the best of our knowledge, RWKV is essentially a transformer with a linear attention mechanism and does not possess recurrent properties typical of traditional RNNs.



  §.§.§ LDStack <cit.>

LDStack <cit.> demonstrates how a recurrent neural network (RNN) can be represented as a multiple-input multiple-output (MIMO) Linear Dynamical System (LDS). LDStack demonstrates that an RNN can be effectively represented as an LDS. This viewpoint allows for a deeper understanding of RNN behavior and properties. Specifically, they consider the RNN as a system with multiple inputs and multiple outputs, similar to an LDS. To address computational challenges, LDStack introduces a technique called parallel scan. This involves approximating the MIMO LDS by aggregating it into a Single Input Multiple Outputs (SIMO) LDS. This approximation simplifies computations while preserving essential characteristics. The authors highlight that many discrete-time LDS can be modeled using state space equations. This implies that LDS can be viewed as equivalent to time-varying state space models [For reference, any dynamical system can be represented using state space equations of the form x(t+1) = Ax(t) + Bu(t) and y(t) = Cx(t) + Du(t), as illustrated in <https://inst.eecs.berkeley.edu/ ee127/sp21/livebook/l_mats_apps_state.html>]. LDStack's approach has demonstrated state-of-the-art performance, particularly in copy memory tasks <cit.>. This equivalence provides a bridge between the RNN framework and the more formal state space modeling. LDStack achieves state-of-the-art performance in copy memory problems, showcasing the effectiveness of their approach. Notably, this work contributes to the broader understanding of RNNs and their connections to linear dynamical systems. LDStack offers valuable insights into the relationship between RNNs and LDSs, opening up new avenues for research and practical applications.






  §.§.§ S5 <cit.>


S5 <cit.> extends the principles of LDStack, which modeled RNNs as multiple-input multiple-output Linear Dynamical Systems (LDS), to state space models (SSMs), offering a generalized approach. Unlike LDStack, which handles independent SSMs sequentially, the S5 layer processes multiple inputs and outputs concurrently. Performance evaluations indicate that S5 achieves notable results, reaching 87.2% accuracy on the Long-Range Arena (LRA) benchmark and an impressive 98.5% accuracy on the path-X task within LRA. While S4 comprises numerous independent single-input, single-output SSMs utilizing the HiPPO framework, the S5 layer adopts a single multi-input, multi-output SSM, facilitating parallelization. This parallel processing significantly enhances computational efficiency. S5 represents an intriguing fusion of ideas from LDS-based modeling and state space models, emphasizing parallel processing and computational efficiency.




  §.§.§ S4nd<cit.>

The primary goal of S4nd<cit.>  is to extend the applicability of SSMs beyond sequential data (such as Text data and time series) to continuous data domains. S4nd <cit.> addresses the challenge of applying state space models (SSMs) to continuous data such as images or videos.  S4nd contributes a new deep learning layer that transforms a standard SSM, which typically represents a 1-dimensional Ordinary Differential Equation (ODE), into a multi-dimensional Partial Differential Equation (PDE). This transformation allows SSMs to capture spatial dependencies across multiple dimensions. Moreover, S4nd demonstrates that a multi-dimensional SSM can be equivalently represented as ND continuous convolution, wherein each dimension undergoes 1D SSM convolution. To evaluate its efficacy, S4nd was tested on the ImageNet dataset using ConvNeXt as the backbone model, resulting in improved performance over traditional methods. Notably, it improved the performance of Vision Transformers (ViTs). Additionally, S4nd was found to outperform ConvNeXt on video recognition tasks, particularly on datasets such as HMDB <cit.>. S4nd extends the capabilities of SSMs to handle continuous data, bridging the gap between sequential and spatial modeling.





  §.§.§ Diagonal State Spaces (DSS) <cit.>

DSS <cit.> explores the parametrization of state space matrices through diagonal matrices plus low-rank correction. Remarkably, DSS demonstrates that it can achieve performance comparable to S4 without the need for low-rank correction. By solely utilizing diagonal state space matrices, DSS matches S4's performance on various benchmarks, including raw speech classification and the Long-Range Arena (LRA) benchmark. Furthermore, a variant of DSS proposed in <cit.> provides insights into specific initializations of the state space matrix. These initializations, based on approximating S4's matrix, result in effective performance for long sequence modeling tasks. This variant showcases the flexibility and potential of DSS in achieving strong performance across different applications and scenarios. The key innovation of DSS lies in removing the low-rank correction component from the Hippo matrix (used in S4).



  §.§.§ Liquid Structural State Spaces (Liquid-S4) <cit.>

Liquid time-constant networks (LTCs) <cit.> are causal continuous-time neural networks characterized by input-specific state transitions.  Integrating LTCs with S4, researchers have introduced Liquid-S4 <cit.>, given by the following dynamics:
    ẋ = (A +B u) x +B u, y = Cx
  which is different from S4 dynamics,  
    ẋ = A x +B u, y = Cx
.  The primary motivation behind Liquid-S4 is to enhance SSMs by leveraging the properties of LTCs. Liquid-S4 constructs a convolutional kernel based on a linearized version of LTCs. This kernel structure considers similarities among input sequence samples during both training and inference. Liquid-S4 introduces an input-dependent state-transition module, enabling adaptation to varying inputs. Additionally, Liquid-S4 constructs a convolutional kernel corresponding to a linearized version of LTC.  Liquid-S4 achieves state-of-the-art generalization across various sequence modeling tasks with long-term dependencies (including image, text, audio, and medical time series). Notably, Liquid-S4 achieves an average performance of 87.32% on the Long-Range Arena (LRA) benchmark, with only Gated State Space models (GSS) achieving comparable results. Liquid-S4 outperforms ConvNeXt on the **raw Speech Command recognition dataset**, achieving 96.78% accuracy with a 30% reduction in parameter counts compared to S4. Furthermore, a Convolutional Representation of Liquid-SSMs is provided, similar to the formulation presented in (<ref>). The Liquid-SSM is first unrolled in time to construct a convolutional kernel of it. By assuming x_-1 = 0 :

    x_0    = B u_0,     y_0 = CB u_0 
    
         x_1    = AB u_0 + B u_1  + B^2 u_0 u_1,     y_1 = CAB u_0 + CB u_1  + CB^2 u_0 u_1
    
         x_2    = A^2B u_0 + AB u_1 + B u_2  + AB^2 u_0 u_1 + AB^2 u_0 u_2 + B^2 u_1 u_2 + B^3 u_0 u_1 u_2 
    
         y_2    = CA^2B u_0 + CAB u_1 + CB u_2  + CAB^2 u_0 u_1 + CAB^2 u_0 u_2 + CB^2 u_1 u_2 + CB^3 u_0 u_1 u_2 ,  …

Liquid-S4 combines the strengths of LTCs and SSMs, resulting in improved performance and adaptability across diverse sequence modeling tasks.



  §.§.§ State Space Augmented Transformer (SPADE) <cit.>

The  SPADE<cit.> addresses the challenge of efficiently capturing both global and local information from long sequences. While attention optimizations in transformers enhance computational efficiency, they often struggle to capture global context from long sequences effectively. On the other hand, state space models (SSMs) excel at capturing global information from long sequences but may not efficiently capture local dependencies. SPADE proposes a novel approach by integrating an SSM, specifically S4, as the bottom layer of a transformer. This integration allows SPADE to leverage the strengths of both SSMs and transformers, efficiently capturing global information. Additionally, SPADE incorporates a window and chunk-based local attention layers to effectively capture local dependencies. By combining global information captured by the SSM layer with local information obtained from attention mechanisms, SPADE achieves significant performance gains across various benchmarks, including the Long-Range Arena (LRA), WikiText, and Glue benchmarks. This integration of SSMs and transformers in SPADE represents a promising direction for enhancing the performance and efficiency of sequence modeling tasks.





 §.§ Gated SSMs

Gated State Spaces (GSS), Toeplitz Neural Network (TNN), and Mamba represent innovative approaches within the realm of Gated SSMs. GSS leverages gating units to optimize FFT operations, achieving efficient sequence processing and competitive performance. TNN introduces a position-encoded Toeplitz matrix for token mixing, significantly reducing space-time complexity while maintaining state-of-the-art results. Mamba addresses computational inefficiencies in traditional SSMs by incorporating a gated MLP and hardware-aware algorithms, demonstrating linear-time complexity and improved efficiency over conventional Transformers.



  §.§.§ Mega <cit.>

Mega <cit.> identifies two deficiencies in transformers: weak inductive bias and quadratic attention complexity  with respect to the sequence length. The weak inductive bias refers to transformers' lack of assumptions regarding the patterns of interaction or dependencies between tokens.  It treats all positions equally, which can be suboptimal for modeling long sequences. To address this, Mega introduces a novel mechanism called Moving Average Equipped-Gated Attention. The gated attention mechanism of Mega employs a single-head gated attention mechanism. This mechanism integrates classical Exponential Moving Average (EMA) with single-headed gated attention, effectively incorporating positional-level local dependency into positional-agnostic attention.  By doing so, it introduces a more meaningful inductive bias into the attention mechanism. Additionally, Mega offers a variant known as Mega-Chunk, which addresses the quadratic attention complexity by introducing linear space and time complexity while minimizing quality loss. It achieves this by efficiently dividing the entire sequence into fixed-length chunks. By leveraging the strengths of EMA and gated attention, Mega enhances the inductive bias of transformers and mitigates the computational complexity associated with attention mechanisms. These innovations represent significant advancements toward more efficient and effective sequence modeling. The experiments conducted by Ma et al. demonstrate that Mega outperforms other sequence models, including various Transformer variants, on a wide range of benchmarks, such as neural machine translation, language modeling, and image and speech classification.





  §.§.§ Gated State Spaces (GSS) <cit.>

GSS <cit.> builds upon the prior work of Lia<cit.> et al., who observed that replacing the MLP layer of the transformer with gating units can reduce dimensionality during token mixing. Expanding on this insight, GSS introduces a gating layer designed to decrease dimensionality during Fast Fourier Transform (FFT) operations in state space models (SSMs). This enables GSS to operate efficiently on longer input sequences.  GSS exhibits zero-shot generalization to longer input sequences while maintaining straightforward implementation. Furthermore, GSS provides additional insights by initializing the state space variables to random values. Surprisingly, GSS outperforms models like Hippo, S4, and DSS, which rely on special initializations using linear algebra techniques (e.g., Hippo matrix initializations). Additionally, GSS reduces the perplexity gap with Block Recurrent Transformers <cit.> across various benchmarks such as PG-19, Arxiv, and GitHub, while also exhibiting higher efficiency. These findings highlight the effectiveness and versatility of GSS in sequence modeling tasks.  GSS trains significantly faster than the diagonal version of S4 (DSS) on Tensor Processing Units (TPUs). It achieves competitive performance with several well-tuned Transformer-based baselines.



  §.§.§ Toeplitz Neural Network (TNN)<cit.>

TNN <cit.> has been recently proposed to address the two important aspects of transformers, namely the attention mechanism, which learns pair-wise correlations of input tokens and second, the positional embedding, which learns positional inductive bias. TNN uses a position-encoded Toeplitz matrix to capture relations between input token pairs as a token mixer and uses a Toeplitz matrix-vector production technique to reduce space-time complexity to O(N*logN). The authors claim that TNN is more efficient than transformers in that TNN is log-linear complexity, while transformers are quadratic. A key feature of TNN is its use of a Relative Position Encoder (RPE) to generate relative positional coefficients with a fixed parameter budget. RPE uses relative positional parameters to ensemble the Toeplitz matrix and makes TNN's parameters independent of sequence length. TNN consists of a Gates Toeplitz Unit (GTU) and the Gated Linear Unit (GLU).  The GTU employs a Toeplitz Neural Operator (TNO) for token mixing using the Toeplitz matrix, while the RPE utilizes a fully connected network encoded with position information to generate relative position coefficients. Empirical evaluations demonstrate that TNN achieves state-of-the-art performance on benchmarks such as Glue and Long-Range Arena (LRA). These findings underscore the efficacy and efficiency of TNN in comparison to traditional transformer architectures.



  §.§.§ Mamba <cit.>

Mamba <cit.> highlights the quadratic computational and memory complexity of transformers, along with the perplexity gap that traditional state space models (SSMs) exhibit in comparison. Prior to Mamba, SSMs faced inefficiencies in addressing tasks such as selective copying and induction head <cit.>. However, observations on Liquid-S4's input-dependent state-transition module suggest its potential for solving these tasks effectively. Mamba addresses these challenges by introducing a novel parametrization approach for SSMs based on input characteristics and incorporating a simple selection mechanism. Additionally, Mamba presents an efficient hardware-aware algorithm based on selective scan. Similar to Gated State Spaces (GSS), Mamba employs a gated technique to reduce the dimensionality of global kernel operations. Moreover, Mamba combines a gated MLP<cit.> with the SSM module to further enhance its capabilities. Mamba’s linear-time complexity makes it more efficient than traditional Transformers.




 §.§ Recurrent SSMs

Recurrent SSMS encompass the Linear Recurrent Unit (LRU) and the Hierarchically Gated Recurrent Neural Network (HGRN). The LRU, along with its extensions Griffin and Hawk, highlights the effectiveness of linear recurrence, MLP blocks, and attention mechanisms in enhancing long-sequence modeling. Conversely, the HGRN introduces dynamic forget gates to linear RNNs, leading to significant efficiency improvements and competitive performance across a range of benchmarks.




  §.§.§ Linear Recurrent Unit (LRU)<cit.>

LRU <cit.> observes that while SSMs achieve good performance on long sequence modeling tasks, the exact reasoning behind the same is unclear. The initial reasoning behind good S4 performance, for instance, was the specific initialization(HiPPO<cit.>) of the state matrices as well as the discretization of the continuous-time system of differential equations. However, as we have noted above, the GSS <cit.>, and DSS  <cit.> have shown that the specific initializations mentioned above are not crucial, even random initializations can lead to significant performance gains. So,LRU takes a fresh approach by starting with Recurrent Neural Networks (RNNs) and exploring whether their performance can match that of SSMs in long sequence modeling tasks. They make several improvements to RNNs, including 1. Linear Recurrence: the removal of non-linearities in the recurrence and stacking up linear RNN layer with non-linear MLP blocks. 2. Parametrization: parametrizing the RNNs to a complex diagonal form, which allows for parallelization of training, inspired by DSS and S5. 3. Stable Exponential Parametrization: stable exponential parametrization of the diagonal recurrent matrix, which leads to simplifying the training process 4. Normalization: normalization of hidden activations on the forward pass, which enables training time stability enforcement. These improvements enable LRU to achieve performance levels comparable to other SSMs and transformers on benchmarks such as the Long-Range Arena (LRA). By combining insights from both traditional SSMs and neural network architectures, LRU sheds light on new avenues for improving long-sequence modeling tasks.

Griffin and Hawk, both developed by the same authors <cit.>, extend the capabilities of the Linear Recurrent Unit (LRU) by incorporating additional layers and mechanisms for improved sequence modeling. In Griffin, the authors interleave LRU layers with Multilayer Perceptron (MLP) blocks and local attention mechanisms <cit.>. This architecture utilizes a residual block, an MLP block, and a temporal-mixing block. The temporal-mixing block is validated with three alternatives: 1) global multi-query attention <cit.>, 2) local (sliding window) attention, and 3) LRU-based recurrent blocks. On the other hand, Hawk, another model from the same authors, takes a slightly different approach by interleaving LRU layers with MLP blocks. Similar to Griffin, Hawk also incorporates a temporal-mixing block, which offers alternatives such as global multi-query attention, local attention, and LRU-based recurrent blocks. Both Griffin and Hawk undergo performance comparisons with LLama 2 and Mamba, demonstrating their effectiveness in sequence modeling tasks. These models showcase the potential of combining recurrent and attention mechanisms for improved long-sequence modeling.





  §.§.§ Hierarchically Gated Recurrent Neural Network (HGRN) <cit.>

HGRN <cit.> is a recent effort in modifying RNNs that uses gated linear RNNs with forget gates that have learnable weights that propagate from the lower layer to the upper layers. This enables HGRNs to handle short-term dependencies, which are more local to the model, in the lower layers. HGRNs handle long-term dependencies in the upper layer, which captures global information. HGRNs address the shortcomings of RNNs, namely, the complexity of hidden state updates, which typically involves full matrix multiplication and the presence of non-linearity within the recurrent unit, that prevents parallel computation. HGRNs use an element-wise linear recurrent layer, which removes non-linearity in the recurrence, leading to parallelized training. HGRNs use element-wise multiplication for hidden state updates. Linear RNNs have used two methods, namely the Exponential Moving Average (EMA) and gating schemes. It must be noted that typical state space models such as S4, RWKV, S4nd, Mega, and LRU all use EMA methods, where decay rates are data independent, which implies they are static in all time steps. HGRN<cit.> and Liquid-S4 <cit.> are the only models to use data-dependent or dynamic decay rates. HGRN uses forget gates to achieve these dynamic decay rates, while Liquid-S4 uses a dynamics transition matrix, which is a limited form of FFT. HGRN achieves significant performance results on Wikitext data, Glue, Long Range Arena, and the Pile benchmarks. However, while HGRN gains significant efficiencies compared to other SSMs and transformers, HGRNs overcome the perplexity gap with attention-based transformers with only TNN achieving lower perplexity scores. 



 §.§ Miscellaneous SSMs




  §.§.§ Mixture of Experts (MoE)

MoE has emerged as a prominent approach to enhance the performance of Large Language Models (LLMs). Several Efforts have been made to integrate MoE with state space models, leading to innovations such as BlackMamba <cit.>, MoE-Mamba <cit.>, and Jamba <cit.>. BlackMamba innovatively replaces the self-attention mechanism of transformer architecture with Mamba State Space Models (SSMs)<cit.> for sequence mixing. Additionally, it combines this with a MoE-Transformer architecture, where multiple Multilayer Perceptrons (MLPs) are employed for channel mixing. The MoE component in BlackMamba enables the activation of only one sparse subset of parameters in a single forward pass. Moreover, BlackMamba incorporates a router mechanism that dynamically learns to route tokens to the appropriate expert. The model has demonstrated promising results in lowering the perplexity gap observed with attention-based transformers. Similarly, MoE-Mamba follows a similar architecture to BlackMamba, leveraging the combination of Mamba SSMs and MoE-Transformer architecture. This model also showcases competitive performance, narrowing the perplexity gap with attention-based transformers. On the other hand, Jamba adopts a hybrid architecture, interleaving Mamba and transformer layers while integrating MoE with select layers. Jamba has been specifically tailored for common sense reasoning tasks and has demonstrated competitive performance, even outperforming Mixtral-8X-7B on certain benchmarks. Additionally, Jamba supports input token lengths of up to 256K, showcasing its scalability and versatility in handling long sequences. These advancements highlight the effectiveness of integrating MoE with state space models, paving the way for improved performance and scalability in large language models.


MambaByte <cit.>
MambaByte <cit.> represents a recent endeavor aimed at introducing hardware-efficient Mamba architectures tailored for efficient sequence processing. In MambaByte, the Mamba State Space Model (SSM) is utilized alongside a fixed-size memory state and optimized decoding techniques. The rationale behind MambaByte stems from the observation that Mamba possesses a substantial fixed-size memory state, akin to the hidden state in Recurrent Neural Networks (RNNs). This memory state remains independent of the context length, enabling efficient processing of long sequences. Furthermore, MambaByte incorporates a speculative decoding algorithm specifically tailored for byte-level models. Through experiments, MambaByte demonstrates superior performance compared to Mamba, particularly on long sequences spanning up to 524K in length. Additionally, MambaByte showcases its competitiveness against transformer models such as MegaByte <cit.> on the PG19 dataset <cit.>, an open vocabulary language modeling benchmark derived from books. These advancements in MambaByte highlight its efficacy in achieving lower perplexity and improved performance, particularly in processing long sequences, thus contributing to the evolution of hardware-efficient Mamba architectures.




  §.§.§ SSMs and In-Context Learning


In the exploration of in-context learning (ICL), the focus lies on the relationship between successful task performance and the information present within the training data. A significant inquiry revolves around whether models can be trained to effectively engage in in-context learning of specific function classes, such as linear functions, utilizing data derived from instances within that class.  Recent studies have discussed this question, particularly scrutinizing the capabilities of both standard Transformers and specialized architectures like Mamba. For instance, Garg et al. <cit.> have demonstrated that standard Transformers can indeed be trained to adeptly engage in in-context learning of linear functions. Importantly, this learning occurs exclusively at inference time, without any parameter updates during training. Similarly, Grazzi et al. <cit.> have investigated the feasibility of in-context learning with Mamba. Their findings reveal that Mamba exhibits comparable performance to Transformers in in-context learning tasks across standard scenarios such as skewed linear regression, ReLU neural network, and decision trees. Furthermore, the paper on MambaFormer <cit.> extends this exploration, showcasing the model's adeptness in in-context learning across additional tasks, including Vector-valued MQAR. Notably, MambaFormer demonstrates success where Mamba alone may falter, although it's important to note that the computational complexity of MambaFormer remains quadratic due to the integration of attention mechanisms with Mamba in each layer. These investigations collectively shed light on the potential of both Transformers and specialized architectures like Mamba and MambaFormer in engaging in effective in-context learning, contributing to a deeper understanding of their capabilities and limitations in this domain.






















§ APPLICATIONS OF STATE SPACE MODELS


SSMs have been primarily proposed to handle long input sequences as opposed to transformers and thus, have wide applicability in a number of domains that need long sequences to be processed.



 §.§ Language Domain (long sequence) 

In the domain of natural language processing (NLP), transformers have traditionally been the preferred choice for modeling text data due to their adeptness at capturing intricate dependencies through attention mechanisms <cit.>. However, their efficiency suffers from a quadratic O(N^2) complexity, especially noticeable when handling long sequences. As sequence length increases, so do memory and compute requirements, rendering training on lengthy inputs impractical. To address these inefficiencies, a slew of State Space Models (SSMs) has emerged, including S4, s4nd, S5, Hippo, Hyena, H3, LDStack, Liquid-S4, DSS, GSS, Mega, LRU, HGRN, TNN, Mamba among others <cit.>. Unlike transformers, which rely on attention mechanisms, SSMs compress input data into a fixed-size latent state. This static memory allocation remains constant during sequence generation, rendering SSMs more efficient for handling long inputs.
 
However, there's a trade-off. While SSMs excel in efficiency, they sacrifice the capability to retrieve and copy portions of the input context, crucial for tasks like few-shot learning and retrieval. Transformers, on the other hand, shine in these domains. In our performance analysis, we compare Glue scores in table <ref>, Wikitext benchmarks in table <ref>, and Pile benchmarks in table <ref>  for long sequence text data across both transformers and SSMs. The ongoing debate between the two persists, each showcasing distinct strengths and limitations in the domain of NLP <cit.>.










 §.§ Vision domain:

State space models (SSMs) have demonstrated remarkable efficiency in various computer vision tasks, including image classification, segmentation, and object detection. Several efforts, such as SiMBA <cit.>, V-Mamba <cit.>, Vim <cit.>, localMamba <cit.>, plainmamba <cit.>, and Vim2 <cit.>, have adapted SSMs for image classification tasks. Similarly, U-Mamba <cit.>, SegMamba <cit.>, Swin U-Mamba <cit.>, P-Mamba (for ventricular segmentation) <cit.>, and VM-UNet <cit.> have been proposed for segmentation tasks in computer vision.





Vision-specific adaptations of the Mamba architecture, such as Vision Mamba <cit.>, V-Mamba<cit.> and  SiMBA  <cit.>, utilize bidirectional and visual state space models for computer vision tasks. However, there exists a performance gap between these models and state-of-the-art transformer models like SpectFormer <cit.>, SVT <cit.>, WaveViT <cit.>, Volo <cit.>, and SCT <cit.>. SiMBA <cit.> aims to bridge this gap by incorporating Mamba for token mixing, replacing attention networks, and leveraging Einstein FFT (EinFFT) for channel mixing. SiMBA introduces the Einstein blending method for channel mixing, providing a novel approach without the constraints of requiring perfect square dimensions for sequence length and channel dimensions. Furthermore, SiMBA adopts the pyramid version of the transformer architecture, leading to significant performance improvements, especially on benchmarks like ImageNet and time series tasks. However, there remains a performance gap compared to state-of-the-art transformer models like SCT <cit.>. Table <ref> summarizes results for the image classification task on the ImageNet dataset, showcasing SiMBA as the state-of-the-art model in the State Space architecture for image recognition tasks. RSMamba <cit.> focuses on remote sensing image classification, while Res-VMamba <cit.> targets fine-grained food category visual classification using selective state space models with deep residual learning. Additionally, efforts like SiMBA, V-Mamba, and Vim have demonstrated promising performance in object detection tasks.


U-Mamba <cit.> focuses on enhancing long-range dependencies for biomedical image segmentation tasks. By leveraging state space models, U-Mamba effectively captures fine-grained relationships and dependencies within biomedical images, particularly addressing long-range sequential modeling challenges. Similarly, SegMamba <cit.> extends the capabilities of Mamba for 3D medical image segmentation tasks. By incorporating the Mamba architecture, SegMamba can effectively model sequential dependencies within volumetric medical image data. MambaMorph <cit.> tackles the problem of deformable MR-CT registration by integrating contrastive feature learning within the Mamba framework. This approach enables robust and accurate registration of medical images by leveraging the capabilities of state space models. VM-UNet <cit.>, on the other hand, utilizes Vision Mamba UNet for medical image segmentation. By combining the Mamba architecture with UNet, VM-UNet achieves superior performance in segmenting medical images, leveraging the strengths of both architectures. nnMamba <cit.> extends state space models to various biomedical image analysis tasks, including 3D biomedical image segmentation, classification, and landmark detection. By incorporating Mamba architecture, nnMamba demonstrates improved performance and efficiency in handling complex biomedical image data. FD-Vision <cit.> utilizes Mamba architecture to tackle endoscopic exposure correction, enhancing robustness in medical image analysis tasks. Weak-Mamba-UNet <cit.> improves scribble-based medical image segmentation by integrating Mamba with CNN and ViT architectures. This integration enables more effective utilization of weak supervision signals and achieves better segmentation accuracy. MedMamba <cit.> investigates the effectiveness of Mamba architecture specifically for medical image classification tasks, demonstrating its capability to handle diverse medical imaging data effectively. LightM-UNet <cit.> optimizes medical image segmentation using the lightweight Mamba architecture, emphasizing efficiency and effectiveness in handling medical imaging tasks. Large Window-based Mamba UNet <cit.> enhances medical image segmentation by exploring innovative approaches beyond traditional convolutional and self-attention mechanisms, leading to improved segmentation performance.

H-vmunet <cit.> introduces a high-order vision Mamba UNet architecture tailored for medical image segmentation tasks. By leveraging high-order dependencies and the Mamba architecture, H-vmunet achieves improved segmentation accuracy and robustness. ProMamba <cit.> specializes in polyp segmentation by incorporating prompt-based techniques within the Mamba framework, achieving state-of-the-art results in this specific medical imaging task. CMViM <cit.> explores contrastive masked Vim autoencoders for 3D multi-modal representation learning in Alzheimer's disease classification. By leveraging Mamba architecture, CMViM achieves enhanced representation learning capabilities, contributing to improved classification performance. Gamba <cit.> combines Gaussian splatting with Mamba for single-view 3D reconstruction tasks, leveraging the strengths of both techniques to achieve accurate and robust reconstruction results. ReMamber <cit.> focuses on image segmentation tasks using Mamba Twister, demonstrating superior segmentation performance compared to traditional methods. MambaIR <cit.> serves as a straightforward baseline for image restoration tasks utilizing state-space models. T-mamba <cit.> enhances tooth segmentation accuracy in 3D imaging by integrating frequency-based features and gated long-range dependencies into Vision Mamba.  This integration results in improved segmentation accuracy, particularly in challenging imaging conditions such as noise, low contrast, and artifacts. Both Convolutional Neural Networks (CNNs) and transformers are popular for image segmentation. However, their handling of long-range dependencies is limited due to locality or computational complexity.  It is difficult to get efficient tooth segmentation in 3D imaging (critical for orthodontic diagnosis) face noise, low contrast, and artifacts in CBCT images.  T-Mamba integrates shared positional encoding and frequency-based features into Vision Mamba. It addresses spatial position preservation and feature enhancement in the frequency domain. T-Mamba introduces frequency-based features into vision Mamba using Gate Selection Unit which adaptively integrates two spatial domain features and one frequency domain feature.  T-mamba achieves state-of-the-art results on public Tooth CBCT datasets, outperforming previous methods significantly in various evaluation metrics such as IoU, SO, DSC, HD, and ASSD.









 §.§ Medical Domains:
 

Mamba-based models are at the forefront of cutting-edge research in both genomics and drug design. In the biological domain, researchers leverage Mamba to analyze genomic sequences, decode genetic variations, and understand hereditary diseases. While Nucleotide Transformers and BERT-based transformers have been explored, SSMs have shown promise for genomic sequence modeling. In the chemical domain, Mamba plays a crucial role in molecular exploration and drug design. The Chemical Language Model (CLM) generates bio-active designs and diverse molecules. Recently, S4 has been adapted to enhance CLMs, overcoming the limitations of traditional transformers. From our genetic blueprint to novel compounds, Mamba is shaping the future of medicine and discovery!



  * Biological Domain (Genome):
Genomics is the study of the structure, function, evolution, mapping, and editing of the genomes of an organism. The human genome has approximately about 3.1 billion base pairs. Studying the genome can result in understanding the risk for common diseases like cancer and diabetes. Several efforts have been made to process the long sequences in genomics, including the Nucleotide Transformer <cit.>, BERT-based transformers for DNA sequencing such as <cit.>. Transformers may, however, have complexity issues in genomics and further, limited attention window constraints on the range of dependency that can be handled. HyenaDNA <cit.> has shown that SSMs can perform better than transformers for genomic sequence modeling. We show the top-1 accuracy of the genomic benchmark in table <ref> adapted from HyenaDNA paper <cit.> and another 18 dataset benchmark from Nucleotide transformer <ref>.



  * Chemical Domain (Drug Design):
Designing molecules from scratch requires navigating the space of chemical molecules, which may be of order (10^60) <cit.>. A generic language model known as the Chemical Language Model (CLM)<cit.> is capable of generating experimentally validated bio-active designs and acting as molecular generators. CLMs were traditionally implemented using LSTMs, but have also been implemented using Transformers. However, the quadratic complexity of transformers limits their chemical space exploration. The authors of <cit.> have adapted S4 to make it work as a generative CLM in designing valid and diverse molecules. 






 §.§ Video Domain:

Modern video processing techniques typically operate on short video clips (5-10-second clips). However, long-term video understanding problems<cit.> may require operating on longer video clips and modeling long-range dependencies in videos. They propose  Object Transformers, which are modeling long-range dependencies in videos. However, recent efforts such as ViS4mer<cit.> have shown that Mamba-based architectures can be adapted to long-term video understanding tasks as well including long-term video classification. The Structured State-Space Sequence (S4) model has garnered attention as a promising solution for modeling complex spatiotemporal dependencies in long-form videos. Its linear complexity makes it an attractive choice. However, a limitation arises when treating all image tokens equally, which can impact efficiency and accuracy. Unlike previous mask-based token reduction methods, our Selective S4 (S5) model employs a lightweight mask generator. It selectively chooses informative image tokens, leading to more efficient and accurate modeling of long-term dependencies in videos. Importantly, we avoid the dense self-attention calculation by leveraging guidance from the momentum-updated S4 model. However, like other token reduction techniques, there’s a risk of incorrectly dropping informative image tokens. To enhance the robustness and temporal context, we propose a novel approach called long-short masked contrastive learning (LSMCL)<cit.>. This enables our model to predict longer temporal dependencies using shorter input videos.  LSMCL is evaluated extensive comparative results on challenging long-form video understanding datasets (LVU, COIN, and Breakfast) demonstrate that our approach consistently outperforms the previous state-of-the-art S4 model by up to 9.6% accuracy, all while reducing its memory footprint by 23%.

The VideoMamba <cit.> is a state space model (SSM)-based approach designed specifically for efficient video understanding. VideoMamba tackles the dual challenges of local redundancy and global dependencies in video data.  It achieves this by innovatively adapting the Mamba <cit.> to the video domain. The existing 3D convolutional neural networks (CNNs) and video transformers have limitations, while VideoMamba aims to overcome these limitations by leveraging the linear-complexity operator inherent in the Mamba. This operator enables efficient long-term modeling, which is crucial for understanding high-resolution, lengthy videos. VideoMamba demonstrates scalability in the visual domain without extensive datasets pertaining to using the self-distillation technique. It showcases robustness in multi-modal contexts, making it compatible with other modalities. By combining these distinct advantages, VideoMamba sets a new benchmark for video understanding on various benchmarking datasets such as Kinetics (K400)<cit.>,  SthSthV2 (SSV2)<cit.>, Breakfast<cit.>,  Long-form Video Understanding (LUV)<cit.> and COIN<cit.> datasets. Table-<ref>,  table-<ref>, table-<ref>, and table-<ref> shows state pf the art results in K400, SSV2, LUV and breakfast and COIN dataset respectively.  SpikeMba <cit.> is a novel approach for temporal video grounding, a critical task in video content understanding. Temporal video grounding involves identifying specific moments or segments within a video that correspond to a given textual query or description. For example, if you have a video of a soccer match and a query like "goal scored by Messi," temporal video grounding aims to pinpoint the exact moment when Messi scores that goal. Existing methods struggle to capture fine-grained relationships between different modalities (such as video frames, audio, and text). SpikeMba integrates Spiking Neural Networks (SNNs) and state space models (SSMs). Contextual Moment Reasoner (CMR) balances contextual information preservation and semantic relevance exploration.  Vivim <cit.> is a Video Vision Mamba for Medical Video Object Segmentation. Mamba architecture enhances sequential modeling, improving accuracy.


 


  


  




 §.§ Tabular Domain

 While CNNs and transformers have been shown to perform well on tabular data, they may require significant computing resources, data pre-processing as well as tuning. They may not handle incremental feature learning, where features may get added sequentially. MambaTab <cit.> has shown that it can model incremental feature learning efficiently and has shown to perform comparably with CNNs and transformers while being more parameter efficient. Unlike traditional models, MambaTab can adapt to datasets with increasing features over time without requiring complete retraining along with that it requires minimal preprocessing and utilizes fewer computational resources. 

 This work develops an approach based on a structured state-space model (SSM), MambaTab, for tabular data. SSMs have strong capabilities for efficiently extracting effective representations from data with long-range dependencies. MambaTab leverages Mamba, an emerging SSM variant, for end-to-end supervised learning on tables. Compared to state-of-the-art baselines, MambaTab delivers superior performance while requiring significantly fewer parameters and minimal preprocessing, as empirically validated on diverse benchmark datasets. MambaTab's efficiency, scalability, generalizability, and predictive gains signify it as a lightweight, "out-of-the-box" solution for diverse tabular data with promise for enabling wider practical applications.
 




 §.§ Audio and Speech Domain:


In the domain of speech processing, Recurrent Neural Networks (RNNs) have conventionally been the primary choice for various tasks. However, the advent of attention-based transformers spurred endeavors to apply them to speech datasets. While attention networks excel at modeling long-range dependencies, they often struggle with handling local dependencies, necessitating a combination of convolutions. This fusion is exemplified in models like Conformer <cit.> and BranchFormer <cit.>. A pioneering effort in applying State Space Models (SSMs) to speech tasks is SaShiMi <cit.>. Recognizing the numerical instability of S4 for auto-regressive tasks, SaShiMi enforces the state matrix to be Hurwitz, rendering it suitable for tasks like audio generation. Multi-head SSM (MH-SSM) introduces an MH-SSM layer as a replacement for the attention layer in transformers, branding the hybrid model as StateFormer. StateFormer achieves state-of-the-art performance on speech datasets such as LibriSpeech <cit.>.


SP-Mamba <cit.> underscores the inadequacy of attention-based transformers for modeling lengthy speech signals due to their quadratic complexity. Instead, SP-Mamba adopts a bi-directional Mamba architecture, leveraging both time-domain and frequency-domain features. It replaces Bidirectional Long Short-Term Memory (BLSTM) with multiheaded self-attention for the time-frequency domain module. Evaluation of datasets like LibriSpeech <cit.> and WHAM <cit.> validates SP-Mamba's effectiveness. Concurrently, Dual-Path Mamba (DPMamba) <cit.> splits long speech signals into manageable chunks and applies Mamba across all chunks in both temporal directions. DPMamba demonstrates superior performance over transformers in tasks like speech separation, as evidenced by evaluations on datasets like WSJ0-2mix <cit.>. Additionally, Multichannel Long-Term Streaming Neural Speech Enhancement for Static and Moving Speakers <cit.> proposes a Mamba-based variant of SpatialNet to replace self-attention, showcasing the versatility of SSMs in enhancing speech-related tasks.



 §.§ Time Series Domain:

In the domain of time series modeling, traditional approaches have relied on statistical models like ARIMA(AutoRegressive Integrated Moving Average) for forecasting and analysis. However, recent advancements have witnessed a shift towards employing transformers, originally designed for natural language processing, in the time series domain. Models such as AutoFormer<cit.>, Informer<cit.>, FEDFormer<cit.>, TFT<cit.>, WaveNet<cit.>, and PatchTST<cit.> have been developed to adapt transformers to time series data. Despite their effectiveness, many of these models grapple with two key challenges: attention complexity and the ability to capture long-range dependencies inherent in time series data. To address these issues, recent research has turned to integrating state space models like S4 <cit.> into time series analysis.

State-of-the-art approaches for time series modeling now include innovative models such as Timemachine <cit.>, SiMBA <cit.>, and MambaMix <cit.>. These models leverage the power of state space models to efficiently capture temporal dependencies and patterns in time series data. To provide a comprehensive comparison between transformers and state space models for time series analysis, we collate benchmark results from both domains, as outlined in Table <ref> (adapted from the SiMBA paper <cit.>). Through such comparative analysis, researchers gain valuable insights into the strengths and weaknesses of each approach, aiding further advancements in time series modeling.





 
1.2













 §.§ Recommendation Systems:

Recommendation systems can be modeled as heterophilic<cit.> graphs (the opposite of homophilous graphs, where edges tend to connect to nodes of the same class). Graph Neural Networks (GNNs) typically work on homophelic graphs, while GraphMamba<cit.> has shown that it can perform well on heterophilic graphs on tasks such as product rating prediction (Nodes are products such as books, music, VDs, DVD, etc., while edges connect products that are frequently bought together). GraphMamba adapts SSMs to work on heterophilic graphs by using steps such as neighborhood tokenization, token ordering, selective scan, local, positional, and structural encoding.  DenseSSM<cit.> bridges the gap between SSMs and Transformers, offering efficient large language models with improved performance. Large language models (LLMs) based on the Transformer architecture face computational and memory constraints. DenseSSM: A novel approach that enhances information flow between SSM layers by selectively integrating shallow-layer hidden states into deeper layers. State Space Models (SSMs): These offer lower computational complexity but haven’t fully matched Transformer performance. it retains fine-grained information crucial for the final output while maintaining training parallelizability and inference efficiency.





 §.§ Graph Domain:

Graph-Mamba<cit.> is a novel method that integrates a Mamba block with a node selection mechanism to enhance long-range context modeling in graph networks. The objective of this paper is to address the challenge of modeling long-range dependencies in graph data using efficient methods. The core of Graph-Mamba is the Graph-Mamba block (GMB), which combines the selection mechanism of the Mamba module with a node prioritization approach. The Mamba block is known for its effectiveness in modeling long-range dependencies in sequential data while the node selection mechanism prioritizes and permutes nodes in a graph-centric manner. Graph-Mamba enhances context-aware reasoning by combining Mamba’s selection mechanism with graph-centric strategies. By formulating graph-centric node prioritization and permutation strategies, Graph-Mamba achieves substantial improvements in context-aware reasoning and predictive performance. Notably, it outperforms state-of-the-art methods in long-range graph prediction tasks, all while requiring only a fraction of the computational cost in terms of FLOPs and GPU memory consumption. Spatio Temporal Graph Mamba (STG-Mamba) <cit.> is a parallel effort that also leverages Mamba for spatio-temporal graph data modeling. 




 §.§ Multimodal Systems:

In the domain of multi-modal systems integrating both vision and language datasets, recent efforts have focused on enhancing traditional architectures with innovative modules to handle diverse data types effectively. VL-Mamba <cit.> extends the vanilla Mamba architecture by incorporating a dedicated multi-modal connector module, specifically designed for multi-modal tasks that involve both vision and language data. VL-Mamba incorporates a multi-modal connector module, which consists of a vision selection scan and two linear layers. This module facilitates effective fusion of visual and textual information. VL-Mamba's performance has been rigorously evaluated on standard multi-modal benchmark datasets such as VQA (Visual Question Answering), GQA (Visual Grounding Question Answering), and SQA (Science Question Answering). Comparative analysis demonstrates that VL-Mamba achieves performance levels comparable to other state-of-the-art language and vision models like  standard large language models (LLMs) such as Lava-1.5 and LavaVA-Phi. Notably, VL-Mamba addresses the efficiency challenge posed by the quadratic computation complexity of the Transformer network, which is commonly used in downstream tasks.

In a similar work, Cobra <cit.> introduces an extension to the Mamba architecture by incorporating visual information through an image encoder. The goal is to create an efficient multi-modal large language model (MLLM). By integrating visual information through an image encoder and employing a carefully crafted training recipe, Cobra emerges as a powerful multi-modal language model. Evaluation of vision-language benchmarks, including VQA and GQA, showcases Cobra's competitive performance compared to established transformer models like Lava-Phi. The comprehensive analysis presented in Table <ref> (adapted from VL-Mamba <cit.>) provides valuable insights into the efficacy of both transformers and SSMs in the multi-modal domain, guiding further advancements in this burgeoning field.




 §.§ Reinforcement Learning:

Behavior Cloning (BC) plays a crucial role in online reinforcement learning (RL), as it directly learns the mapping from states to actions from available datasets. However, BC faces challenges when sufficient expert demonstrations are not available. To address this limitation, return-conditioned BC has been introduced as a solution. Decision Transformer (DT)<cit.> is a groundbreaking approach that models reinforcement learning as a sequence modeling task. It leverages return-conditioned BC to enhance RL performance. DT applies Transformer architectures to RL, allowing it to capture complex dependencies in sequences of states, actions, and rewards. The core of DT lies in its causal self-attention network, which adeptly models sequences comprising states, actions, and rewards.


In the pursuit of capturing temporal dependencies and intricate patterns inherent in sequence modeling tasks, Decision Mamba (DMamba) <cit.>  focuses on modeling temporal dependencies and intricate patterns in sequence modeling tasks. Unlike DT, DMamba explores replacing the causal self-attention mechanism with the Mamba framework. DMamba employs Mamba as a token mixing module within a typical transformer architecture, including feed-forward networks and layer normalization.  Extensive evaluations demonstrate DMamba's superior performance over DT across D4RI <cit.> benchmarks and Atari <cit.> datasets. Notably, it showcases enhanced capabilities in capturing complex temporal dependencies, thus showcasing its efficacy in RL tasks. It's worth mentioning that Meta-RL <cit.>, although named Mamba, Meta-RL takes a different approach.  It proposes a meta-reinforcement learning strategy rather than being a state space model. Meta-RL aims to improve RL performance by learning across multiple tasks.














§ STATE OF THE ARTS RESULTS

We consolidate results from multiple sources and discuss the analysis in this section. We include Long Range Arena (LRA) benchmark results first for long sequence processing, as LRA captures text data processing tasks such as ListOps or even vision tasks such as PathFinder <cit.>. We also include four text benchmarks, namely, GLUE, Pile and Wikitext and report the results from several SSM papers.  We also have included vision benchmarks, namely the ImageNet classification and instance segmentation with MS Coco dataset. We also include seven-time series benchmark datasets in the performance comparison. 


 §.§ Dataset Details



  §.§.§ LRA

We offer additional context and details for each of the LRA (Long Range Aerena) datasets introduced by Tay et al. (2020)<cit.> and the Speech Commands dataset introduced by Warden et al. (2018). Our data preprocessing steps align with those outlined by Gu et al. (2021), which we present here for completeness.



  * : This dataset is an extension of the dataset introduced by Nangia et al. (2018) known as ListOps. It involves evaluating nested mathematical operations, such as  and , performed on integer operands ranging from zero to nine. The expressions are presented in prefix notation with brackets. The goal is to compute the integer result of the mathematical expression. Each character is encoded as a one-hot vector, with 17 unique values including operators and brackets. Sequences vary in length and are padded with a fixed indicator value to a maximum length of 2,000. A special end-of-sequence token is appended. There are 10 different classes representing the integer result of the expression. The dataset consists of 96,000 training sequences, 2,000 validation sequences, and 2,000 test sequences, without any normalization applied.


  * : This dataset is derived from the iMDB sentiment dataset introduced by Maas et al. (2011). It involves classifying movie reviews as positive or negative. Movie reviews are encoded as sequences of integer tokens, with 129 unique values representing characters. Sequences are padded to a maximum length of 4,096, and there are 25,000 training examples and 25,000 test examples. No validation set is provided, and no normalization is applied.


  * : This dataset is based on the ACL Anthology network corpus presented by Radev et al. (2009). It aims to classify whether two textual citations are equivalent. Citations are encoded as sequences of integer tokens, and each pair of citations is compressed separately before being passed into a final classifier layer. The decoder head then utilizes the encoded representation to perform the classification task. Characters are encoded into one-hot vectors with 97 unique values. Paired sequences may have unequal lengths, with a maximum length of 4,000. The dataset consists of 147,086 training pairs, 18,090 validation pairs, and 17,437 test pairs, with no normalization applied.


  * : This dataset utilizes the CIFAR-10 dataset introduced by Krizhevsky et al. (2009). It involves classifying 32 × 32 grayscale CIFAR-10 images into one of ten classes. Images are represented as one-dimensional raster scans of length 1,024. There are 45,000 training examples, 5,000 validation examples, and 10,000 test examples. RGB pixel values are converted to grayscale intensities and normalized to have zero mean and unit variance across the entire dataset.


  * : This dataset is based on the Pathfinder challenge introduced by Linsley et al. (2018). It aims to classify whether a dashed line or path joins the start and end points in a 32 × 32 grayscale image. There are two classes indicating the presence or absence of a valid path. Sequences are of equal length (1,024), and there are 160,000 training examples, 20,000 validation examples, and 20,000 test examples. The data is normalized to the range [-1, 1].


  * : An extension of the Pathfinder challenge where images are 128 × 128 pixels, resulting in sequences that are sixteen times longer. Otherwise, it is identical to the Pathfinder challenge.
 






  §.§.§ Multi Varitate Time Series  Benchmark Datasets

The evaluation of the SSM model, conducted across seven benchmark standard datasets commonly used for Multivariate Time Series Forecasting, showcases its robust performance compared to a range of state-of-the-art models. Here's a detailed elaboration: The evaluation was performed on seven benchmark datasets widely used in the field of Multivariate Time Series Forecasting. These datasets cover various domains including Electricity, Weather, Traffic, and four datasets from the Energy Time Series Forecasting (ETT) domain: ETTh1, ETTh2, ETTm1, and ETTm2.



  §.§.§ Video Understanding Datasets

To evaluate VideoMamba's performance in both short-term and long-term video understanding, we conducted experiments on six diverse datasets:


    
  * Short-term Video Understanding:
We assessed VideoMamba's capabilities on scene-related and temporal-related tasks using two widely-used datasets:

    
  * Kinetics-400: This dataset consists of videos with an average length of 10 seconds, focusing on scene-related actions.
    
  * Something-Something V2: These videos have an average duration of 4 seconds and emphasize temporal-related actions.



  * Long-term Video Understanding:
For long-term video comprehension, we conducted rigorous evaluations on three comprehensive datasets:

    
  * Breakfast: This dataset comprises 1,712 videos, covering 10 intricate cooking activities spanning 77 hours.

  * COIN: Featuring 11,827 videos across 180 procedural tasks, with an average duration of 2.36 minutes, COIN provides a diverse range of video content for evaluation.


  * Long-form Video Understanding (LVU): LVU is a benchmark consisting of approximately 30,000 movie clips, lasting between 1 to 3 minutes each. It encompasses nine tasks across three primary categories: content understanding, metadata prediction, and user engagement.


By conducting evaluations on these datasets, we aim to comprehensively assess VideoMamba's performance across various aspects of video understanding, including scene recognition, temporal reasoning, and long-term comprehension of complex video content.



  §.§.§ Multimodal Large Langauge Model Datasets


We conducted a comprehensive evaluation of our model across a diverse range of 8 benchmark datasets:


    
  * VQA-v2 <cit.>: This dataset focuses on assessing models' capability to comprehend and reason about images and accompanying questions.
    
  * GQA <cit.> : Designed to evaluate spatial understanding and multi-step inference in real-world images.
    
  * ScienceQA-IMG <cit.>: Provides multimodal multiple-choice questions on scientific topics, emphasizing common sense reasoning.
    
  * TextVQA <cit.>: Contains questions related to text within images, evaluating the model's optical character recognition (OCR) and inference abilities.
    
  * POPE  <cit.>: A benchmark for evaluating object hallucinations, involving a binary classification task determining the presence of objects.
    
  * MME  <cit.>: Evaluates perceptual and cognitive abilities, including OCR, object recognition, common sense reasoning, numerical calculations, text translation, and code reasoning.
    
  * MMBench <cit.>: Features 3,000 single-choice questions across 20 dimensions, utilizing a CircularEval strategy for robust evaluation, with ChatGPT matching model predictions to choices.
    
  * MM-Vet <cit.>: Identifies 16 emergent tasks from core visual and linguistic (VL) capabilities, including Recognition, Knowledge, OCR, Spatial awareness, Language generation, and Math.


Each dataset presents unique challenges and evaluates various aspects of multimodal understanding, ranging from basic object recognition to complex reasoning and inference tasks across images and text.





 §.§ Results



  §.§.§ LRA

We adopted the table from the HGRN paper <cit.> and the S5 paper <cit.> and consolidated the results into the table below <ref>. This result shows that transformers such as Local Attention, Sparse Attention, LongFormer, LinFormer, Reformer, Sinkhorn, Synthesizer, BigBird, Linear Transformer, Performer, CosFormer, FNet, NystromFormer, Luna, H-Transformer-ID and CCNN do not perform too well on LRA benchmarks, on many tasks ListOps, Text, Retrieval, Image, Pathfinder and Path-X - this is due to the quadratic complexity of attention and lack of inductive bias of transformers. State space models outperform transformers on LRA benchmarks. Among SSMs, we found that S5 and Mega are the top-performing SSMs across all the tasks. S4, one of the pioneering models, is outperformed by its variants such as DSS, S4nd, Liquid-S4, etc. TNN, HGRN and LRU are in the middle and outperform S4 and its variants. However, the exact reason as to why S5 and Mega should be top-performing SSMs remains to be explored. One could possibly analyze the SSMs from an explainability perspective to get to the bottom of these results, which we leave for future work. 



  §.§.§ Language Domain

We show results from three benchmarks, including GLUE captured in table <ref>. Glue is a combination of six tasks, MNLI, QNLI, QQP, SST2, MRPC, and Cola.  The table is divided into four categories, namely, attention based transformers, MLP-based networks, FFT based transformers, and state space models. We find that SSMs have a performance gap with all three architectures, while MLP-based networks and FFT based transformers get better scores than SSMs. The attention-based transformers are the top performers on this benchmark, with the Toeplitz Neural Network (TNN) being the only exception, with TNN outperforming all including attention-based transformers. 

Similarly, another benchmark we use for the language domain evaluation is the WikiText data <cit.>. The table below <ref> captures the perplexity scores of the different architectures and models. We adopted the table from the TNN paper <cit.> and HGRN paper <cit.> and consolidated the results into the table below <ref>. The perplexity score measures the ability of a model to make a next-word prediction, with lower the perplexity score the better. This table captures results on validation and test sets. The table is divided into attention-based transformers, MLP-based networks, and SSMs.  Again, it can be observed that attention-based transformers outperform other architectures, including SSMs. However, the HGRN SSM outperforms all others and has the lowest perplexity scores. 

The last benchmark in the language domain is the Pile benchmark. Pile is an 825GB benchmark that comprises several smaller datasets combined together, namely, PubMed Central, ArXiv, GitHub, the FreeLaw Project, Stack Exchange, the US Patent and Trademark Office, PubMed, Ubuntu IRC, HackerNews, YouTube, PhilPapers, and NIH ExPorter. We give below the results from the leaderboard of the Pile benchmark and other sources in table <ref>. We find that HGRN is the only SSM that performs comparably with attention-based transformers, especially if they have been trained on the Pile datasets.







  §.§.§ Image  Domain


We show evaluation on the ImageNet-1K dataset showcases the performance of various vision backbones across different architectural categories and computational complexities as reported in table-<ref>. Among CNNs, RegNetY-8G and RegNetY-16G stand out with accuracies of 81.7% and 82.9%, respectively. These results underscore the effectiveness of SSM models in capturing image representations, with LocalVMamba-S and PlainMamba-L3 showcasing competitive performance. Additionally, transformer models such as Swin-T and EffNet-B4 demonstrate strong performance, while RegNetY-8G and RegNetY-16G emerge as top performers among CNNs.  In comparison, transformer models such as Swin-T and EffNet-B4 achieve accuracies of 81.3% and 82.9%, respectively.  Notably, RegNetY-8G and RegNetY-16G stand out among convnets, achieving top-1 accuracies of 81.7% and 82.9%, respectively. Among transformers, SpectFormer-H-B, SVT-H-B, and and SCT-H-B exhibit impressive performance, achieving top-1 accuracies of 85.1%, 85.2%, and 85.2%, respectively. Among SSM models, LocalVMamba-S demonstrates strong performance with a top-1 accuracy of 83.7%, while PlainMamba-L3 achieves competitive results with an accuracy of 82.3%. Vim-Ti and VMamba-T also exhibit noteworthy performance, achieving accuracies of 76.1% and 82.2%, respectively. For SSMs, SiMBA-S(MLP) emerges as a strong contender, achieving a top-1 accuracy of 84.0%, while SiMBA-B(MLP) and SiMBA-L(EinFFT) attain top-1 accuracies of 84.7% and 83.9%, respectively. These results underscore the effectiveness of diverse architectural approaches across different computational complexities in addressing image recognition tasks.



The table-<ref> presents the state-of-the-art (SOTA) performance of various Structured State Space Models (SSMs) on the ImageNet-1K dataset for image classification tasks. These SSM models are grouped based on their computational complexity measured in GFLOPs (Small, Base, and Large). Notable models include HyenaViT-B, S4ND-ViT-B, Vim-S, HGRN-S, PlainMamba-L3, Mamba-2D-B, VMamba-S, LocalVMamba-S, SiMBA-L(Monarch), ViM2-B, and SiMBA-L(EinFFT), achieving top-1 accuracy ranging from 78.5% to 84.5%. These models demonstrate competitive performance while varying in parameter counts and computational complexity, showcasing the effectiveness of SSMs for image classification tasks with improved computational efficiency.






  §.§.§ Multimodal Applications

VL-Mamba, achieves notable performance across various benchmarks as shown in table-<ref>. With similar multimodal training data, VL-Mamba outperforms SQAI (65.4 vs. 61.2), VQAT (48.9 vs. 47.5), and MME (1369.6 vs. 1288.9). Remarkably, despite having fewer pretrained tokens (627B) compared to MobileVLM's backbone MobileLLaMA (1.3T), VL-Mamba exhibits superior performance. For instance, compared to LLaVA-Phi with the Phi-2-2.7B language model, VL-Mamba demonstrates better performance on VQA-v2 (76.6 vs. 71.4), MME (1369 vs. 1335.1), and MM-Vet (32.6 vs. 28.9). These results underscore the efficacy of VL-Mamba in multimodal learning tasks and highlight the potential of leveraging state-space models for such applications




  §.§.§ Time Series Forecasting 



The evaluation of the SSM model, conducted across seven benchmark standard datasets commonly used for Multivariate Time Series Forecasting, showcases its robust performance compared to a range of state-of-the-art models.  The evaluation compared SiMBA against several state-of-the-art models, including Transformer-based methods such as PatchTST, CrossFormer, FEDFormer, ETSFormer, PyraFormer, and AutoFormer. It also included comparisons with CNN-based models like TimeNet, graph-based approaches such as MTGNN, and MLP-based models like DLinear. The performance of SiMBA and the comparison models was assessed using common evaluation metrics for time series forecasting tasks. These metrics typically include Mean Squared Error (MSE) and Mean Absolute Error (MAE), which are standard measures for quantifying the accuracy of forecasting models. SiMBA consistently outperformed existing state-of-the-art models across the evaluated datasets in terms of MSE and MAE. This indicates that SiMBA is adept at capturing temporal patterns and making accurate predictions across various time series forecasting tasks and modalities. The superior performance of SiMBA underscores its adaptability and efficacy in handling diverse time series forecasting challenges, establishing it as a prominent model in the field. Overall, the extensive evaluation of SiMBA across multiple benchmark datasets and comparison with state-of-the-art models demonstrates its robust performance and effectiveness in addressing a wide range of time series forecasting tasks. The findings highlight SiMBA as a promising model for practical applications in various domains requiring accurate and reliable time-series predictions.





  §.§.§ Video  Domain




The table-<ref> provides a comparison of various models' performance on scene-related Kinetics-400 dataset. It includes architectures such as CNN, transformers (Trans.), and state space models (SSM), along with their corresponding models, input data characteristics, number of parameters, and FLOPs (floating point operations).  For each architecture type, the table lists different models, indicating whether they are supervised or self-supervised. The models are evaluated based on their performance in terms of Top-1 and Top-5 accuracy on the Kinetics-400 dataset. Additionally, the table highlights whether the models utilize isotropic architecture without downsampling layers, extra data, and pretrained teacher models.  Supervised CNN models like SlowFast, X3D-M, and X3D-XL achieve competitive performance. Transformer models such as Swin-T and Swin-B demonstrate strong performance, especially when trained with additional data from IN-21K.  Models combining CNN and Transformer components (CNN+Trans.) like MViTv1-B and UniFormer-B exhibit promising results. State space models (SSM) such as VideoMamba show competitive performance, with VideoMamba-M outperforming other models in terms of Top-1 and Top-5 accuracy, particularly when trained with extra data from CLIP-400M.

Table-<ref> presents a comparison of various models' performance on the temporal-related SthSth V2 dataset. It includes architectures such as CNN, transformers (Trans.), and state space models (SSM), along with their corresponding models, input data characteristics, number of parameters, and FLOPs (floating point operations). CNN models like SlowFast_R101, CT-Net_R50, and TDN_R50 demonstrate moderate performance on the SthSth V2 dataset. The transformer model Swin-B achieves competitive performance compared to CNN models. Models combining CNN and transformer components (CNN+Trans.) like MViTv1-B and UniFormer-B show promising results, with UniFormer-B outperforming other models in terms of Top-1 accuracy. Transformer models such as TimeSformer-HR and ViViT-L also exhibit reasonable performance on the dataset.  State space models (SSM) like VideoMamba demonstrate competitive performance, with VideoMamba-M showing the highest Top-1 accuracy among SSMs. Self-supervised transformer models like VideoMAE-B_2400e and UMT-B_800e perform well, particularly when utilizing the CLIP-400M pretrained teacher model. VideoMamba-M_800e, a state space model trained with CLIP-400M, achieves the highest Top-1 accuracy among SSMs.


The table-<ref> compares various methods' performance on LVU (Large-scale Video Understanding) using different evaluation metrics related to content, metadata, and user engagement.  Methods like VideoBERT, Object Trans., LST, Performer, Orthoformer, ViS4mer, and VideoMamba_f32 employ different architectures and backbones to understand video content. VideoMamba_f32 achieves the highest scores in content-related metrics, particularly in scene understanding.  Metadata understanding involves attributes such as director, genre, writer, and release year. VideoMamba_f32 outperforms other methods in most metadata-related metrics, indicating its ability to extract useful information from video metadata. Some methods, like VideoMamba_f32, are end-to-end (e2e) approaches, which do not rely on exhausting feature extraction separately. This integrated approach helps in better understanding and utilizing both content and metadata for user engagement prediction.
 


The table-<ref> presents a comparison of various methods' performance on the Breakfast (BF) and COIN datasets, focusing on end-to-end (e2e) approaches and different backbone architectures. The existing methods such as Timeception, VideoGraph, and GHRM are some of the existing methods that utilize different backbone architectures and pretraining datasets to achieve performance on BF and COIN datasets. Distant Supervision achieves the highest performance among existing methods, leveraging TimeSformer with attention and knowledge base (KB) pretraining.
 Turbo_f32 is an end-to-end approach using VideoMAE-B backbone, achieving competitive performance on both datasets.  VideoMamba_f32 and VideoMamba_f64 employ different variants of the VideoMamba backbone (Ti, S, M) and achieve high accuracy on both BF and COIN datasets.
 VideoMamba_f32 and VideoMamba_f64 with a masked pretraining backbone (marked with †) achieve even higher performance, especially VideoMamba_f32, which achieves the highest accuracy on both datasets.  VideoMamba backbone variants (Ti, S, M) with different precision (f32, f64) are evaluated, showing that higher precision (f64) generally leads to better performance. Among all variants, VideoMamba-M with f32 precision and a masked pretraining backbone achieves the highest accuracy on the BF dataset, while VideoMamba-M with f64 precision performs the best on the COIN dataset.



§ CONCLUSIONS

This paper has provided a survey of state space models for sequence processing - how they evolved from RNNs and how they are now competing with transformers on several language, vision, time series, video, audio tasks, and benchmarks. While there are still some tasks like copying and retrieving information from the context where transformers outperform SSMs, SSMs have lowered the performance gap with state-of-the-art transformers in several domains. We have classified the SSMs into three buckets, namely, the structured, gated, and recurrent - we have also identified the foundational models in each category and discussed the core contributions made by each. In addition, we have also consolidated the performance benchmarking of SSMs and compared them to state-of-the-art transformers in various domains and benchmark datasets. This has opened up the research possibilities in SSMs and closed the performance gap with transformers in different domains. For instance, the SiMBA combines transformers and Mamba architecturally and achieves state-of-the-art results on standard time series and vision benchmark datasets. Similarly, the other foundational SSMs can also be combined with the transformers to outperform state-of-art transformers. We also identify that scaling the SSMs to large network sizes is still an open issue, especially with Mamba which has certain stability issues at scale. The stability of SSMs at large network sizes is an open issue, especially in computer vision. Another possible open research problem is to solve advanced in-context learning tasks - though transformers and state space models have been trained to perform certain in-context learning tasks.









plain








