Modeling Irregular Time Series with Continuous Recurrent Units

Mona Schirmer, Mazin Eltayeb, Stefan Lessmann, Maja Rudolph

TL;DR

The Continuous Recurrent Unit (CRU) is a novel neural architecture designed to handle irregularly sampled time series by modeling latent dynamics with a linear Stochastic Differential Equation (SDE). By leveraging the continuous-discrete Kalman filter, the CRU achieves closed-form updates. This bypasses the slow numerical solvers typically required by Neural ODEs while providing a principled, uncertainty-aware gating mechanism.

The Challenge of Irregular Time Series

Most sequence models, such as LSTMs and GRUs, assume that data arrives at fixed, discrete time intervals. However, real-world data—like electronic health records or climate measurements—is often irregularly sampled. In a medical setting, the time between doctor visits isn't just a nuisance; it’s highly informative. A long gap might indicate a patient is healthy, while frequent visits suggest a deteriorating condition.

While Neural Ordinary Differential Equations (Neural ODEs) have emerged as a popular solution for continuous-time modeling, they come with a heavy computational tax. They rely on numerical solvers that can be slow and unstable during training. The authors seek a middle ground: a model that maintains the temporal continuity of ODEs but offers the efficiency and probabilistic rigor of classical state-space models.

Introducing the Continuous Recurrent Unit (CRU)

The authors introduce the Continuous Recurrent Unit (CRU), which builds its core logic on two mathematical pillars:

  1. Latent SDE Dynamics: Instead of a discrete hidden state, the CRU assumes a latent state that evolves according to a linear Stochastic Differential Equation. This allows the model to analytically "evolve" the state over any arbitrary time gap $\Delta t$.
  2. Continuous-Discrete Kalman Filter: The CRU uses the mathematics of Kalman filtering to process observations.
  3. Predict Step: Uses the SDE solution to propagate the mean and variance of the latent state to the next observation time.
  4. Update Step: Uses a Bayesian update to integrate the new observation. The "Kalman Gain" acts as a natural gating mechanism, deciding how much to trust the new, potentially noisy data versus the model's internal history.
CRU Architecture

To make this approach scale to higher dimensions, the authors propose the fast CRU (f-CRU). By parameterizing the transition matrices using a shared eigendecomposition (diagonalizing the matrices), they turn expensive matrix exponentials into simple element-wise operations, significantly boosting computational speed.

Key Insights and Mechanisms

  • Closed-Form is King: By restricting the latent dynamics to a linear SDE, the authors obtain exact analytical solutions. This eliminates the need for numerical ODE solvers, making the model faster and easier to train.
  • Uncertainty-Driven Gating: In a standard GRU, "gates" are learned black-box functions. In the CRU, gating is handled naturally by the Kalman Gain. If the encoder signals that an observation is noisy (high uncertainty), the Kalman Gain automatically gives it less weight.
  • Locally Linear, Globally Non-linear: While the SDE is linear, the model remains highly expressive. The transition matrices are "locally linear"—computed as a weighted average of basis matrices based on the current state—and the encoder/decoder are non-linear neural networks.

Datasets and Key Results

The model was evaluated on three distinct challenges: a synthetic Pendulum Images dataset (testing high-dimensional visual data and noise), USHCN climate data (testing interpolation/extrapolation on sparse sensor data), and Physionet medical records (a classic benchmark for highly irregular ICU measurements).

Results Table
  • Superior Interpolation: On the USHCN and Physionet datasets, the CRU and f-CRU consistently outperformed Latent ODEs and ODE-RNNs in mean squared error (MSE) for interpolation tasks.
  • Efficiency Gains: The f-CRU is significantly faster than the standard CRU as the latent dimension increases. More importantly, it is often 2x to 10x faster to train per epoch than Neural ODE-based models.
  • Noise Robustness: In the pendulum task, visualizing the Kalman Gain revealed that when input images were corrupted by noise, the model's gain decreased. It was "smart" enough to rely more on its internal dynamics than the noisy input.

Limitations and Future Work

  • Linearity Constraints: Although the "locally linear" approach adds flexibility, the underlying assumption of linear dynamics between observations might still be a bottleneck for extremely complex, non-linear physical systems.
  • f-CRU Expressivity: To achieve its speed, f-CRU requires basis matrices to be commutative and symmetric. The authors acknowledge this limits modeling flexibility compared to the full CRU.
  • Future Directions: The authors suggest exploring more complex noise models beyond Gaussian noise and applying the CRU to even larger-scale multi-modal datasets where irregular sampling is the norm.

Summary updated

BibTeX
@inproceedings{schirmer2022modeling,
  author = {Mona Schirmer and Mazin Eltayeb and Stefan Lessmann and Maja Rudolph},
  title = {{Modeling Irregular Time Series with Continuous Recurrent Units}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=gtUikIeEQK2},
}
Figure