Hierarchical State Space Models for Continuous Sequence-to-Sequence Modeling

Raunaq Bhirangi, Chenyu Wang, Venkatesh Pattabiraman, Carmel Majidi, Abhinav Gupta, Tess Hellebrekers, Lerrel Pinto

TL;DR

Continuous sequence-to-sequence prediction (CSP) from raw, noisy sensory data is crucial for robotics and medical devices but is frequently bottlenecked by long sequence lengths and data drift. This paper introduces Hierarchical State-Space Models (HiSS), an architecture that stacks structured state-space models to capture multi-scale temporal structures efficiently. Evaluated on CSP-Bench, a newly introduced 6-dataset benchmark, HiSS outperforms state-of-the-art models like Transformers, LSTMs, and Mamba by at least 23% in median Mean Squared Error (MSE).

What Problem Does This Paper Address?

Real-world sensors—such as magnetometers, piezoresistors, and inertial measurement units (IMUs)—generate high-frequency, noisy, and non-linear data streams that often exhibit data-dependent drift over time. Translating these raw sensory streams into physical quantities (like force, velocity, or joint angles) is a continuous sequence-to-sequence prediction (CSP) problem.

Traditional filtering methods (like Kalman filters) require complex, hard-to-engineer analytical models of system dynamics. Modern deep learning sequence models offer an alternative, but they hit significant computational walls: Transformers scale quadratically ($O(N^2)$) with sequence length, making them memory-prohibitive for high-frequency sensor data, while LSTMs struggle to maintain long-range dependencies. Furthermore, progress has been slowed by the lack of a unified benchmark to evaluate general-purpose CSP algorithms across different sensor modalities.

Methods

The authors propose Hierarchical State-Space Models (HiSS) to exploit the inherent temporal redundancies in high-frequency sensor data. Instead of processing the entire sequence flatly, HiSS establishes a two-level temporal hierarchy:

  1. Low-level SSM: The raw input sequence is divided into equally-sized chunks (e.g., a chunk size of $k=10$). A shared, flat State-Space Model (such as S4 or Mamba) processes each chunk to extract local, temporally compact features.
  2. High-level SSM: A second sequence model operates on the sequence of these local chunk features to make global predictions at the lower target frequency.

By chunking the input, HiSS maintains linear computational complexity ($O(N)$), making it far more efficient than Transformers while explicitly structuring the network to handle multi-frequency phenomena (e.g., high-frequency vibration noise vs. low-frequency sensor drift).

Datasets

To rigorously evaluate CSP models, the authors introduce CSP-Bench, a comprehensive benchmark consisting of six real-world datasets totaling 40 hours of data:

  • Three In-House Tactile Datasets: ReSkin Marker Writing (predicting end-effector velocity from magnetic tactile skins), ReSkin Intrinsic Slip (predicting slip velocity across various boxes), and XELA Joystick Control (predicting joystick state from a 16-DOF robot hand).
  • Three Curated Public Datasets: RoNIN (smartphone IMU data for inertial navigation), VECtor (event-centric SLAM dataset), and TotalCapture (3D human pose estimation using IMUs).
Figure 3. CSP-Bench is comprised of six datasets. Three datasets – ReSkin Marker Writing, ReSkin Intrinsic Slip and XELA Joystick Control are tactile datasets collected in-house on two different robot setups as demonstrated above. Three other datasets – RoNIN (Herath et al., 2020), VECtor (Gao et al., 2022) and TotalCapture (Trumble et al., 2017) are curated open-source datasets.

Key Insights and Ideas

  • Temporal Hierarchies Match Sensor Physics: Sensory data naturally contains multi-frequency components (e.g., high-frequency vibration noise vs. slow sensor drift). Flat models treat all timesteps equally, whereas HiSS's chunking mechanism allows the low-level model to filter local noise while the high-level model tracks long-term global trends.
  • SSMs Beat Transformers on Continuous Data: Even before applying the hierarchical structure, flat structured state-space models (S4, Mamba) inherently handle long contexts better and scale more efficiently than Transformers and LSTMs, outperforming them by 10–14% median MSE.
  • Smart Compression Over Naive Downsampling: Instead of throwing away data via naive downsampling to match the output frequency, the low-level SSM distills and preserves critical high-frequency information into the chunk features.

Key Results

  • State-of-the-Art Performance: HiSS achieved a 23% median MSE improvement over the best flat sequence models across the benchmark tasks.
  • Data Efficiency: In low-data regimes (training on only 30–50% of the dataset), HiSS consistently outperformed flat baselines, demonstrating superior sample efficiency because its low-level chunk processor operates identically across all chunks.
  • End-to-End Filtering: HiSS works exceptionally well on raw data, often outperforming models trained on manually low-pass filtered data. This indicates that the architecture successfully learns to filter out noise end-to-end without relying on handcrafted preprocessing.
Figure 1. CSP-Bench is a publicly accessible benchmark for con- tinuous sequence prediction on real-world sensory data. We show that Hierarchical State Space Models (HiSS) improve over conven- tional sequence models on sequential sensory prediction tasks.

Limitations and Future Work

  • Failure on High-Dimensional Data: HiSS and flat SSMs underperformed compared to a flat LSTM on the TotalCapture dataset. The authors hypothesize that SSMs struggle to learn expressive representations to filter out noise when both the input and output spaces are highly dimensional (e.g., 60-dimensional joint velocities).
  • Hyperparameter Tuning: HiSS introduces an extra hyperparameter—chunk size ($k$). While setting the chunk size to match the sensor-to-output frequency ratio works well, dynamically optimizing or learning this chunk size remains an open direction for future research.

Summary updated

Abstract

Reasoning from sequences of raw sensory data is a ubiquitous problem across fields ranging from medical devices to robotics. These problems often involve using long sequences of raw sensor data (e.g. magnetometers, piezoresistors) to predict sequences of desirable physical quantities (e.g. force, inertial measurements). While classical approaches are powerful for locally-linear prediction problems, they often fall short when using real-world sensors. These sensors are typically non-linear, are affected by extraneous variables (e.g. vibration), and exhibit data-dependent drift. For many problems, the prediction task is exacerbated by small labeled datasets since obtaining ground-truth labels requires expensive equipment. In this work, we present Hierarchical State-Space Models (HiSS), a conceptually simple, new technique for continuous sequential prediction. HiSS stacks structured state-space models on top of each other to create a temporal hierarchy. Across six real-world sensor datasets, from tactile-based state prediction to accelerometer-based inertial measurement, HiSS outperforms state-of-the-art sequence models such as causal Transformers, LSTMs, S4, and Mamba by at least 23% on MSE. Our experiments further indicate that HiSS demonstrates efficient scaling to smaller datasets and is compatible with existing data-filtering techniques. Code, datasets and videos can be found on https://hiss-csp.github.io.
BibTeX
@inproceedings{bhirangi2024hierarchical,
  author = {Raunaq Bhirangi and Chenyu Wang and Venkatesh Pattabiraman and Carmel Majidi and Abhinav Gupta and Tess Hellebrekers and Lerrel Pinto},
  title = {{Hierarchical State Space Models for Continuous Sequence-to-Sequence Modeling}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=TK7xkOsXDu},
}
Figure