S7: Selective and Simplified State Space Layers for Sequence Modeling

## Abstract

Abstract A central challenge in sequence modeling is efficiently handling tasks with extended contexts. While recent state-space models (SSMs) have made significant progress in this area, they often lack input-dependent filtering or require substantial increases in model complexity to handle input variability. We address this gap by introducing S7 , a simplified yet powerful SSM that can handle input dependence while incorporating stable reparameterization and specific design choices to dynamically adjust state transitions based on input content, maintaining efficiency and performance. We prove that this reparameterization ensures stability in long-sequence modeling by keeping state transitions well-behaved over time. Additionally, it controls the gradient norm, enabling efficient training and preventing issues like exploding or vanishing gradients. S7 significantly outperforms baselines across various sequence modeling tasks, including neuromorphic event-based datasets, Long Range Arena benchmarks, and various physical and biological time series. Overall, S7 offers a more straightforward approach to sequence modeling without relying on complex, domain-specific inductive biases, achieving significant improvements across key benchmarks.

## 1 Introduction

Sequence modeling is a fundamental challenge in deep learning, with applications spanning natural language processing, computer vision, audio processing, and genomics (Sutskever et al., ; Graves et al., ). The core problem lies in effectively capturing and utilizing information from long input sequences while maintaining computational efficiency. Traditional approaches, such as recurrent neural networks (RNNs) (Hochreiter & Schmidhuber, ), struggle with long-range dependencies due to vanishing gradients (Bengio et al., ), while attention-based models like Transformers (Vaswani et al., ) face quadratic complexity in sequence length, limiting their scalability. While efficient, convolutional models (Bai et al., ) cannot often capture global context. The key challenge is to design a model that can (1) efficiently process very long sequences, (2) adaptively filter and retain relevant information over extended time horizons, (3) perform content-based reasoning, and (4) maintain a compact state representation. Recent advances in Deep State Space Models (Deep SSMs) (Gu et al., ; Hasani et al., ) have shown promise, but existing approaches like S4 (Gu et al., ) and Mamba (Gu & Dao, ) still face limitations in balancing these requirements. S4 models, while efficient, lack input-dependent filtering capabilities, and Mamba, though more flexible, introduces significant complexity. There is a clear need for a model that combines the efficiency of recurrent architectures with the adaptive, content-aware processing capabilities of more complex models without sacrificing simplicity or generalizability across diverse sequence modeling tasks (Tay et al., ; Schlag et al., ).

The importance of effective sequence modeling cannot be overstated in today’s AI landscape. It forms the backbone of large language models (Brown et al., ), which have revolutionized natural language processing and are increasingly applied across diverse domains. In computer vision, sequence modeling enables video data processing and event-based vision (Zubić et al., ; ), critical for applications like autonomous driving and robotics. Genomics allows for analyzing long DNA sequences, potentially unlocking breakthroughs in personalized medicine and drug discovery (Avsec et al., ). However, the problem is inherently challenging due to several factors. First, the sheer length of sequences in real-world applications (often millions of tokens) makes it computationally intensive to process and retain relevant information (Tay et al., ). Second, the relevance of information can vary dramatically across the sequence, requiring adaptive filtering mechanisms (Katharopoulos et al., ). Third, capturing long-range dependencies and performing content-based reasoning demands sophisticated architectures to maintain and update a meaningful state over time (Dai et al., ). Finally, there’s a fundamental tension between model expressivity and computational efficiency – more powerful models often come at the cost of increased complexity and resource requirements (Tay et al., ). Balancing these competing demands while maintaining generalizability across diverse tasks remains an open challenge in the field (Schlag et al., ), driving the need for innovative approaches to push the boundaries of what’s possible in sequence modeling.

Recent advancements in sequence modeling have made significant strides. Transformer architectures (Vaswani et al., ) revolutionized the field with their attention mechanisms, enabling parallel processing and capturing long-range dependencies. However, their quadratic complexity in sequence length remains a limitation. Efficient transformer variants (Kitaev et al., ; Beltagy et al., ) attempted to address this, but often at the cost of reduced model capacity. The emergence of Deep State Space Models (SSMs) marked a new frontier, with S4 (Gu et al., ) demonstrating impressive performance on long-range tasks while maintaining linear complexity. Mamba (Gu & Dao, ) further improved upon this by introducing input-dependent dynamics, enhancing the model’s ability to perform content-based filtering. Despite these advances, the field has yet to achieve an optimal balance between efficiency, adaptability, and simplicity. The primary stumbling block lies in reconciling the need for input-dependent processing—crucial for adaptive filtering and content-based reasoning—with the computational efficiency of recurrent architectures. S4 models, while efficient, lack input-dependent dynamics, limiting their ability to adapt to varying content.
Conversely, Mamba introduces input dependence at the cost of increased complexity and reliance on specialized hardware implementations. The challenge now is to develop a model that combines the strengths of these approaches—the efficiency and simplicity of recurrent models with the adaptive capabilities of input-dependent systems—without compromising on performance or generalizability across diverse tasks (Schlag et al., ; Tay et al., ; Zubić et al., ). This balance is critical for pushing sequence modeling towards more general and scalable AI systems capable of handling the complexities of real-world data across various domains.

Our paper introduces S7, a simplified yet powerful State Space Model (SSM) that advances the frontier of sequence modeling by making the purely recurrent, time-domain S5 model input-dependent. This critical insight combines the efficiency of recurrent architectures with the adaptive processing capabilities of more complex models. By dynamically adjusting state transitions based on input content, S7 performs content-based reasoning and adaptive filtering while preserving recurrent models’ simplicity and computational efficiency. Unlike S4, which lacks input-dependent dynamics, or S6 (Mamba), which introduces hardware-specific complexity, S7 achieves a balanced design. We introduce stable reparameterization and additional design choices that ensure long-term stability and performance across diverse tasks.

Our extensive experiments validate S7’s versatility and effectiveness across a wide range of sequence modeling tasks, setting new standards in the field. On event-based vision datasets, S7 achieves state-of-the-art results, attaining accuracies of 99.2% on DVS-Gesture, 96.3% on Spiking Heidelberg Digits, and 88.2% on Spiking Speech Commands, significantly outperforming traditional dense methods. In human activity recognition, S7 achieves an impressive accuracy of 94.1%, demonstrating its capability to handle irregularly sampled, noisy time-series data. For genomics classification, S7 sets a new benchmark with 97.5% accuracy on the EigenWorms dataset, effectively capturing very long-term dependencies in sequences of length 17,984. On the Long Range Arena benchmarks (Tay et al., ), S7 excels in multiple tasks, achieving 63.77% accuracy on ListOps and 91.80% on Retrieval, outperforming prior state-of-the-art models and 87.22% accuracy on the Text classification task, showcasing its ability to process and understand long textual sequences. Moreover, S7 demonstrates remarkable efficiency and precision in simulating physical dynamical systems, reducing the test $L^{2}$ error by nearly half compared to previous models in predicting the FitzHugh-Nagumo system, and achieves the lowest Mean Squared Error (MSE) of 0.114 in the Walker2d Kinematic Simulation task. These results show S7’s ability to generalize across diverse domains, offering a more efficient and adaptable approach to sequence modeling without relying on domain-specific inductive biases, and highlight S7’s improvements in capturing long-range dependencies and complex temporal patterns while maintaining computational efficiency, marking a significant improvement over previous models and opening new avenues for research and application in the field of sequence modeling.

## 2 Related work

Sequence modeling has evolved from traditional RNNs (Elman, ), including LSTMs (Hochreiter & Schmidhuber, ) and GRUs (Cho et al., ), which struggle with long-range dependencies (Bengio et al., ), to CNNs adapted for sequential data (Bai et al., ; van den Oord et al., ), and then to attention-based models like Transformers (Vaswani et al., ). While Transformers excel at capturing long-range dependencies, their quadratic complexity led to the development of efficient variants using linear (Katharopoulos et al., ; Wang et al., ) or sparse attention (Child et al., ; Beltagy et al., ). SSMs emerged as a promising approach, with S4 (Gu et al., ) achieving state-of-the-art performance on long-range tasks while maintaining linear complexity. Subsequent work refined SSMs, leading to S4D (Gu et al., ) and S5 (Smith et al., ). The limitation of fixed dynamics in traditional SSMs motivated input-dependent models, notably the Mamba architecture (Gu & Dao, ) with its selective state spaces and its recent extension, Mamba-2 (Dao & Gu, ), which further improves performance and efficiency. These advancements have impacted various domains, including event-based vision processing (Zubić et al., ) and have been evaluated on long-range sequence modeling benchmarks (Tay et al., ). Theoretical work has explored connections to control theory (Gu et al., ), approximation capabilities (Gu et al., ), and complexity analysis (Dao et al., ). Our work, S7, builds upon these foundations, particularly SSMs and input-dependent models, aiming to combine the efficiency of recurrent architectures with adaptive capabilities to address limitations in existing approaches. Specifically, S7 applies to S5 the same principle of input-dependence that Mamba introduced to S4, but within the context of a purely recurrent, time-domain model.

## 3 Method

### 3.1 Background

##### State Space Models (SSMs)

SSMs are a class of models widely used in control theory, neuroscience, and machine learning for modeling sequential data. The core of SSMs lies in their representation of a system’s evolution over time through a latent state. Mathematically, SSMs are typically represented as:

$$ $\dot{x}(t)=Ax(t)+Bu(t)\quad\quad y(t)=Cx(t)+Du(t)$ (1) $$

where $x(t)\in\mathbb{R}^{H}$ is the latent state vector, $u(t)\in\mathbb{R}^{N}$ is the input signal, and $y(t)\in\mathbb{R}^{N}$ is the output. The system is governed by the matrices $A\in\mathbb{R}^{H\times H}$, $B\in\mathbb{R}^{H\times N}$, $C\in\mathbb{R}^{N\times H}$, and $D\in\mathbb{R}^{N\times N}$, which are the parameters to be learned. SSMs capture long-range dependencies in sequential data by evolving the latent state over time in a continuous manner (Gu et al., ; Smith et al., ). In deep learning, SSMs can be stacked in multiple layers, allowing them to process complex sequential data more effectively. By stacking SSM layers, these models can capture intricate temporal patterns while maintaining a compact state representation, efficiently handling long sequences (Gu et al., ).

##### Discretization of Continuous SSMs

In practice, continuous SSMs must be discretized to apply them in computational models, particularly for deep learning tasks. The discretization process converts continuous-time dynamics into a form that can be computed at discrete time steps, typically using methods such as the zero-order hold (ZOH). The discrete equivalent of the continuous system is given by:

$$ $x_{k}=\bar{\Lambda}x_{k-1}+\bar{B}u_{k}\quad\quad y_{k}=\bar{C}x_{k}+\bar{D}u_ {k}$ (2) $$

where $\bar{\Lambda}=e^{A\Delta t}$ and $\Delta t$ is the time step size (Smith et al., ). This formulation allows the model to process input sequences at discrete intervals, making it suitable for training on modern hardware. Efficient discretization techniques are essential to ensure that SSMs retain their ability to model long-range dependencies without becoming computationally expensive (Gu et al., ).

### 3.2 Input Dependency in State-Space Models

To improve the performance of SSMs, input dependence can be introduced by making the transition matrices a function of the input. In S7, the system evolution at time step $k$ can be described by the following discretized equations:

$$ $x_{k}=\bar{\Lambda}_{k}x_{k-1}+\bar{B}_{k}u_{k}\quad\quad y_{k}=\bar{C}_{k}x_{ k}+\bar{D}_{k}u_{k}$ (3) $$

Here, the transition matrix $\bar{\Lambda}_{k}$, along with the input matrices $\bar{B}_{k}$, $\bar{C}_{k}$, and $\bar{D}_{k}$, are functions of the input $u_{k}$, allowing the model to adapt to the current input at each time step dynamically. This enables the model to filter information, selectively determining what to retain and forget. Doing so enhances the model’s ability to capture essential long-term dependencies while filtering out irrelevant information, improving performance and generalization. The system output $y_{k}$ is processed through normalization layers, followed by a GeLU activation and a gating mechanism. The gating function, represented by a sigmoid activation $\sigma(W\cdot\text{GeLU}(y_{k}))$, helps regulate how much of the processed information passes through, enabling the model to control the flow of information based on the input signal and current state.

This dynamic gating allows the model to adjust the information flow based on the input signal and the current state, providing a more robust and flexible state evolution. Introducing input-dependent dynamics improves S7’s ability to handle diverse temporal dependencies, effectively filtering and retaining relevant information over time.
By making the state transition matrices depend on the input $u_{k}$, S7 improves on the limitations of static state transitions found in previous models, such as S4 and S5 (Gu et al., ; Smith et al., ), which lacked the flexibility to adapt state transitions based on the input. This selective updating of internal states allows S7 to balance long-term and short-term dependencies, leading to better performance and more effective memory management in sequence modeling tasks.

### 3.3 The S7 Layer

Building on the foundation of input dependency and recurrent SSMs, we introduce the S7 model, which extends the capabilities of the S5 model by incorporating input-dependent state transitions and improving training stability via reparameterization techniques. This allows S7 to dynamically adjust its state transitions based on input content while maintaining the efficiency of recurrent models for long-sequence tasks.

Figure: Figure 1: The S7 Layer Architecture. The diagram illustrates the recurrent structure of the S7 model, which integrates input-dependent state-space models with stable parameterization. The transition matrices $B_{k}$, $C_{k}$, $D_{k}$, and $\bar{\Lambda}_{k}$ reflect the interaction between input $u_{k}$ and previous hidden state $x_{k-1}$, while non-linearity is reinforced by the sigmoid. Contrary to input-dependent S6 (Mamba) Gu & Dao (), this model is much simpler and based on S5 (Smith et al., ).
Refer to caption: x1.png

##### Stable Reparameterization for Long-Term Dependencies

To ensure stability during long-sequence modeling, with S7, we employ a reparameterization of the transition matrix $\bar{\Lambda}_{k}$, inspired by StableSSM (Wang & Li, ). The recurrent matrix is modified by a stability function, ensuring that the system avoids unstable behavior over time. Specifically, the reparameterization is applied as:

$$ $\bar{\Lambda}_{k}=f(\Lambda_{k})=I-\left(\Lambda_{k}^{2}+0.5I\right)^{-1}$ (4) $$

where $I$ is the identity matrix.
This stability function guarantees that the eigenvalues of the matrix remain within a range that promotes stable dynamics, even in the presence of long-range dependencies. Theoretical and experimental details on reparametrizations are in the A.4 & A.6. As already said, we assume the system follows input-dependent dynamics, where the hidden states evolve according to the differential equation:

$$ $x_{k}=\Lambda_{k}(u_{k};\theta_{m})x_{k-1}+B_{k}(\theta_{m})u_{k}+b_{k}(\theta _{m})\quad y_{k}=C_{k}(\theta_{m})x_{k}+D_{k}(\theta_{m})u_{k}$ (5) $$

where $x_{k}\in\mathbb{R}^{m}$ is the hidden state at time step $k$, and $u_{k}\in\mathbb{R}^{d}$ is the input at time step $k$. The matrices $\Lambda_{k}(\theta_{m})\in\mathbb{R}^{m\times m}$, $B_{k}(\theta_{m})\in\mathbb{R}^{m\times d}$, $b_{k}(\theta_{m})\in\mathbb{R}^{m}$, $C_{k}(\theta_{m})\in\mathbb{R}^{d\times m}$, and $D_{k}(\theta_{m})\in\mathbb{R}^{d\times d}$ are parameterized by $\theta_{m}$, the model’s trainable parameters.

The parameterization of the system $\theta_{m}$ in terms of our notation can be described as $\theta_{m}=(\Lambda_{k},B_{k},b_{k},C_{k},D_{k})$, where $\theta_{m}\in\Theta_{m}:=\{\mathbb{R}^{m\times m}\times\mathbb{R}^{m\times d}
\times\mathbb{R}^{m}\times\mathbb{R}^{d\times m}\times\mathbb{R}^{d\times d}\}$. This defines $\theta_{m}$ as the set of all trainable parameters in the SSM.

###### Assumption 3.1 .

The mappings $\theta_{m}\mapsto\Lambda_{k}(\theta_{m})$, $\theta_{m}\mapsto B_{k}(\theta_{m})$, $\theta_{m}\mapsto b_{k}(\theta_{m})$, and $\theta_{m}\mapsto C_{k}(\theta_{m})$ are Lipschitz continuous for all $u_{k}$ in a bounded input space $\mathcal{X}\subset\mathbb{R}^{d}$. This ensures that small parameter changes lead to small changes in the state transition matrices, promoting stable learning and smooth transitions over time.

###### Assumption 3.2 .

For all $u_{k}\in\mathcal{X}$, the eigenvalues of $\Lambda_{k}(\theta_{m})$ have negative real parts, ensuring that the system remains uniformly asymptotically stable.

###### Assumption 3.3 .

The parameters $\theta_{m}$ are subject to a stable reparameterization $f$, such that $\theta_{m}=f(w_{m})$, meaning raw model $w_{m}$ parameters after reparametrization are $\theta_{m}$, and $f$ satisfies the stable reparameterization condition defined by:

$$ $\sup_{w}\left[\|f(w)\|\sup_{\|\tilde{w}-w\|\leq\beta}\int_{0}^{\infty}\left\| \Phi_{\tilde{w}}(k,s)-\Phi_{w}(k,s)\right\|\,dk\right]\leq g(\beta)$ (6) $$

for some continuous function $g:[0,\infty)\to[0,\infty]$ with $g(0)=0$.
Here, $\Phi_{w}(k,s)$ denotes the state transition matrix corresponding to parameters $w$, which satisfies:

$$ $\frac{d}{dk}\Phi_{w}(k,s)=\Lambda_{k}(u_{k};f(w))\Phi_{w}(k,s),\quad\Phi_{w}(s ,s)=I_{m}.$ (7) $$

The state transition matrix $\Phi_{w}(k,s)$ describes the evolution of the system’s state from time $s$ to time $k$ under the dynamics defined by $\Lambda_{k}(u_{k};f(w))$ and $I_{m}$ is the identity matrix. The constant parameter $\beta$ limits how much the parameters can be perturbed while ensuring that the state transition matrices and system behavior remain stable. The function $g(\beta)$ helps quantify how much the difference between the perturbed and unperturbed system can grow. As $\beta\to 0$, this difference should vanish.

###### Assumption 3.4 .

The system’s inputs $u_{k}$ and hidden states $x_{k}$ are uniformly bounded, and the matrices $\Lambda_{k}(\theta_{m})$, $B_{k}(\theta_{m})$, $b_{k}(\theta_{m})$, and $C_{k}(\theta_{m})$ are uniformly bounded in $m$.

###### Theorem 3.5 (Existence of Stable Approximation by Stable Reparameterization with Input-Dependent Dynamics) .

Let $\mathbf{H}$ be any bounded, causal, continuous, and regular linear functional. Suppose $\mathbf{H}$ is approximated by a sequence of state-space models $\{\widehat{\mathbf{H}}(\cdot;\theta_{m})\}_{m=1}^{\infty}$ with input-dependent dynamics of the form Eq. 5.
Then, the approximation of $\mathbf{H}$ by the sequence $\{\widehat{\mathbf{H}}(\cdot;\theta_{m})\}_{m=1}^{\infty}$ is a stable approximation in the Sobolev-type norm defined by:

$$ $\left\|\mathbf{H}-\widehat{\mathbf{H}}\right\|_{W^{1,\infty}}=\sup_{k}\left(\| H_{k}-\widehat{H}_{k}\|_{\infty}+\left\|\frac{dH_{k}}{dk}-\frac{d\widehat{H}_{ k}}{dk}\right\|_{\infty}\right).$ (8) $$

###### Proof.

Here, we provide a brief sketch of the proof, with full details in the A.2.

The mappings from parameters $\theta_{m}$ to the system matrices $\Lambda_{k}(u_{k};\theta_{m})$, $B(\theta_{m})$, $b(\theta_{m})$, and $c(\theta_{m})$ (with $c\in\mathbb{R}^{m}$ being small, assuming a single-output dimension for simplicity) are Lipschitz continuous, ensuring that small perturbations in $\theta_{m}$ lead to small changes in the system dynamics. The eigenvalues of $\Lambda_{k}(u_{k};\theta_{m})$ have negative real parts for all $u_{k}\in\mathcal{X}$, which guarantees uniform asymptotic stability of the system. As a result, the state transition matrix $\Phi(k,s;u,\theta_{m})$ decays exponentially as $k-s$ increases, preserving stability over time. The stable reparameterization function $f$ further ensures that parameter perturbations are well-controlled, and the condition involving $g(\beta)$ implies that as $\beta\to 0$, the difference between the perturbed and unperturbed state transition matrices vanishes.

To analyze the approximation error, we bound the total error $E(\beta)$ by combining the error due to model capacity (which vanishes as $m\to\infty$) and the error from parameter perturbations. Applying Grönwall’s inequality and using the Lipschitz properties of the mappings, we show that the error from perturbations is proportional to $\beta$. As $m\to\infty$ and $\beta\to 0$, the total approximation error tends to zero, ensuring that the sequence $\{\widehat{\mathbf{H}}(\cdot;\theta_{m})\}_{m=1}^{\infty}$ provides a stable approximation of $\mathbf{H}$.
∎

###### Theorem 3.6 (Parameterizations Influence the Gradient Norm Scale in Input-Dependent SSMs) .

The gradient of the loss with respect to the trainable parameter $w_{j}$ satisfies the following bound:

$$ $\left|\frac{\partial\text{Loss}}{\partial w_{j}}\right|\leq C_{\mathbf{H}, \widehat{\mathbf{H}}_{m}}\left|f^{\prime}(w_{j})\right|,$ (9) $$

where $f^{\prime}(w_{j})$ is the derivative of the reparameterization function $f$ with respect to $w_{j}$ and $C_{\mathbf{H},\widehat{\mathbf{H}}_{m}}$ is a constant independent of $w_{j}$, but dependent on the target functional $\mathbf{H}$ and the model $\widehat{\mathbf{H}}_{m}$.

###### Proof.

We provide a brief proof sketch; detailed steps are in the A.3.

The goal is to bound the gradient of the loss function, which measures the difference between the target functional and the model’s output. Since the target does not depend on the model parameters $w_{j}$, the model output determines the gradient entirely. This output depends on the parameterized functions $c(\theta_{m})$, which are Lipschitz continuous, and the hidden state dynamics, which are stable under the given assumptions.

Using the Lipschitz continuity of $c(\theta_{m})$ and the uniform stability of the system, we show that the gradient of the model output with respect to $w_{j}$ is bounded by a constant times the derivative of the reparameterization function $f$. This leads to the conclusion that the gradient of the loss function scales proportionally to $|f^{\prime}(w_{j})|$, explaining the role of the reparameterization in controlling optimization behavior.
∎

###### Assumption 3.1 .

###### Assumption 3.2 .

###### Assumption 3.3 .

###### Assumption 3.4 .

###### Theorem 3.5 (Existence of Stable Approximation by Stable Reparameterization with Input-Dependent Dynamics) .

###### Proof.

###### Theorem 3.6 (Parameterizations Influence the Gradient Norm Scale in Input-Dependent SSMs) .

###### Proof.

### 3.4 Additional Design Choices for Event-Based Neuromorphic Tasks

##### Efficient Tokenization for Event-Based Data

In S7, we introduce an event-based tokenization scheme that captures the neuromorphic data’s spatial and temporal nature. This method utilizes a sensor of size $(s_{x},s_{y})$, where $s_{x}$ is the number of horizontal pixels and $s_{y}$ is the number of vertical pixels. Each event, $\varepsilon$, is defined by the following quadruple: $(x,y,t,p)$, where $x$ and $y$ represent the spatial coordinates of the event on the sensor, $t$ represents the timestamp of the event, and $p\in\{-1,1\}$ is the polarity, indicating the nature of the event (positive or negative change).
We then define a unique token for each event $\varepsilon$ using the following formula:

$$ $\mathcal{T}_{\text{S7}}(\varepsilon)=2\cdot(x\cdot s_{x}+y)+p$ (10) $$

In this formula, $\mathcal{T}_{\text{S7}}(\varepsilon)$ denotes the token generated for the event $\varepsilon$ using the S7-specific tokenization scheme, as indicated by the subscript. This bijective mapping ensures each event produces a unique token, preventing collisions where different events could share the same token, as seen in models like EventSSM (Schöne et al., ). By encoding spatial and polarity information, the S7 scheme enhances the model’s ability to efficiently process asynchronous, real-time data.

##### Efficiency Through Event Pooling and Asynchronous Discretization

Also, we optimize computational efficiency through Event Pooling, which pools hidden states over a window of size $p$, reducing computational load:

$$ $x_{k+p}=\Lambda_{k}^{p}x_{k}+\sum_{i=1}^{p}\Lambda_{k}^{p-i}Bu_{k+i}$ (11) $$

Further, Asynchronous Discretization updates the hidden state based on varying time intervals between events, enabling S7 to handle real-time event streams efficiently:

$$ $x_{k}=e^{\Lambda_{k}\Delta t_{k}}x_{k-1}+Bu_{k}$ (12) $$

This ensures that S7 remains efficient in processing asynchronous data, such as in neuromorphic vision and spiking neural networks. By integrating input dependence, stable reparameterization, and efficient tokenization, S7 enables significant performance improvement, surpassing its predecessors in performance and scalability.

## 4 Experiments

We evaluate the performance of the proposed S7 model across several tasks. In Sec. 4.1, we describe the experimental setup, including training protocols and evaluation metrics, and in Sec. 4.2, we assess the model on neuromorphic event data. Sec. 4.3 focuses on long-range sequence modeling with the LRA benchmark (Tay et al., ). Dynamical system prediction tasks, including Pendulum Regression, are explored in Sec. 4.4. Finally, in Sec. 4.5, we evaluate S7 on human activity recognition and genomics classification. In Sec. 4.6, we also explore the Walker2D kinematic simulation. In the A.6, we perform an ablation study to evaluate the importance of the reparameterization method in improving model performance.

### 4.1 Experimental Setup

We follow the experimental setups for training and evaluation described in EventSSM (Schöne et al., ) for Sec. 4.2, S5 (Smith et al., ) for Sec 4.3, S5 & LEM (Rusch et al., ) for Sec. 4.4 and ODE-LSTM (Lechner & Hasani, ) & LEM for Sec. 4.5. Specifically, we use a cosine learning rate schedule for all datasets throughout the training process. Separate weight decay is applied to the SSM parameters to control regularization. We select the best validation epoch for final testing to ensure optimal performance. Cross-entropy is employed as the loss function for all tasks except Pendulum & FitzHugh-Nagumo system (Sec. 4.4) and Walker2D, for which we used MSE.
All models are trained using Tesla V100 and Quadro RTX 8000 GPUs. The training code is implemented in JAX (Bradbury et al., ), while Tonic (Lenz et al., ) is used for fast event-based data loading.
Additionally, we introduce a separate weight decay for the dense layers responsible for input dependence, allowing these layers to be fine-tuned independently of the core SSM parameters. This enables better control over regularization in the filtering layers and further leads to improved generalization and performance across different tasks.

### 4.2 Event (Neuromorphic) Datasets

We process raw, asynchronous event streams in these datasets, fully leveraging S7’s ability to model long-range temporal dependencies directly from raw events. Unlike the majority of approaches in this context, which convert events into frames or other representations, only EventSSM (Schöne et al., ) and our S7 operate directly on the raw event data. This allows us better to capture the fine-grained dynamics unique to event-based data streams.

**Table 1: Accuracy comparison of LSN (Hammouamri et al., ), SGN (Bittar & Garner, ), CNN+S5, BET (Liu et al., ), EventSSM (Schöne et al., ), and S7 on event datasets. The number of model parameters (in millions) is shown in parentheses.**
| Dataset | LSN | SGN | CNN+S5 | BET | EventSSM | S7 (Ours) |
| --- | --- | --- | --- | --- | --- | --- |
| DVS-Gesture | - | - | 97.8 (6.8M) | 98.8 (-) | 97.7 (5.4M) | 99.2 (4.1M) |
| Spiking Heidelberg Digits | 95.1 (0.2M) | 94.6 (3.9M) | 93.8 (3.9M) | - | 95.5 (0.4M) | 96.3 (0.5M) |
| Spiking Speech Commands | 80.7 (2.5M) | 77.4 (3.9M) | 81.2 (4.2M) | - | 87.1 (0.6M) | 88.2 (0.6M) |

##### DVS-Gesture

The DVS-Gesture dataset (Amir et al., ) features 11 hand gestures recorded by a DVS128 sensor at 128x128 resolution, with over 1,100 training samples and up to 1.5 million events per sequence. Following EventSSM’s data augmentations (Schöne et al., ), we apply spatial-jitter, time-jitter, and CutMix. S7 achieves 99.2% accuracy, surpassing EventSSM (97.7%) and the best dense method BET (Liu et al., ) (98.8%). Full results are in Table 1.

##### Spiking Heidelberg Digits (SHD)

The SHD dataset (Cramer et al., ) challenges models with 20 classes of spoken digits converted into spike trains. It includes 8,200 training samples with sequences having a median of 8,000 events. This dataset tests a model’s ability to process event-based audio data. S7 achieved an accuracy of 96.3%, outperforming both the best dense method (95.1%) and EventSSM (95.5%), with only a slight increase in parameters (0.5M vs. 0.4M). Additionally, compared to dense methods such as LSN (Hammouamri et al., ) and SGN (Bittar & Garner, ), S7 demonstrates superior performance with far fewer parameters.

##### Spiking Speech Commands (SSC)

The SSC dataset (Cramer et al., ) includes 35 classes of spoken commands converted into spike trains, with sequences having a median of 8,100 events and a total of 75,500 training samples. We applied time-jitter, channel-jitter, and CutMix augmentations (Yun et al., ) for this large-scale dataset. S7 achieved 88.2% accuracy, outperforming both the best dense method (80.7%) and EventSSM (87.1%) while maintaining the exact parameter count (0.6M) as EventSSM and using up to 7x fewer parameters than the best dense models.

### 4.3 Long Range Arena

We adopt the setup used in the S5 framework (Smith et al., ), converting integer-tokenized datasets into event-based formats with regular time gaps, treating tokens as events with a polarity of 1. Experiments were conducted on all six Long Range Arena (LRA) tasks: ListOps, Text, Retrieval, Image, Pathfinder, and Path-X, with results summarized in Table 2. Among the models compared, S6 (Mamba) and our S7 are the only ones employing input-dependent dynamics. Our results demonstrate that S7 outperforms Mamba across the LRA benchmarks (71.82 vs 66.59 average), highlighting the effectiveness of our approach and establishing S7 as the best input-dependent model for long, challenging sequence modeling. Notably, S7 achieves state-of-the-art performance on the ListOps and Retrieval tasks, with accuracies of 63.77% and 91.80%, respectively. However, it is challenging for input-dependent models to surpass Linear Time-Invariant (LTI) methods like S5 on certain tasks because input-dependency can lead to forgetting some tokens, which hurts performance when precise retention of input information is crucial. While Mega achieves the highest average score overall, it operates with quadratic complexity in sequence length, making it less scalable for long sequences. In contrast, S7 offers a favorable trade-off between performance and scalability, achieving competitive results with linear computational complexity.

**Table 2: Accuracy comparison of Mega (Ma et al., ), S4 (Gu et al., ), S5 (Smith et al., ), S6 (Mamba) (Gu & Dao, ), LRU (Orvieto et al., ), and S7 across LRA tasks. The best result for each task is highlighted in bold, while the second-best result is underlined. The overall best and second-best results are similarly bolded and underlined in the average row.**
| Dataset | Mega | S4 | S5 | S6 (Mamba) | LRU | S7 (Ours) |
| --- | --- | --- | --- | --- | --- | --- |
| ListOps | 63.14 | 59.60 | 62.15 | 38.02 | 60.20 | 63.77 |
| Text | 90.43 | 86.82 | 89.31 | 82.98 | 89.40 | 87.22 |
| Retrieval | 91.25 | 90.90 | 91.40 | 72.14 | 89.90 | 91.80 |
| Image | 90.44 | 88.65 | 88.00 | 69.82 | 89.00 | 61.14 |
| Pathfinder | 96.01 | 94.20 | 95.33 | 69.26 | 95.10 | 65.52 |
| Path-X | 97.98 | 96.35 | 98.58 | 67.32 | 94.20 | 61.50 |
| Average | 88.21 | 86.09 | 87.46 | 66.59 | 86.30 | 71.82 |

### 4.4 Pendulum Regression & Multiscale Dynamical System Prediction

##### Pendulum Regression

Inspired by prior work (Becker et al., ; Schirmer et al., ), this task involves predicting the sine and cosine of a pendulum’s angle from sequences of noisy grayscale images. The input consists of 24x24 pixel images of a pendulum driven by random torque, with added temporally correlated noise. A pendulum is simulated for 100 timesteps, and 50 frames are randomly selected for each sample. We use a dataset split of 2000/1000/1000 samples for training, validation, and testing.

##### Multiscale Dynamical System Prediction

The FitzHugh-Nagumo system (FitzHugh, 1955) models fast-slow nonlinear dynamics simulating neuronal action potentials. Following (Rusch et al., ), we approximate this system on sequences of length $N=1000$, generating multiple datasets for training, validation, and testing. We compare S7 against various RNN-based models, including the state-of-the-art LEM (Rusch et al., ) and S5 (Smith et al., ).

**Table 3: Performance comparison for the Pendulum Regression task. Other models are the same ones as in Smith et al. (). S7 achieves the best MSE, outperforming all other models.**
| Model<br>Relative Speed<br>MSE ($\times 10^{-3}$)<br>RKN<br>1.9$\times$<br>8.43<br>RKN-$\Delta t$<br>1.9$\times$<br>5.09<br>CRU<br>1.0$\times$<br>4.63<br>S5<br>86$\times$<br>3.41<br>S7 (Ours)<br>357$\times$<br>2.91<br>Table 3: Performance comparison for the Pendulum Regression task. Other models are the same ones as in Smith et al. (). S7 achieves the best MSE, outperforming all other models. | Model<br>Error $(\times 10^{-2})$<br># Units<br># Params<br>LSTM<br>1.2<br>16<br>1k<br>expRNN<br>2.3<br>50<br>1k<br>LipschitzRNN<br>1.8<br>24<br>1k<br>FastGRNN<br>2.2<br>34<br>1k<br>coRNN<br>0.4<br>24<br>1k<br>LEM<br>0.2<br>16<br>1k<br>S5<br>0.0024<br>16<br>1k<br>S7 (Ours)<br>0.0013<br>16<br>1k<br>Table 4: Test $L^{2}$ error on FitzHugh-Nagumo system prediction. S7 achieves the best result, outperforming LEM and S5. Other models are the same as in Rusch et al. (). |
| --- | --- |

##### Results

In the Pendulum Regression task (Table 4), S7 achieves the lowest Mean Squared Error (MSE) of 2.91, outperforming all other models. The large speedup highlights S7’s efficiency and ability to handle irregular, noisy inputs. For the Multiscale Dynamical System Prediction task (Table 4), S7 significantly outperforms LEM and S5, achieving the lowest test $L^{2}$ error of 0.0013. This result demonstrates the advantage of S7’s input-dependent recurrent structure for capturing multiscale system dynamics.

### 4.5 Human Activity Recognition & Genomics Classification

##### Human Activity Recognition

We evaluate the performance of S7 on the Human Activity Recognition dataset from the UCI repository (Dua & Graff, ), a per-time-step classification task involving data collected from four inertial measurement sensors located on a person’s arms and feet. Each sensor outputs measurements at fixed intervals of 211 ms, with slight random phase shifts, which introduces irregular sampling in the time-series data. The task is to classify the person’s current activity at each time step, making this a challenging sequence modeling problem where every time step presents a new error signal to the network. Other models used for comparison in Table 6 are the same as in Lechner & Hasani ().

##### Genomics Classification

The EigenWorms dataset (Bagnall et al., ) involves classifying worms into either the wild-type or one of four different mutants based on motion data collected over very long sequences. Each sequence has a $N=17984$ length, making it a challenging task that tests the model’s ability to capture very long-term dependencies. Prior research (Rusch et al., ; Morrill et al., ) has demonstrated that EigenWorms exhibits dependencies that extend beyond 10,000 timesteps, requiring robust sequence modeling techniques to achieve high classification accuracy. Other models in Table 6 are the same as one in Rusch et al. ().

**Table 5: Per timestep classification. Human Activity Recognition task. Test accuracy (mean $\pm$ std, $N=5$ experiments for each model).**
| Model<br>Accuracy (%)<br>ODE-RNN<br>80.43 $\pm$ 1.55<br>CT-RNN<br>83.65 $\pm$ 1.55<br>Augmented LSTM<br>84.11 $\pm$ 0.68<br>CT-GRU<br>79.48 $\pm$ 2.12<br>RNN Decay<br>62.89 $\pm$ 3.87<br>Bi-directional RNN<br>83.85 $\pm$ 0.45<br>GRU-D<br>83.57 $\pm$ 0.40<br>PhasedLSTM<br>83.33 $\pm$ 0.69<br>GRU-ODE<br>82.56 $\pm$ 2.63<br>CT-LSTM<br>84.13 $\pm$ 0.11<br>ODE-LSTM<br>84.15 $\pm$ 0.33<br>S7 (Ours)<br>94.09 $\pm$ 0.001<br>Table 5: Per timestep classification. Human Activity Recognition task. Test accuracy (mean $\pm$ std, $N=5$ experiments for each model). | Model<br>Test Accuracy (%)<br># Units<br># Params<br>NRDE<br>86.8<br>32<br>35k<br>expRNN<br>50.1<br>64<br>2.8k<br>IndRNN (2 layers)<br>54.5<br>32<br>1.6k<br>LSTM<br>48.6<br>32<br>5.3k<br>BiLSTM+1d-conv<br>47.8<br>32<br>5.8k<br>chrono-LSTM<br>89.0<br>32<br>5.3k<br>coRNN<br>89.7<br>32<br>2.4k<br>UniCORNN (2 layers)<br>93.3<br>32<br>1.5k<br>LEM<br>94.1<br>32<br>5.3k<br>S7 (Ours)<br>97.5<br>16<br>12k<br>Table 6: Test accuracies on EigenWorms using the best-performing models. S7 achieves the best result with the fewest units, demonstrating its effectiveness in capturing long-term dependencies in very long sequences. |
| --- | --- |

##### Results

In the Human Activity Recognition task (Table 6), S7 achieves a remarkable accuracy of 94.09%, significantly outperforming all baseline models. This substantial improvement underscores S7’s ability to effectively handle irregularly sampled, noisy time-series data. For the Genomics Classification task (Table 6), S7 further demonstrates its superiority by attaining a state-of-the-art accuracy of 97.5% using only 16 units and 12k parameters. This result not only surpasses the previous best LEM model (Rusch et al., ) but also highlights S7’s efficiency in managing very long sequences and capturing long-term dependencies on very challenging dataset with high variance.

### 4.6 Walker2d Kinematic Simulation

In this experiment, we evaluated the ability of our proposed S7 model to simulate the kinematic dynamics of the Walker2d-v2 environment. The goal of the task was to predict the per-timestep regression for the kinematic simulation of the MuJoCo physics engine. The dataset was irregularly sampled, and we introduced additional complexity by overwriting a small percentage of the actions with random actions and skipping 10% of the time steps.
Table 3 shows that our S7 model achieved the best performance with an MSE of 0.114 (with a mean of 0.120 and std of 0.005), outperforming the other methods by a significant margin. Other models used for comparison are the same ones as in Lechner & Hasani ().

Figure: Figure 2: Per time-step regression results on the Walker2d kinematic dataset. Our S7 model achieves the lowest MSE.
Refer to caption: extracted/5901954/images/walker2d/walker_1.png

## 5 Conclusion

In this work, we introduced S7, a novel state-space model that effectively balances efficiency, adaptability, and stability in long-sequence modeling tasks—building upon the foundation of prior models like S4 (Gu et al., ), S5 (Smith et al., ) and Mamba (Gu & Dao, ). S7 leverages input-dependent dynamics and stable reparameterization to improve its ability to capture long-range dependencies while maintaining computational efficiency. The key contribution of S7 is its ability to dynamically adjust state transitions based on input content, allowing for selective filtering and content-based reasoning without adding unnecessary complexity.
Through extensive experimentation on a diverse range of benchmarks, including event-based neuromorphic tasks, long-range sequence modeling, dynamical system prediction, and real-world applications like human activity recognition and genomics classification, S7 has demonstrated its superiority. It achieves state-of-the-art results in multiple domains while preserving computational efficiency, even in challenging settings that require processing sequences with irregular sampling and long-term dependencies.

Moreover, incorporating stable reparameterization ensures the robustness and stability of S7 during training and inference, making it highly scalable for real-world applications. The model’s ability to handle asynchronous data streams and complex temporal patterns extends its utility to a wide range of practical tasks, from neuromorphic vision to genomic analysis.
In conclusion, S7 offers a significant advancement in sequence modeling, pushing the boundaries of what is possible in terms of scalability, generalization, and adaptability. By achieving an optimal balance between simplicity and performance, S7 sets a new standard for state-space models, opening new avenues for research and application across numerous domains in artificial intelligence.

## 6 Acknowledgment

This work was supported by the European Research Council (ERC) under grant agreement No. 864042 (AGILEFLIGHT).

## Appendix A Appendix

### A.1 Notational and Theoretical Background

To help with the understanding of the theorems, proofs, and the main content of our paper, we provide essential mathematical background on Sobolev norms, properties of functionals, Lipschitz continuity, Grönwall’s inequality, and stable reparameterization conditions.

##### Sobolev Spaces and Sobolev Norms

Sobolev spaces are a fundamental concept in functional analysis, providing a framework for analyzing functions with weak derivatives. For an open subset $\Omega\subset\mathbb{R}^{n}$, the Sobolev space $W^{k,p}(\Omega)$ consists of functions whose derivatives up to order $k$ are in $L^{p}(\Omega)$.

In our context, we consider the Sobolev space $W^{1,\infty}$, which is the space of functions $f:\mathbb{R}\to\mathbb{R}$ such that both $f$ and its first derivative $f^{\prime}$ are essentially bounded. The Sobolev norm in $W^{1,\infty}$ is defined as:

$$ $\|f\|_{W^{1,\infty}}=\|f\|_{L^{\infty}}+\|f^{\prime}\|_{L^{\infty}},$ (13) $$

where $\|f\|_{L^{\infty}}=\text{ess sup}_{x\in\Omega}|f(x)|$.

In our analysis, we use the Sobolev-type norm to measure the difference between the target functional $\mathbf{H}$ and the approximate functional $\widehat{\mathbf{H}}$:

$$ $\|\mathbf{H}-\widehat{\mathbf{H}}\|_{W^{1,\infty}}=\sup_{k}\left(\|H_{k}- \widehat{H}_{k}\|_{\infty}+\left\|\frac{dH_{k}}{dk}-\frac{d\widehat{H}_{k}}{dk }\right\|_{\infty}\right),$ (14) $$

where the supremum is taken over all time steps $k$, and the norm $\|\cdot\|_{\infty}$ denotes the essential supremum over the input space.

##### Properties of Functionals

A *functional* is a mapping from a space of functions to the real numbers. In our context, we consider linear functionals $\mathbf{H}:L^{\infty}(\mathbb{R})\to\mathbb{R}$ that satisfy the following properties:

- •
Boundedness: The functional $\mathbf{H}$ is bounded if there exists a constant $M>0$ such that:
$|\mathbf{H}(u)|\leq M\|u\|_{L^{\infty}},\quad\forall u\in L^{\infty}(\mathbb{R
}).$
(15)
- •
Linearity: The functional is linear if:
$\mathbf{H}(au+bv)=a\mathbf{H}(u)+b\mathbf{H}(v),\quad\forall u,v\in L^{\infty}
(\mathbb{R}),\quad\forall a,b\in\mathbb{R}.$
(16)
- •
Causality: The functional is causal if the value at time $k$ depends only on values of $u$ up to time $k$:
$\mathbf{H}(u)(k)=F(u|_{(-\infty,k]}),$
(17)
where $F$ is some mapping, and $u|_{(-\infty,k]}$ denotes the restriction of $u$ to the interval $(-\infty,k]$.
- •
Continuity: The functional is continuous if small changes in $u$ lead to small changes in $\mathbf{H}(u)$:
$\lim_{\|u-v\|_{L^{\infty}}\to 0}|\mathbf{H}(u)-\mathbf{H}(v)|=0.$
(18)
- •
Regularity: The functional has certain smoothness properties, such as differentiability with respect to $k$.

##### Lipschitz Continuity

A function $f:\mathbb{R}^{n}\to\mathbb{R}^{m}$ is *Lipschitz continuous* if there exists a constant $L\geq 0$ such that:

$$ $\|f(x)-f(y)\|\leq L\|x-y\|,\quad\forall x,y\in\mathbb{R}^{n}.$ (19) $$

The smallest such $L$ is called the *Lipschitz constant* of $f$. Lipschitz continuity ensures that the function does not change too rapidly and is essential for proving stability and convergence results.

In our theorems, we assume that the mappings from the model parameters $\theta_{m}$ to the system matrices are Lipschitz continuous (Assumption 3.1), which is critical for controlling the effects of parameter perturbations on the system’s behavior.

##### Grönwall’s Inequality

Grönwall’s inequality is a powerful tool used to bound solutions of differential and integral inequalities. It states that if $u(t)$ is a non-negative, continuous function satisfying:

$$ $u(t)\leq a+\int_{t_{0}}^{t}b(s)u(s)\,ds,\quad t\geq t_{0},$ (20) $$

where $a\geq 0$ and $b(s)\geq 0$, then:

$$ $u(t)\leq a\exp\left(\int_{t_{0}}^{t}b(s)\,ds\right).$ (21) $$

In our proofs, Grönwall’s inequality is used to bound the growth of the difference between the perturbed and unperturbed solutions of the state equations, ensuring that small parameter changes lead to proportionally small changes in the system’s state over time.

##### Stable Reparameterization Conditions

Reparameterization functions are used to enforce stability constraints on the model parameters. A reparameterization function $f:\mathbb{R}\to\mathbb{R}$ maps raw parameters $w_{j}$ to model parameters $\theta_{m}=f(w_{m})$. The stability condition requires that the function $f$ ensures the eigenvalues of the state transition matrix $\Lambda_{k}(u_{k};\theta_{m})$ have magnitudes less than one (Assumption 3.2).

Moreover, we impose a condition on $f$ that controls the effect of parameter perturbations on the state transition matrices:

$$ $\sup_{w}\left[\|f(w)\|\sup_{\|\tilde{w}-w\|\leq\beta}\int_{0}^{\infty}\left\| \Phi_{\tilde{w}}(k,s)-\Phi_{w}(k,s)\right\|\,dk\right]\leq g(\beta),$ (22) $$

for some continuous function $g:[0,\infty)\to[0,\infty)$ with $g(0)=0$. This condition ensures that the difference between the perturbed and unperturbed state transition matrices vanishes as the parameter perturbation $\beta\to 0$, promoting stability in the approximation.

##### State Transition Matrix

In systems with time-varying or input-dependent dynamics, the state transition matrix $\Phi(k,s)$ captures the cumulative effect of the state transition matrices from time $s$ to $k$. It satisfies the difference equation:

$$ $\Phi(k,s)=\Lambda_{k}(u_{k};\theta_{m})\Phi(k-1,s),\quad\Phi(s,s)=I_{m},$ (23) $$

where $I_{m}$ is the identity matrix of size $m$. The state transition matrix is crucial for expressing the solution to the state equation and analyzing the system’s behavior over time.

##### Variation of Parameters

The variation of parameters is a method for solving non-homogeneous linear differential or difference equations. For the difference equation:

$$ $x_{k}=\Lambda_{k}x_{k-1}+B_{k}u_{k}+b_{k},$ (24) $$

the solution can be expressed as:

$$ $x_{k}=\Phi(k,k_{0})x_{k_{0}}+\sum_{s=k_{0}+1}^{k}\Phi(k,s)(B_{s}u_{s}+b_{s}),$ (25) $$

where $\Phi(k,s)$ is the state transition matrix. This representation allows us to analyze how inputs and initial conditions influence the system’s state.

##### Bounding the Approximation Error

In the context of our theorems, we aim to show that the sequence of approximate functionals $\{\widehat{\mathbf{H}}(\cdot;\theta_{m})\}_{m=1}^{\infty}$ converges to the target functional $\mathbf{H}$ in the Sobolev norm. The total approximation error $E(\beta)$ combines the error due to model capacity (which decreases as $m\to\infty$) and the error from parameter perturbations (controlled by $\beta$). By ensuring that both errors tend to zero, we establish that the approximation is stable and accurate.

##### Gradient Norm Scaling

In Theorem 3.6, we analyze how the gradient of the loss function with respect to the raw parameters $w_{j}$ scales with the derivative of the reparameterization function $f$. The key result is that:

$$ $\left|\frac{\partial\text{Loss}}{\partial w_{j}}\right|\leq C_{\mathbf{H}, \widehat{\mathbf{H}}_{m}}\left|f^{\prime}(w_{j})\right|,$ (26) $$

where $C_{\mathbf{H},\widehat{\mathbf{H}}_{m}}$ is a constant independent of $w_{j}$. This highlights the importance of choosing a reparameterization function with appropriate smoothness to ensure that gradients are well-behaved during optimization.

##### Ensuring Stability and Convergence

Combining the above concepts, our analysis ensures that the input-dependent state-space models we propose are both stable and capable of providing accurate approximations of target functionals. The Lipschitz continuity and stability conditions prevent the system from exhibiting uncontrolled behavior, while the use of Sobolev norms allows us to measure approximation quality in terms of both the function value and its derivative.

The theoretical results provide a solid foundation for the practical effectiveness of our S7 model. By ensuring stability and controlling gradient norms, we can train deep models capable of handling long sequences with complex dependencies. The input-dependent dynamics enable the model to adapt to varying inputs, improving its ability to capture long-range dependencies and perform content-based reasoning without sacrificing computational efficiency.

### A.2 Proof of Theorem 3.5

In this section, we prove the Theorem regarding the Existence of Stable Approximation by Stable Reparameterization with Input-Dependent Dynamics.

###### Proof.

We begin by defining the target linear functional $\mathbf{H}$ as follows:

$$ $H_{k}(\mathbf{u})=\int_{-\infty}^{k}\rho(k-s)u_{s}\,ds,$ (27) $$

where $\rho$ is an $L_{1}$-integrable function, meaning $\int_{0}^{\infty}|\rho(\tau)|\,d\tau<\infty$. The objective is to approximate $\mathbf{H}$ using a sequence of state-space models with input-dependent dynamics. The modified state-space model takes the form:

$$ $\frac{dx_{k}}{dk}=\Lambda_{k}(u_{k})x_{k}+Bu_{k}+b,$ (28) $$

with the output defined as $\hat{y}_{k}=c^{\top}x_{k}$, where $c\in\mathbb{R}^{m}$ is the output weight vector. The key difference from prior models lies in the input dependence of $\Lambda_{k}(u_{k})$, which makes the state equation non-autonomous. This complexity implies that the solution to the state equation cannot simply be expressed using the exponential of a constant matrix. The solution $x_{k}$ to the state equation involves the state transition matrix, which depends on the history of $u_{k}$:

$$ $x_{k}=\Phi(k,k_{0})x_{k_{0}}+\int_{k_{0}}^{k}\Phi(k,s)(Bu_{s}+b)\,ds,$ (29) $$

where $\Phi(k,s)$ is the state transition matrix from time step $s$ to $k$, satisfying $\frac{d}{dk}\Phi(k,s)=\Lambda_{k}(u_{k})\Phi(k,s)$ with $\Phi(s,s)=I_{m}$. Since $\Lambda(u_{k})$ depends on $u_{k}$, $\Phi(k,s)$ depends on the entire input sequence $u_{[s,k]}$.

We approximate the state transition matrix using a piecewise constant approximation of $\Lambda_{k}(u_{k})$. This means we divide the interval $[k_{0},k]$ into small subintervals $[k_{i-1},k_{i}]$ where $\Lambda_{k}(u_{k})$ is approximately constant, allowing us to express the state transition matrix as $\Phi(k,k_{0})\approx\prod_{i=1}^{N}e^{\Lambda_{k}(u_{k_{i-1}})(k_{i}-k_{i-1})}$. This approximation becomes more accurate as the intervals become smaller. The model output is given by $\hat{y}_{k}=c^{\top}x_{k}$, while the target functional is $H_{k}(\mathbf{u})=\int_{-\infty}^{k}\rho(k-s)u_{s}\,ds$. Our goal is to show that $\hat{y}_{k}$ approximates $H_{k}(\mathbf{u})$ under appropriate conditions. The total approximation error $E(\beta)$ can be expressed as:

$$ $E(\beta)=\sup_{|\tilde{\theta}-\theta|\leq\beta}\|\mathbf{H}-\widehat{\mathbf{ H}}(\cdot;\tilde{\theta})\|_{W^{1,\infty}}.$ (30) $$

where $\theta$ represents the model parameters, and $\tilde{\theta}$ represents the perturbed parameters within a radius $\beta$. We need to bound $E(\beta)$ and show that $\lim_{\beta\to 0}E(\beta)=0$.

Perturbations in $\theta$ affect both $\Lambda_{k}(u_{k})$ and the state transition matrix $\Phi(k,s)$, but if $\Lambda_{k}(u_{k};\theta)$ depends smoothly on $\theta$ and the mapping from $\theta$ to $\Lambda_{k}(u_{k};\theta)$ is Lipschitz continuous, then small perturbations in $\theta$ yield small perturbations in the system dynamics.

To analyze the difference between the perturbed and unperturbed state transition matrices, consider $\Phi(k,s)$ for the unperturbed case and $\tilde{\Phi}(k,s)$ for the perturbed case. We seek to bound $\|\tilde{\Phi}(k,s)-\Phi(k,s)\|$. Assuming $\Lambda_{k}(u_{k};\theta)$ is Lipschitz in $\theta$, and that $u_{k}$ is bounded, we can establish that:

$$ $\|\tilde{\Phi}(k,s)-\Phi(k,s)\|\leq L_{\Phi}\beta(k-s),$ (31) $$

for some constant $L_{\Phi}$, where $\beta=\|\tilde{\theta}-\theta\|$. This gives us a first step in bounding the overall approximation error. The error in the output can now be written as $|\hat{y}_{k}-H_{k}(\mathbf{u})|=|c^{\top}(x_{k}-x_{k}^{\text{target}})|$, where $x_{k}^{\text{target}}$ corresponds to the hidden state that exactly reproduces $H_{k}(\mathbf{u})$. The difference $x_{k}-x_{k}^{\text{target}}$ arises from two sources: the model approximation error and the perturbation in parameters. We express this as:

$$ $|\hat{y}_{k}-H_{k}(\mathbf{u})|\leq\|c\|\cdot\|x_{k}-x_{k}^{\text{target}}\|.$ (32) $$

To control the error due to parameter perturbations, we analyze the difference between the hidden states $\tilde{x}_{k}$ (with perturbed parameters $\tilde{\theta}$) and $x_{k}$ (with original parameters $\theta$). The difference $\delta x_{k}=\tilde{x}_{k}-x_{k}$ satisfies the following differential equation:

$$ $\frac{d\delta x_{k}}{dk}=\Lambda_{k}(u_{k};\tilde{\theta})\delta x_{k}+[ \Lambda_{k}(u_{k};\tilde{\theta})-\Lambda_{k}(u_{k};\theta)]x_{k}+[B(\tilde{ \theta})-B(\theta)]u_{k}+[b(\tilde{\theta})-b(\theta)].$ (33) $$

Using the Lipschitz continuity of $\Lambda_{k}(u_{k};\theta)$, $B(\theta)$, and $b(\theta)$, we know that:

$$ $\|\Lambda_{k}(u_{k};\tilde{\theta})-\Lambda_{k}(u_{k};\theta)\|\leq L_{\Lambda }\beta,$ (34) $$

with similar bounds for $B$ and $b$. Applying Grönwall’s inequality, we bound the growth of $\delta x_{k}$ as:

$$ $\|\delta x_{k}\|\leq\int_{k_{0}}^{k}e^{L(k-s)}\left(L_{\Lambda}\|x_{s}\|\beta+ L_{B}\|u_{s}\|\beta+L_{b}\beta\right)ds.$ (35) $$

Given that both $x_{s}$ and $u_{s}$ are bounded and that $k-s$ remains finite, the integral yields a bound of the form $\|\delta x_{k}\|\leq C\beta$, where $C$ is a constant depending on the system’s bounds.

Finally, this leads to the bound on the output error:

$$ $|\hat{y}_{k}(\tilde{\theta})-\hat{y}_{k}(\theta)|=|c^{\top}(\tilde{x}_{k}-x_{k })|\leq\|c\|\cdot\|\delta x_{k}\|\leq\|c\|C\beta.$ (36) $$

Thus, the total approximation error $E(\beta)$ satisfies:

$$ $E(\beta)\leq E(0)+K\beta,$ (37) $$

where $E(0)\to 0$ as $m\to\infty$ and $K$ is a constant. Therefore, $\lim_{\beta\to 0}E(\beta)=0$, demonstrating that the approximation is stable as the model size grows (sequence of state-space models provides a stable approximation of the target functional).
∎

###### Proof.

### A.3 Proof of Theorem 3.6

###### Proof.

We aim to establish that under the given assumptions, the gradient of the loss function with respect to the trainable parameter $w_{j}$ is bounded by:

$$ $\left|\frac{\partial\text{Loss}}{\partial w_{j}}\right|\leq C_{\mathbf{H}, \widehat{\mathbf{H}}_{m}}|f^{\prime}(w_{j})|,$ (38) $$

where $C_{\mathbf{H},\widehat{\mathbf{H}}_{m}}$ is a constant independent of $w_{j}$.

Consider the loss function defined as:

$$ $\text{Loss}=\sup_{k}\|H_{k}(\mathbf{u})-\hat{y}_{k}(\mathbf{u})\|_{\infty},$ (39) $$

where $H_{k}(\mathbf{u})$ is the target functional, and $\hat{y}_{k}(\mathbf{u})$ is the model output at time step $k$ given input $\mathbf{u}$. Since the loss involves a supremum over inputs $\mathbf{u}$ with $\|\mathbf{u}\|_{\infty}\leq 1$, we focus on bounding the gradient of $\hat{y}_{k}(\mathbf{u})$ with respect to $w_{j}$.

The gradient of the loss with respect to $w_{j}$ is given by:

$$ $\left|\frac{\partial\text{Loss}}{\partial w_{j}}\right|=\left|\frac{\partial}{ \partial w_{j}}\sup_{\|\mathbf{u}\|_{\infty}\leq 1}\|H_{k}(\mathbf{u})-\hat{y} _{k}(\mathbf{u})\|_{\infty}\right|.$ (40) $$

Noting that $H_{k}(\mathbf{u})$ does not depend on $w_{j}$, we can write:

$$ $\left|\frac{\partial\text{Loss}}{\partial w_{j}}\right|\leq\sup_{\|\mathbf{u} \|_{\infty}\leq 1}\left|\frac{\partial\hat{y}_{k}(\mathbf{u})}{\partial w_{j}} \right|.$ (41) $$

Our goal is thus to bound $\left|\frac{\partial\hat{y}_{k}(\mathbf{u})}{\partial w_{j}}\right|$. The model output is defined as:

$$ $\hat{y}_{k}=c(\theta_{m})^{\top}x_{k},$ (42) $$

where $c(\theta_{m})\in\mathbb{R}^{m}$ is a parameter-dependent vector, and $x_{k}\in\mathbb{R}^{m}$ is the hidden state at time step $k$. Taking the derivative of $\hat{y}_{k}$ with respect to $w_{j}$, we have:

$$ $\frac{\partial\hat{y}_{k}}{\partial w_{j}}=\left(\frac{\partial c(\theta_{m})} {\partial w_{j}}\right)^{\top}x_{k}+c(\theta_{m})^{\top}\frac{\partial x_{k}}{ \partial w_{j}}.$ $$

The first term involves the derivative of $c(\theta_{m})$, and the second term consists of the derivative of the hidden state $x_{k}$.

Since $c(\theta_{m})$ is Lipschitz continuous with respect to $\theta_{m}$ (Assumption 3.1), and $\theta_{m}=f(w_{m})$, where $w_{m}$ is the vector of trainable parameters, we can bound the first term using the chain rule:

$$ $\left\|\frac{\partial c(\theta_{m})}{\partial w_{j}}\right\|=\left\|\frac{ \partial c(\theta_{m})}{\partial\theta_{m}}\cdot\frac{\partial\theta_{m}}{ \partial w_{j}}\right\|\leq L_{c}\left\|\frac{\partial\theta_{m}}{\partial w_{ j}}\right\|=L_{c}|f^{\prime}(w_{j})|,$ (43) $$

where $L_{c}$ is the Lipschitz constant of $c$ with respect to $\theta_{m}$, and $f^{\prime}(w_{j})$ is the derivative of the reparameterization function $f$ with respect to $w_{j}$.

To bound the second term, we need to compute $\delta x_{k}^{j}:=\frac{\partial x_{k}}{\partial w_{j}}$. Differentiating the state equation with respect to $w_{j}$, we obtain:

$$ $\frac{d\delta x_{k}^{j}}{dk}=\Lambda_{k}(u_{k};\theta_{m})\delta x_{k}^{j}+ \left(\frac{\partial\Lambda_{k}(u_{k};\theta_{m})}{\partial w_{j}}\right)x_{k} +\left(\frac{\partial B(\theta_{m})}{\partial w_{j}}\right)u_{k}+\frac{ \partial b(\theta_{m})}{\partial w_{j}}.$ (44) $$

This is a non-homogeneous linear difference equation for $\delta x_{k}^{j}$.

Using the chain rule and the Lipschitz continuity of $\Lambda_{k}(u_{k};\theta_{m})$, $B(\theta_{m})$, and $b(\theta_{m})$ with respect to $\theta_{m}$ (Assumption 3.1), we have:

$$ $\left\|\frac{\partial\Lambda_{k}(u_{k};\theta_{m})}{\partial w_{j}}\right\| \leq L_{\Lambda}|f^{\prime}(w_{j})|,\quad\left\|\frac{\partial B(\theta_{m})}{ \partial w_{j}}\right\|\leq L_{B}|f^{\prime}(w_{j})|,\quad\left\|\frac{ \partial b(\theta_{m})}{\partial w_{j}}\right\|\leq L_{b}|f^{\prime}(w_{j})|,$ (45) $$

where $L_{\Lambda}$, $L_{B}$, and $L_{b}$ are the Lipschitz constants of $\Lambda_{k}$, $B$, and $b$ with respect to $\theta_{m}$, respectively.

The solution to the difference equation for $\delta x_{k}^{j}$ can be expressed using the variation of parameters formula:

$$ $\delta x_{k}^{j}=\int_{k_{0}}^{k}\Phi(k,s)\left(\left(\frac{\partial\Lambda_{k }(u_{s};\theta_{m})}{\partial w_{j}}\right)x_{s}+\left(\frac{\partial B(\theta _{m})}{\partial w_{j}}\right)u_{s}+\frac{\partial b(\theta_{m})}{\partial w_{j }}\right)ds,$ (46) $$

where $\Phi(k,s)$ is the state transition matrix given by:

$$ $\Phi(k,s)=\mathcal{T}\exp\left(\int_{s}^{k}\Lambda_{k}(u_{\tau};\theta_{m})d \tau\right),$ (47) $$

and $\mathcal{T}$ denotes the time-ordering operator.

Under Assumption 3.2, the system is uniformly asymptotically stable; thus, there exist constants $M>0$ and $\alpha>0$ such that:

$$ $\|\Phi(k,s)\|\leq Me^{-\alpha(k-s)},\quad\text{for all }k\geq s.$ (48) $$

This property ensures that the effect of the initial conditions and perturbations diminishes exponentially over time. Since the hidden states $x_{s}$ and inputs $u_{s}$ are uniformly bounded (Assumption 3.4), there exist constants $K_{x}$ and $K_{u}$ such that:

$$ $\|x_{s}\|\leq K_{x},\quad\|u_{s}\|\leq K_{u},\quad\text{for all }s.$ (49) $$

Substituting the bounds into the expression for $\delta x_{k}^{j}$, we have:

$$ $\|\delta x_{k}^{j}\|\leq\int_{k_{0}}^{k}\|\Phi(k,s)\|\left(L_{\Lambda}|f^{ \prime}(w_{j})|K_{x}+L_{B}|f^{\prime}(w_{j})|K_{u}+L_{b}|f^{\prime}(w_{j})| \right)ds.$ (50) $$

Simplifying, we obtain:

$$ $\|\delta x_{k}^{j}\|\leq\left(L_{\Lambda}K_{x}+L_{B}K_{u}+L_{b}\right)|f^{ \prime}(w_{j})|\int_{k_{0}}^{k}Me^{-\alpha(k-s)}ds.$ (51) $$

Evaluating the integral, we find:

$$ $\int_{k_{0}}^{k}Me^{-\alpha(k-s)}ds=\frac{M}{\alpha}\left(1-e^{-\alpha(k-k_{0} )}\right)\leq\frac{M}{\alpha}.$ (52) $$

Therefore, the bound on $\|\delta x_{k}^{j}\|$ becomes:

$$ $\|\delta x_{k}^{j}\|\leq\frac{M}{\alpha}\left(L_{\Lambda}K_{x}+L_{B}K_{u}+L_{b }\right)|f^{\prime}(w_{j})|=C_{x}|f^{\prime}(w_{j})|,$ (53) $$

where $C_{x}=\frac{M}{\alpha}\left(L_{\Lambda}K_{x}+L_{B}K_{u}+L_{b}\right)$ is a constant independent of $w_{j}$.

Returning to the expression for $\frac{\partial\hat{y}_{k}}{\partial w_{j}}$, we can now bound each term. The first term satisfies:

$$ $\left\|\left(\frac{\partial c(\theta_{m})}{\partial w_{j}}\right)^{\top}x_{k} \right\|\leq\left\|\frac{\partial c(\theta_{m})}{\partial w_{j}}\right\|\|x_{k }\|\leq L_{c}|f^{\prime}(w_{j})|K_{x}.$ (54) $$

The second term satisfies:

$$ $\left\|c(\theta_{m})^{\top}\delta x_{k}^{j}\right\|\leq\|c(\theta_{m})\|\| \delta x_{k}^{j}\|\leq K_{c}C_{x}|f^{\prime}(w_{j})|,$ (55) $$

where $K_{c}=\|c(\theta_{m})\|$ is uniformly bounded (from Assumption 3.4). Combining these bounds, we have:

$$ $\left|\frac{\partial\hat{y}_{k}}{\partial w_{j}}\right|\leq\left(L_{c}K_{x}+K_ {c}C_{x}\right)|f^{\prime}(w_{j})|=C_{y}|f^{\prime}(w_{j})|,$ (56) $$

where $C_{y}=L_{c}K_{x}+K_{c}C_{x}$ is a constant independent of $w_{j}$.

Finally, substituting back into the bound for the gradient of the loss, we obtain:

$$ $\left|\frac{\partial\text{Loss}}{\partial w_{j}}\right|\leq\sup_{\|\mathbf{u} \|_{\infty}\leq 1}\left|\frac{\partial\hat{y}_{k}(\mathbf{u})}{\partial w_{j}} \right|\leq C_{y}|f^{\prime}(w_{j})|.$ (57) $$

Thus, the gradient of the loss with respect to $w_{j}$ is bounded by:

$$ $\left|\frac{\partial\text{Loss}}{\partial w_{j}}\right|\leq C_{\mathbf{H}, \widehat{\mathbf{H}}_{m}}|f^{\prime}(w_{j})|,$ (58) $$

where $C_{\mathbf{H},\widehat{\mathbf{H}}_{m}}=C_{y}$ depends on the model parameters and the target functional but is independent of $w_{j}$.

This completes the proof, demonstrating that in input-dependent state-space models, the gradient norm with respect to the trainable parameters $w_{j}$ is directly proportional to $|f^{\prime}(w_{j})|$. The constants involved in the bound are determined by the Lipschitz constants of the system components, the bounds on the hidden states and inputs, and the stability properties of the system, all of which are independent of $w_{j}$. This highlights the critical role of the reparameterization function $f$ in controlling gradient scales during optimization. Thus, the appropriate choice of $f$ is essential for stable and efficient training in models with input-dependent dynamics.
∎

###### Proof.

### A.4 Choosing the Right Reparameterization

In our model, the reparameterization function $f$ is crucial in ensuring stability during training and controlling the gradient norms. According to Theorem 3.6, the gradient of the loss with respect to the raw parameter $w_{j}$ scales with the *magnitude* of the derivative of the reparameterization function $f$:

$$ $\left|\frac{\partial\text{Loss}}{\partial w_{j}}\right|\leq C_{\mathbf{H}, \widehat{\mathbf{H}}_{m}}\left|f^{\prime}(w_{j})\right|.$ (59) $$

To promote stable and efficient training, it is desirable for the gradient magnitude to be proportional to the parameter magnitude, i.e.,

$$ $\left|\frac{\partial\text{Loss}}{\partial w_{j}}\right|\leq L|w_{j}|,$ (60) $$

for some constant $L>0$. Combining this with equation (59), we obtain the following condition on the reparameterization function:

$$ $C_{\mathbf{H},\widehat{\mathbf{H}}_{m}}\left|f^{\prime}(w_{j})\right|\leq L|w_ {j}|.$ (61) $$

Our aim is to find a reparameterization function $f$ satisfying this condition. Rearranging, we get:

$$ $\left|f^{\prime}(w)\right|\leq\frac{L}{C_{\mathbf{H},\widehat{\mathbf{H}}_{m}} }|w|.$ (62) $$

This differential inequality suggests that $f$ should be such that its derivative $f^{\prime}(w)$ is proportional to $w$. However, to ensure the stability of the system and to control the gradient norms effectively, we consider a more refined condition based on the relationship between $f$, $f^{\prime}$, and the parameter $w$.

Suppose we define the function $G_{f}(w)$ as:

$$ $G_{f}(w)=\frac{|f^{\prime}(w)|}{f(w)^{2}}.$ (63) $$

Our goal is to find $f$ such that:

$$ $G_{f}(w)=\frac{|f^{\prime}(w)|}{f(w)^{2}}=L|w|,$ (64) $$

for some constant $L>0$. This condition arises from the consideration that the gradient-over-weight ratio should be bounded, which is crucial for training stability.

Solving the differential equation (64), we integrate both sides:

$$ $\displaystyle\frac{f^{\prime}(w)}{f(w)^{2}}$ $\displaystyle=2aw,\quad\text{where }a=\frac{L}{2},$ (65) $\displaystyle\Rightarrow\int\frac{f^{\prime}(w)}{f(w)^{2}}\,dw$ $\displaystyle=\int 2aw\,dw,$ (66) $\displaystyle\Rightarrow-\frac{1}{f(w)}$ $\displaystyle=aw^{2}+b,$ (67) $$

where $b$ is the constant of integration. Therefore, the reparameterization function is:

$$ $f(w)=-\frac{1}{aw^{2}+b}.$ (68) $$

To ensure stability, we require that $f(w)\leq 0$ for all $w$. Moreover, in the discrete case relevant to our model, we can consider:

$$ $f(w)=1-\frac{1}{aw^{2}+b}.$ (69) $$

By choosing appropriate values for $a$ and $b$, we can ensure that the reparameterization function $f(w)$ satisfies the stability conditions and promotes a bounded gradient-over-weight ratio. In our experiments, we set $a=1$ and $b=0.5$, which ensures that $f(w)$ remains within the stability region and that $f(w)$ does not cross critical boundaries (e.g., for eigenvalues in recurrent models).

##### Ablation Study on Reparameterization Choices

In our ablation study (see Appendix A.6), we experiment with different choices of the constants $a$ and $b$ in the reparameterization function (69). We find that adjusting these parameters affects the stability and performance of the model. Specifically, the reparameterization with $a=1$ and $b=0.5$ consistently outperforms other choices, providing the best balance between stability and performance.

Moreover, we compare models trained with and without reparameterization. The models with reparameterization achieve better performance because they exhibit more stable training dynamics. This demonstrates the effectiveness of the reparameterization strategy in improving both the stability and the performance of the S7 model.

##### Remarks

While gradient clipping is a common technique to prevent exploding gradients, it can introduce bias and reduce the effectiveness of gradient descent. In contrast, our reparameterization approach inherently controls the gradient scales by modifying the parameterization of the model. This acts as a form of preconditioning, improving optimization without the drawbacks associated with gradient clipping.
Our findings highlight the importance of choosing an appropriate reparameterization function to ensure stable and efficient training. The ”best” reparameterization derived from equation (68) offers a theoretically grounded and empirically validated approach to achieving this goal.

### A.5 Details of Long Range Arena Tasks

##### ListOps

Tests a model’s ability to compute nested mathematical expressions with sequences of up to 2,000 tokens. S7 outperforms both Mega (Ma et al., ) and S5 (Smith et al., ), achieving a score of 63.77. S7’s input-dependence mechanism aids in filtering repetitive tokens and maintaining logical consistency, contributing to its superior performance in structured reasoning tasks.

##### Text

This task involves classifying IMDb movie reviews as positive or negative, with sequences padded to 4,096 tokens. S7 scores 87.22, having a very close performance to the S5 (Smith et al., ) and Mega (Ma et al., ) models.

##### Retrieval

In this task, models determine if two textual citations are equivalent, with sequences of up to 4,000 tokens. S7 achieves the highest score of 91.80, indicating that its dynamic state-space architecture is well-suited for tasks requiring long-range memory and retrieval capabilities.

##### Image

This task involves classifying CIFAR-10 images as 1D raster scans of 1,024 tokens. S7 performs significantly worse with input-dependence, scoring 61.14 compared to Mega’s (Ma et al., ) 90.44 and S5’s (Smith et al., ) 88.00. This suggests that input-dependence disrupts spatial reasoning by inadvertently discarding crucial tokens, leading to information loss in tasks where maintaining a precise spatial structure, like in image classification, is essential for accurate predictions.

##### Pathfinder

Pathfinder is a binary classification task where models predict if a path in a maze-like image connects two points. S7’s performance drops significantly to 65.52% with input-dependence enabled, compared to S5’s 95.33%, indicating that input-dependence negatively impacts tasks requiring precise spatial reasoning. This suggests that simpler models without input-dependence are more effective for visuospatial tasks where retaining exact input information is crucial.

##### Path-X

This is the most challenging task with sequences of 16,384 tokens and requires models to identify long-range visual patterns. S7 achieves a score of 61.50%, indicating a significant drop in performance with input-dependence enabled compared to models like S5. This suggests that input-dependent dynamics can hinder performance in tasks requiring precise retention of input information over very long sequences, as the forgetting mechanism introduced by input dependence leads to the loss of crucial spatial details necessary for accurate classification.

### A.6 Ablation Study

#### A.6.1 Importance of Reparameterization

In this section, we conduct an ablation study to assess the impact of including stable reparameterization on the performance of the S7 model across various datasets. We compare models trained with and without the reparameterization, as discussed in Section A.4. The datasets used in this study include DVS-Gesture (Amir et al., ), Spiking Heidelberg Digits (SHD) (Cramer et al., ), Spiking Speech Commands (SSC) (Cramer et al., ), Human Activity Recognition (Dua & Graff, ), EigenWorms (Bagnall et al., ), and several tasks from the Long Range Arena (LRA) benchmark (Tay et al., ).

The results are presented in Tables 7, 9, and 9.

**Table 7: Ablation study on event-based datasets: comparison of S7 model performance with and without stable reparameterization.**
| Dataset | Reparameterization | Accuracy (%) |
| --- | --- | --- |
| DVS-Gesture | No | 98.1 |
| Yes | 99.2 |  |
| SHD | No | 93.1 |
| Yes | 96.3 |  |
| SSC | No | 87.8 |
| Yes | 88.2 |  |

**Table 8: Reparametrization ablation study on Human Activity Recognition and EigenWorms datasets.**
| Dataset | Reparameterization | Accuracy (%) |
| --- | --- | --- |
| Human Activity | No | 93.79 |
| Yes | 94.09 |  |
| EigenWorms | No | 96.66 |
| Yes | 97.50 |  |

##### Analysis of Results

From the results presented in Tables 7, 9, and 9, it is evident that incorporating stable reparameterization consistently improves the performance of the S7 model across all considered datasets.

In the event-based datasets (Table 7), the inclusion of reparameterization leads to significant accuracy gains. On the DVS-Gesture dataset, accuracy improves from 98.1% without reparameterization to 99.2% with reparameterization. For the Spiking Heidelberg Digits, accuracy increases from 93.1% to 96.3%, and on the Spiking Speech Commands dataset, the model with reparameterization achieves 87.8% accuracy compared to 88.2% without it.

In the Human Activity Recognition and EigenWorms datasets (Table 9), similar improvements are observed. The Human Activity Recognition task sees an accuracy rise from 93.79% to 94.09% with reparameterization. For the EigenWorms dataset, accuracy increases from 96.66% to 97.50%, highlighting the model’s enhanced ability to capture long-range dependencies in very long sequences.

In the Long Range Arena tasks (Table 9), the models with reparameterization outperform those without across all tasks. On the ListOps task, accuracy improves from 62.11% to 63.77%. For the Text classification task, accuracy increases from 85.42% to 87.22%. In the Retrieval task, the model achieves 91.80% accuracy with reparameterization, compared to 91.64% without. On the Image classification task, accuracy improves from 60.30% to 61.14%.

These consistent performance gains suggest that the inclusion of stable reparameterization improves the S7 model’s ability to learn effectively from diverse types of data. The reparameterization contributes to more controlled gradient norms and improved training stability, allowing the model to better capture complex temporal patterns and long-range dependencies.

#### A.6.2 Effect of Reparameterization Parameters

We also explore the impact of different choices for the parameters $a$ and $b$ in the reparameterization function $f(w)=1-\frac{1}{aw^{2}+b}$, as discussed in Section A.4. By conducting experiments varying these parameters, we aim to identify the configuration that yields the best performance.

**Table 10: Effect of different reparameterization parameters $a$ and $b$ on model performance.**
| Dataset | $a=0.5,b=0.5$ | $a=1,b=0.5$ | $a=1,b=1$ |
| --- | --- | --- | --- |
| DVS-Gesture (Amir et al., ) | 98.7% | 99.2% | 98.9% |
| EigenWorms (Bagnall et al., ) | 96.8% | 97.5% | 97.1% |
| ListOps (Tay et al., ) | 62.53% | 63.77% | 63.22% |

As shown in Table 10, setting $a=1$ and $b=0.5$ consistently yields the best performance across datasets. This configuration effectively balances stability and gradient scaling, providing controlled gradient norms without adversely affecting the model’s expressiveness.

##### Conclusion

The ablation studies confirm that the stable reparameterization is crucial for the S7 model’s performance and training stability. By carefully choosing the reparameterization parameters, specifically $a=1$ and $b=0.5$, we achieve optimal results across various tasks.

The improvements observed across diverse datasets, including event-based data, human activity recognition, genomics classification, and long-range sequence tasks, show the generality and robustness of the reparameterization approach. Incorporating stable reparameterization not only improves performance but also contributes to more stable training dynamics, enabling the S7 model to better capture long-range dependencies and complex temporal patterns inherent in sequential data.

### A.7 Best Hyperparameters

In this section, we provide the hyperparameters used for training the best-performing S7 models across various tasks. The hyperparameters are summarized in Table 11. The tasks include event-based datasets, long-range sequence modeling benchmarks, and other sequence classification tasks. The hyperparameters were carefully selected through Bayesian search and experimentation to optimize model performance while ensuring training stability.

**Table 11: Hyperparameters used for training the best S7 models. Depth: number of layers. H: number of input/output features. P: latent size. J: number of blocks used for the initialization of $\Lambda$. LR: base learning rate. SSM LR: learning rate for SSM parameters. WD: weight decay. Epochs: number of training epochs. B: batch size.**
| Task | Depth | H | Dropout | P | J | LR | SSM LR | WD | Epochs | B |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| DVS-Gesture | 6 | 32 | 0.10 | 16 | 1 | $1.2\times 10^{-5}$ | $1.44\times 10^{-4}$ | 0.000 | 100 | 3 |
| EigenWorms | 1 | 16 | 0.03 | 14 | 7 | $5.6\times 10^{-5}$ | $6.78\times 10^{-4}$ | 0.044 | 900 | 12 |
| Image (LRA) | 2 | 60 | 0.15 | 24 | 12 | $1.0\times 10^{-5}$ | $2.79\times 10^{-3}$ | 0.015 | 200 | 280 |
| ListOps (LRA) | 6 | 102 | 0.23 | 8 | 1 | $5.0\times 10^{-6}$ | $3.42\times 10^{-4}$ | 0.065 | 200 | 64 |
| Pathfinder (LRA) | 6 | 50 | 0.00 | 2 | 1 | $5.0\times 10^{-5}$ | $9.23\times 10^{-4}$ | 0.010 | 200 | 16 |
| Human Activity Recognition | 1 | 120 | 0.04 | 64 | 32 | $9.3\times 10^{-5}$ | $7.42\times 10^{-3}$ | 0.019 | 400 | 80 |
| Retrieval (LRA) | 3 | 80 | 0.10 | 10 | 2 | $2.8\times 10^{-5}$ | $5.04\times 10^{-4}$ | 0.045 | 90 | 18 |
| Spiking Heidelberg Digits | 6 | 48 | 0.14 | 8 | 1 | $4.8\times 10^{-5}$ | $1.54\times 10^{-3}$ | 0.021 | 30 | 32 |
| Spiking Speech Commands | 8 | 32 | 0.25 | 32 | 4 | $1.1\times 10^{-5}$ | $8.68\times 10^{-5}$ | 0.004 | 200 | 8 |
| Text (LRA) | 6 | 96 | 0.31 | 4 | 1 | $3.2\times 10^{-5}$ | $1.03\times 10^{-3}$ | 0.021 | 200 | 32 |
| Walker2d | 1 | 100 | 0.21 | 32 | 16 | $3.7\times 10^{-5}$ | $2.25\times 10^{-3}$ | 0.085 | 100 | 60 |

## Peer Reviews

confidence: 4
contribution: 2
initial_rating: 5
presentation: 2
questions: 1. The S7 should combine the advantages of the S5 and S6, so it needs to be compared with both. E.g., why is it simpler than the S6? Training faster? Fewer parameters?
2. Why did the introduction of selective matrix degrade the effectiveness so much on long sequence tasks like path-X in LRA, compared to S5 (Line 402)? More analysis is needed, otherwise the S7's improved sequential modeling capabilities using input-dependent matrix don't seem useful and convincing.
3. Prior work showed that the performance of deep state space models are sensitive to the initialization of the state matrix. [1] Have you done experiments with different initializations to verify the robustness of the S7 module? Along as the experiments of effectiveness of Stable Reparameterization for Long-Term Dependencies.

[1] Albert Gu, Isys Johnson, Karan Goel, Khaled Saab, Tri Dao, Atri Rudra, and Christopher Ré. Combining recurrent, convolutional, and continuous-time models with linear state space layers. Advances in Neural Information Processing Systems, 34, 2021b.
soundness: 3
strengths: 1. It turns out that the combination of S5 and S6 is helpful for SSM structure and contributes to the development of SSMs.
2. Experiments are conducted on many datasets together with extensive analysis.
summary: This paper proposed a new SSM called S7 for sequence modeling. It combines the strengths of S5 (simpler structure) and S7 (input-dependent state transitions) and incorporates stable reparameterization of the state matrix. Many experiments were carried out to verify the efficiency and performance on different datasets.
weaknesses: 1. The core contribution of this paper seems to be successfully combining S5 and S6, with many experiments being carried out. However, the paper lacks a detailed introduction to the S5 and S6, so readers may not be completely clear about the advantages and disadvantages of these two models, and how S7 surpasses the two. E.g., why to say "S6 introduces hardware-specific complexity" (Line 88)? Some details of S5 and S6 can be shown clearly in 3.1 Background.
2. An intuitive comparison of the S4 (S4D or DSS), S5, S6, and S7 schematic can be given, to clearly show the development and difference of SSMs. Or a similar part like 4. RELATIONSHIP BETWEEN S4 AND S5 in S5 paper [1].
3. The effectiveness of Stable Reparameterization of S7 seems not to be verified.  More introduction to the initialization of the state matrix should be given, or the writing logic of Stable Reparameterization for Long-Term Dependencies (Line 211) is too hard for readers to follow.

[1] Smith, J. T., Warrington, A., & Linderman, S. W. (2022). Simplified State Space Layers for Sequence Modeling. ArXiv. https://arxiv.org/abs/2208.04933

---

confidence: 4
contribution: 1
initial_rating: 3
presentation: 2
questions: 1.	What does S7 mean? (is the ”7” with some particular meaning?)
Other questions please see the above weaknesses.
soundness: 2
strengths: The paper proposes an input-independent mechanism for SSM, with stable reparameterization techniques, and it provides the stability of this reparameterization through comprehensive theoretical derivations.
summary: This paper proposes an SSM (state space model) architecture call S7, to provide an input-dependent mechanism for an existing work (S5), and showing this architecture can efficiently and accurately deal with sequence modeling tasks. The experiments show it performs better than Mamba(S6) in LRA tasks, while worse than other SSM-like models, and show it achieves good performance in neuromorphic datasets and dynamic prediction tasks.
weaknesses: 1.	The novelty is not very clear to me, as mentioned in the paper, it is claimed that this paper provides efficient input-dependent state transition dynamics based on S5, but conceptually, it is the same as what Mamba (S6) did for S4, that introduced learnable matrices A, B, C
2.	The paper claims this S7 is more efficient than Mamba, but I did not find any experiments data on the efficiency comparison with Mamba/Mamba2. Theoretically, without using parallel technologies like selective scan or others, how could one run the S7 in an efficient way when at each time step one needs to update the dynamics of A, B, C, D? 
3.	The experiments do not well support the claims: the performance of S7 in LRA is substantially worse than many other methods, and there’s no results showing it’s better than mamba in general language modeling tasks (which is an important selling point of mamba-like models). This leads to a question: what is the use case of S7?

---

confidence: 5
contribution: 2
initial_rating: 3
presentation: 1
questions: 1. **Could the authors clarify the novelty of the reparameterization?** How does it differ from StableSSM’s reparameterization framework?

2. **Why was the S5 model chosen as the basis for S7?** Given that S6 with the StableSSM reparameterization might provide similar benefits, what informed this design choice?

3. **Could the authors specify if the neuromorphic-specific design applies solely to neuromorphic tasks or to all benchmarks?** This would improve clarity regarding the model's consistency across different tasks.

4. **What is the author’s perspective on improving the model's performance on data whre time-dependance is note relevant?** Given S7’s limited success on LRA, is there a feasible modification that could address these challenges while preserving input-dependence?
soundness: 2
strengths: *Input-Dependent Dynamics:* S7’s adaptation of the  S5 model to be input-dependent is a promising approach. This could enhance the model’s responsiveness to input variability, a significant issue in long-range sequence tasks.

*Stable Reparameterization:* The model claims to maintain gradient stability over long sequences, addressing gradient explosion/vanishing issues commonly faced in deep learning. This feature has potential benefits for training efficiency and stability.

*Broad Applicability:* S7’s successful application across various domains, from physical time series to neuromorphic vision, suggests it may generalize well to different task types.
summary: The paper presents S7, a simplified state-space model (SSM) designed for long-range sequence tasks. Building on the S5 model, it introduces input-dependence to allow dynamic adjustments to state transitions based on input content. The paper claims S7 achieves stable reparameterization and efficient performance across diverse tasks, including neuromorphic event-based datasets and Long Range Arena (LRA) benchmarks, without requiring the complexity of models like S4 or S6 (Mamba). The proposed model is argued to balance computational simplicity with adaptive filtering and content-based reasoning.
weaknesses: **Limited Novelty:** The paper is introducing an input-dependent update mechanism (already introduced by S6)  stabilized through the reparameterization framework and key equations (Eqs. 6, 7, and 8) borrowed directly from StableSSM [1], raising concerns about the originality of the contributions. The paper only states that it was “inspired” by stable reparameterization, yet much of the core methodology relies on prior work.


**Inconsistent Notation:** The notation for $𝐴_k$ is unclear, with dependency on input appearing inconsistently (e.g., it appears in Eq. 5 and line 267 -- e.g. $𝐴_k(u_k, \theta_m)$ but is omitted elsewhere -- e.g. $𝐴_k(\theta_m)$. This lack of uniformity in notation undermines the model’s theoretical presentation.

**Weak Justification for S5 Model Selection:** S5 is mentioned as the basis for S7, but no rationale is provided for not using S6 (Mamba) and the reparameterization technique from StableSSM. Moreover, no connection or description of the S5 model is given (MIMO approach etc.)

**Assumptions Clarity:** Assumptions (3.1, 3.2, and 3.3) are not well justified or examined for feasibility, and the text lacks guidance on implementing or verifying these assumptions. This leaves important theoretical aspects of the model unaddressed.

**Unclear Contribution of Neuromorphic Design:** The neuromorphic-specific design choices in Section 3.4 seem disconnected from the rest of the model’s development (no other mention on the first part of the paper). It’s unclear whether these additions (Eq. 11, 12) apply exclusively to neuromorphic tasks or extend to other benchmark tasks.

**Lack of Benchmark Justification:** The paper does not clarify why specific datasets were chosen. For instance, given the input-dependent nature of S7, benchmarks used by similar models like Mamba (e.g., Selective Copy or Induction Heads or other similar benchmarks -- see Section 7/Table 4 of the thematic survey [2]) might have been more appropriate for comparison.

**Poor Performance on LRA Benchmarks:** S7’s subpar performance on LRA benchmarks raises concerns about its applicability to heterogeneous data. The authors provide only a brief discussion, without substantial insight or proposed solutions for improving performance on these challenging tasks.


[1] Wang, Shida, and Qianxiao Li. "Stablessm: Alleviating the curse of memory in state-space models through stable reparameterization." arXiv preprint arXiv:2311.14495 (2023).

[2] Tiezzi, Matteo, et al. "State-Space Modeling in Long Sequence Processing: A Survey on Recurrence in the Transformer Era." arXiv preprint arXiv:2406.09062 (2024).

---

confidence: 5
contribution: 1
initial_rating: 3
presentation: 2
questions: - Is the code to reproduce the results publicly available?
- How is lambda_k computed?
- Fig.1 delta_k is not defined in the caption
- Line 104-109 this sentence is too long and could be split in 2-3 smaller ones.
- What is the performance of other SSMs in Table 5, 6 and 7?
- In which regards in the S7 simpler or superior over other SSMs? Number of flops? Number of parameters?
soundness: 2
strengths: - The authors evaluate their model on a series of benchmark tasks
- The authors provide some theoretical analysis for the training stability
summary: The paper proposes a novel state-space model (SSM) called S7 that introduces input-dependent dynamics to filter and retain relevant input information over extended time horizons. An important part of S7 is a reparametrization trick that ensures training stability. S7 is claimed to reach a balance between performance and model's complexity for processing very long sequences.
weaknesses: - Scientific novelty of the manuscript: the authors base their work on the existing S5 model and extend it with the input-gating, that other models, such as Mamba already have demonstrated. In fact, it remains even unclear when reading through the main paper how the input-gating is realized precisely. The reader misses those equations. I.e., How is Lambda_k computed?
- The selection of the tasks and in particular the selection of the reference models is a major weakness of the model:
    1. since the S7 model is based on the S5 model, it is of paramount importance that one always compares to S5 at least, which the authors do not do for many datasets they considered. For example, this comparison is missing in Table 5, 6 and 7 (wrongly called Figure 2 in the manuscript).
    2. looking at the LRA results, one can see that S7 is only in 2 tasks slightly better than S5, but in the remaining tasks it is significantly worse. Moreover, in Table 5, 6 and 7 (wrongly called Figure 2 in the manuscript), the authors don’t even compare to the S5.
the authors claim to introduce a simpler model than Mambda, but it remains unclear in what regards it is simpler, e.g., if it uses less number of parameters, or less computations, this needs to be demonstrated in the results.
- Some minor comments are: The authors are very much overstating their novel contributions with terms such as “S7 has demonstrated its superiority”, which is by no means true. Figure 2 on page 10 should probably be Table 7