Variational Inference Formulation for a Model-Free Simulation of a Dynamical System with Unknown Parameters by a Recurrent Neural Network

Kyongmin Yeo, Dylan E. C. Grullon, Fan-Keng Sun, Duane S. Boning, Jayant R. Kalagnanam · DOI

This paper, published by researchers at IBM and MIT, presents a novel way to simulate complex dynamical systems when the underlying physical parameters are unknown and vary across different datasets. By combining Variational Inference (VI) with Recurrent Neural Networks (RNNs), the authors created a "model-free" approach that doesn't just predict the next step in a sequence, but actually "infers" the hidden characteristics of the system to provide stable, long-term forecasts.

TL;DR

The authors propose VI-RNN, a deep learning framework that uses variational inference to identify hidden parameters in dynamical systems. By learning a latent representation of these unknown variables, the model significantly outperforms standard RNNs in long-term, multi-step forecasting and can even "discover" the dimensionality of the system's hidden parameters in an unsupervised manner.

What Problem Does This Paper Address?

In fields like fluid mechanics, biology, and engineering, we often use differential equations to describe how a system changes over time. However, these equations usually contain parameters (like friction coefficients or growth rates) that are difficult to measure or change depending on environmental conditions.

Standard data-driven models, such as standard Recurrent Neural Networks (RNNs), typically assume that all training data comes from a single system configuration. When an RNN is trained on an "ensemble" of data—trajectories generated by the same physics but with different parameters—it struggles. It essentially tries to learn an "average" of the dynamics, leading to high uncertainty and rapid divergence when trying to predict more than a few steps into the future. The challenge is to "disentangle" the time-invariant parameters from the time-dependent state of the system.

Methods

The authors introduce a variational inference formulation to solve this. The architecture consists of three main components:

  1. The Encoder RNN: This network looks at a "spin-up" period (a segment of history) of a trajectory and compresses that information into a hidden state.
  2. The Approximate Posterior (Inference Model): A feedforward network that takes the encoder's output and produces a probability distribution (mean and variance) for a latent variable $z$. This $z$ is intended to represent the effect of the unknown physical parameters.
  3. The Decoder RNN (Dynamics Model): This is the "time-marching operator." It takes the current state of the system and a sample from the latent variable $z$ to predict the next state.

The Training Process: The model is trained by minimizing the negative Evidence Lower Bound (ELBO). This loss function has two parts:

  • Reconstruction Error: How well the decoder predicts the actual data.
  • KL Divergence (KLD): A regularization term that keeps the learned latent distribution close to a simple prior (like a standard Gaussian).

A key methodological contribution is the introduction of a penalty parameter $\lambda$ (similar to a $\beta$-VAE) to balance these two terms. The authors also found that training the encoder and decoder sequentially—rather than simultaneously—led to much better performance.

Datasets

The model was evaluated on two classic nonlinear benchmarks:

  • Mackey-Glass Time Series: A nonlinear time-delay differential equation often used to model physiological feedback systems. The authors varied three parameters ($\alpha, \gamma, \tau$) across 500 different trajectories.
  • Forced Van der Pol Oscillator: A model of an oscillating circuit with an external "push" (exogenous forcing). Here, the damping coefficient and forcing amplitude were varied.

Key Insights and Ideas

  • Inference as a Constraint: In standard RNNs, the model relies on "inertia" from its hidden state to keep a prediction going. In VI-RNN, the latent variable $z$ acts as a constant physical constraint, forcing the decoder to follow the specific "flavor" of physics identified during the spin-up period.
  • Unsupervised Discovery: Perhaps the most striking finding is that the model correctly identified the number of hidden parameters. For the Mackey-Glass system (which had 3 varying parameters), the model's latent space showed that only 3 out of 10 dimensions were "active" (non-trivial).
  • Sequence Length as Regularization: The authors point out that in time-series VI, the length of the training sequence $T$ implicitly acts as a regularization weight. By adding the $\lambda$ parameter, they provide a way to tune this balance regardless of the window size.

Key Results

  • Multi-step Accuracy: While VI-RNN and standard RNNs perform similarly on one-step-ahead predictions, the gap widens drastically in multi-step forecasts. For the Mackey-Glass system at 400 steps out, the VI-RNN’s error (NMAE) was only 58% of the standard RNN’s error.
  • Uncertainty Quantification: The 95% prediction intervals for the VI-RNN remained much tighter and more accurate over long horizons compared to the standard RNN, which saw its uncertainty explode as the simulation progressed.
  • Parameter Correlation: The active dimensions of the latent variable $z$ showed a high correlation ($>0.9$) with the actual physical parameters used to generate the data, proving the model successfully learned a physical representation.

Limitations and Future Work

  • Stationary Parameters: The current formulation assumes that while parameters vary between trajectories, they remain constant within a single trajectory. It cannot yet handle systems where the physics shifts mid-stream (e.g., a part wearing out during operation).
  • Training Complexity: The VI-RNN takes about 2.5 times longer to train than a standard RNN due to the sequential training of the encoder and decoder and the Monte Carlo sampling required for the variational step.
  • Hyperparameter Sensitivity: While the model is robust for small values of $\lambda$, setting it too high (e.g., $\lambda=10$) causes the latent variable to become "noise," destroying the model's ability to capture the underlying physics.

The authors suggest that future work could involve using Principal Component Analysis (PCA) on the latent space to automatically determine the effective dimension of unknown parameters in even more complex, real-world systems.

Summary updated

BibTeX
@article{yeo2021variational,
  author = {Kyongmin Yeo and Dylan E. C. Grullon and Fan-Keng Sun and Duane S. Boning and Jayant R. Kalagnanam},
  title = {{Variational Inference Formulation for a Model-Free Simulation of a Dynamical System with Unknown Parameters by a Recurrent Neural Network}},
  journal = {SIAM J. Sci. Comput.},
  year = {2021},
  doi = {10.1137/20m1323151},
}
Figure