Long Range Dependency Understanding in State Space Models

Srividya Ravikumar, Shweta Verma, Abhinav Anand, Mira MeziniMech Interp @ ICML 2026

TL;DR

This paper dives into the "black box" of State Space Models (SSMs), specifically the S4D variant, to understand how they capture long-range dependencies in sequences. By analyzing the learned kernels in both time and frequency domains, the authors reveal that architectural choices significantly impact an SSM's ability to model long-range information, with some configurations acting like low-pass filters and others like band-pass filters. This interpretability is crucial for designing more effective SSM-based models for tasks like code vulnerability detection.

What Problem Does This Paper Address?

State Space Models (SSMs) have emerged as powerful tools for handling long sequences, rivaling transformers in various domains. However, much of the research has focused on their impressive predictive accuracy, leaving their internal workings – particularly how they learn and represent long-range dependencies – largely unexplored. This lack of interpretability makes it difficult to understand why certain architectures perform better than others and hinders the development of more robust and efficient SSMs. This paper aims to bridge this gap by systematically analyzing the learned kernels of SSMs, specifically the S4D variant, to understand their filter-like behavior and how it relates to their ability to capture long-range dependencies.

Methods

The researchers employed a two-pronged approach to analyze the learned kernels of S4D models:

  • Time-Domain Analysis: They examined the impulse responses of the S4D kernels to understand their "peak sensitivity" (maximum positive and negative amplitudes) and "transition sharpness" (how quickly the kernel changes). This helps determine if the kernel responds strongly to specific points in time or exhibits smoother, more gradual changes.
  • Frequency-Domain Analysis: Using the Fast Fourier Transform (FFT), they analyzed the spectral representation of the kernels. This allowed them to identify the "dominant frequency" (where most of the kernel's energy lies), "secondary peaks" (other significant frequencies), and "spectral entropy" (a measure of how concentrated or spread out the spectral energy is). This analysis reveals whether a kernel acts like a low-pass filter (emphasizing low frequencies/long-range dependencies), a high-pass filter (emphasizing high frequencies/short-range dependencies), or a band-pass filter (emphasizing a specific range of frequencies).

They implemented six different model architectures, varying the feature extraction block before the S4D layer, to see how these architectural choices influenced the kernel's behavior.

Datasets

The models were trained and evaluated on the ReVeal dataset. This is a real-world benchmark for vulnerability detection in source code, derived from two large open-source projects (Linux Debian kernel and Chromium). It contains a significant number of functions, with a notable class imbalance between vulnerable and non-vulnerable code.

Key Insights and Ideas

  • SSM Kernels as Filters: The core insight is that SSM kernels, particularly the S4D variant, can be understood as specialized filters. Depending on the preceding architecture, these kernels can exhibit low-pass, band-pass, or high-pass characteristics, directly influencing their ability to capture different types of dependencies.
  • Architecture Dictates Long-Range Capability: The study demonstrates that the standalone S4D model, despite its theoretical capacity for long-range modeling, often defaults to learning short-range dependencies. However, when S4D is preceded by specific convolutional layers or a State Memory Replay (SMR) mechanism, its ability to capture long-range dependencies significantly improves.
  • SMR+S4D for Optimal Long-Range Understanding: The SMR+S4D architecture emerged as the top performer. Its S4D kernel exhibited a low-pass bias, meaning it strongly emphasized low frequencies and smooth, long-range dependencies, which directly correlated with its superior performance in vulnerability detection.
  • Complementary Strengths of CNNs and SSMs: The research highlights how combining convolutional layers (good at local feature extraction) with S4D layers (good at global context modeling) can create powerful hybrid architectures that leverage the strengths of both.

Key Results

  • Performance: The SMR+S4D model achieved the highest F1 score of 88.03 on the ReVeal dataset, outperforming both standalone convolutional and S4D models, as well as other hybrid architectures.
  • Kernel Behavior:
    • The standalone S4D model's kernel showed sensitivity to short- to mid-range transitions, with a dominant mid-frequency component.
  • The Depthwise+S4D variant exhibited a band-pass profile, capturing both local and broader structures.
  • The Conv+S4D model showed sharp temporal responses and a broadband spectrum, suggesting engagement with both fine-grained syntax and longer-range semantics.
  • The SMR+S4D kernel displayed a low-pass profile, emphasizing smooth long-range dependencies and suppressing rapid variations, aligning with its top performance.

Limitations and Future Work

  • Focus on S4D: The study specifically analyzes the S4D variant of SSMs. While S4D is computationally efficient, other SSM variants might exhibit different kernel behaviors.
  • Single-Layer Analysis: For simplicity and interpretability, the study focused on single-layer models. Future work could explore how these findings extend to deeper, more complex SSM architectures.
  • Real-World Task: While the use of the ReVeal dataset for vulnerability detection is a strength, further validation on diverse long-sequence tasks would be beneficial.

The authors suggest that their analysis framework can be a valuable tool for understanding SSM behavior and guiding the design of future, more effective SSM-based models. The insights gained can help researchers intentionally design architectures that promote desired filter characteristics for specific tasks.

Summary updated

BibTeX
@inproceedings{ravikumar2026long,
  author = {Srividya Ravikumar and Shweta Verma and Abhinav Anand and Mira Mezini},
  title = {{Long Range Dependency Understanding in State Space Models}},
  booktitle = {Mech Interp @ ICML},
  year = {2026},
  url = {https://openreview.net/forum?id=94b8swEmqk},
}
Figure