Abstract
Recurrent neural networks (RNNs) with continuous-time hidden states are a natural fit for modeling irregularly-sampled time series. These models, however, face difficulties when the input data possess long-term dependencies. We prove that similar to standard RNNs, the underlying reason for this issue is the vanishing or exploding of the gradient during training. This phenomenon is expressed by the ordinary differential equation (ODE) representation of the hidden state, regardless of the ODE solver's choice. We provide a solution by designing a new algorithm based on the long short-term memory (LSTM) that separates its memory from its time-continuous state. This way, we encode a continuous-time dynamical flow within the RNN, allowing it to respond to inputs arriving at arbitrary time-lags while ensuring a constant error propagation through the memory path. We call these RNN models ODE-LSTMs. We experimentally show that ODE-LSTMs outperform advanced RNN-based counterparts on non-uniformly sampled data with long-term dependencies.
Introduction
In real-world applications such as electronic health records or financial markets, data points are often collected at irregular intervals. Traditional Recurrent Neural Networks (RNNs) struggle with this irregularity as they assume a fixed time step. To address this, researchers developed ODE-RNNs, which model the hidden state as a continuous flow defined by an Ordinary Differential Equation (ODE). While elegant, these models fail to capture long-term dependencies. This paper identifies the root cause: ODE-RNNs suffer from vanishing and exploding gradients, much like their discrete-time predecessors. Crucially, the authors prove that this problem persists regardless of the ODE solver used or whether training employs standard backpropagation or the adjoint method.
The ODE-LSTM Architecture
The core innovation presented is the ODE-LSTM. It addresses the gradient problem by decoupling the network's long-term memory from its continuous-time dynamics.
The ODE-LSTM introduces a dual-path structure to manage information:
- Discrete Memory Path: The model maintains a standard LSTM cell state ($c_t$). This state remains constant between observations, acting as a "gradient highway" that ensures constant error propagation and protects long-term memory.
- Continuous Output Path: The hidden state ($h_t$) evolves continuously using an ODE solver between observations. This allows the model to adjust its internal state based on the specific time elapsed since the last data point.
When a new input arrives, the LSTM's gating mechanisms use the time-continuous hidden state to update the discrete memory, effectively bridging the gap between continuous flow and robust memory.
Experimental Evaluation
The authors benchmarked the ODE-LSTM against several baselines, including CT-RNN, GRU-D, and Phased-LSTM, across four challenging tasks:
- Bit-stream XOR: Requires remembering initial bits over a long stream.
- Person Activity (UCI): Real-world sensor data with phase shifts.
- Event-based Sequential MNIST: Images processed as sparse, irregular pixel streams.
- Walker2d Kinematic Simulation: Predicting future robot states from irregular observations.
Results and Discussion
The ODE-LSTM demonstrated superior performance across all benchmarks, particularly in tasks requiring long-term memory. For instance, on Event-based MNIST, it achieved 95.73% accuracy compared to the standard ODE-RNN's 72.41%. In the Walker2d kinematic task, the ODE-LSTM's error (0.883) was nearly half that of the standard ODE-RNN (1.904).
The training dynamics reveal why the ODE-LSTM succeeds. In the backpropagation phase, the teaching signal for the ODE-LSTM remains strong across reversed time, whereas it vanishes for the ODE-RNN. This is reflected in the loss surfaces: the ODE-RNN's surface features a vast plateau where gradients are near zero, making optimization difficult. In contrast, the ODE-LSTM's loss surface provides a clear path to the optimal parameters ($\theta_{best}$).
Conclusion
The ODE-LSTM effectively bridges the gap between continuous-time modeling and long-term dependency learning. By separating memory from flow, it overcomes the vanishing gradient problem inherent in standard ODE-RNNs. While it introduces some computational overhead due to the ODE solver, its robustness to irregular sampling and long-term patterns makes it a powerful tool for complex time-series analysis.
Summary updated