Liquid Structural State-Space Models

Ramin Hasani, Mathias Lechner, Tsun-Hsuan Wang, Makram Chahine, Alexander Amini, Daniela Rus

Modeling long sequences—such as extensive documents, high-frequency audio, or continuous medical sensor data—remains a fundamental challenge in artificial intelligence. Traditional Recurrent Neural Networks (RNNs) struggle with vanishing gradients over long horizons, while Transformers become computationally prohibitive as sequence lengths grow due to their quadratic complexity.

Recently, Structured State-Space Models (S4) have emerged as a powerful alternative. By using clever mathematical decompositions to represent linear dynamical systems as convolutions, S4 models can process extremely long sequences efficiently. However, S4 models are inherently "static": their state-transition matrices remain fixed during inference.

Conversely, Liquid Time-Constant (LTC) networks are "adaptive." Their transition matrices change based on incoming inputs, allowing them to adjust their dynamics on the fly. The drawback is that LTCs rely on complex differential equation solvers, making them too slow to scale to the massive sequence lengths where S4 excels.

In this paper, the authors ask: Can we get the best of both worlds? The result is Liquid-S4, a model that combines the adaptive, input-dependent dynamics of LTC networks with the massive scalability of S4.

The Liquid-S4 Approach

The authors introduce a method to integrate the "liquid" property of LTCs into the highly efficient S4 framework through a few key mathematical steps:

  1. Linearization: The authors begin with the nonlinear LTC equation and apply a first-order Taylor approximation. This transforms the complex differential model into a linear, input-dependent State-Space Model (SSM).
  2. The Liquid Kernel: When this new model is unrolled into a convolutional form, it yields the standard S4 kernel plus a novel "Liquid Kernel." This additional term explicitly accounts for auto-correlations and similarities within the input signal.
  3. Efficient Computation: To maintain computational speed, the model leverages the same "Diagonal Plus Low-Rank" (DPLR) decomposition and Cauchy kernel mathematics used in S4. This allows the "liquid" dynamics to be computed efficiently in the frequency domain using Fast Fourier Transforms (FFTs).
  4. Simplified Variants: The researchers propose two versions: Liquid-S4-KB (the full version) and Liquid-S4-PB (a simplified version using powers of the input vector). They found that the simpler PB version often performs just as well, if not better.

Key Insights and Capabilities

Input-Dependent Dynamics: The core advantage of Liquid-S4 is that its internal state transition is a function of the input. The model doesn't just passively process data; it actively alters its internal physics to match the specific sequence it is currently reading.

The Power of Correlation: The Liquid Kernel essentially acts as a learned similarity measure. It allows the model to weigh different parts of the sequence based on how they correlate with each other. This provides a mechanism similar to attention, but housed within a vastly more efficient SSM framework.

Scaling the "Liquid Order": The complexity of the correlation terms is defined by a "liquid order" ($p$). The authors discovered that increasing this order consistently improves performance on complex reasoning tasks.

Accuracy scaling with liquid order $p$ on ListOps and IMDB tasks.

Parameter Efficiency: Liquid-S4 isn't just more accurate; it is highly parameter-efficient. On the Speech Commands task, it outperformed the original S4 model while utilizing 30% fewer parameters.

Benchmark Results

The model was subjected to a rigorous set of benchmarks, demonstrating state-of-the-art (SOTA) capabilities across multiple domains:

  • Long Range Arena (LRA): On this standard suite of six tasks (with sequence lengths ranging from 1,000 to 16,000 steps), Liquid-S4 set a new SOTA with an average accuracy of 87.32%, outperforming previous S4 variants and Transformer models. Notably, on the most difficult task (Path-X, length 16k), it achieved 96.66%, proving its dominance in extreme long-range dependencies.
Long-Range Arena (LRA) benchmark results comparing Liquid-S4 to previous models.
  • Speech Recognition: Liquid-S4 achieved 96.78% accuracy classifying 35 different spoken words from raw 16kHz audio.
  • Medical Time-Series: On the BIDMC Vital Signs dataset, Liquid-S4 reduced the Root Mean Square Error (RMSE) for respiratory rate prediction by 36% compared to the standard S4-LegS model.

Limitations and Future Work

While highly capable, Liquid-S4 has some limitations. The current implementation truncates the liquid kernel to a specific order ($p$), which may leave some expressive power on the table. Additionally, while excellent at 16kHz speech, its zero-shot performance dropped slightly when tested on downsampled 8kHz audio without retraining, suggesting the liquid kernel might be sensitive to specific covariance structures in the training data.

Looking forward, the authors suggest a potential "Liquid-S5" model. By utilizing parallel scans instead of convolutions, future iterations could avoid truncating the liquid terms entirely, potentially unlocking even greater adaptive capabilities for sequence modeling.

Summary updated

BibTeX
@inproceedings{hasani2023liquid,
  author = {Ramin Hasani and Mathias Lechner and Tsun-Hsuan Wang and Makram Chahine and Alexander Amini and Daniela Rus},
  title = {{Liquid Structural State-Space Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=g4OTKRKfS7R},
}
Figure