Abstract
This paper introduces a deep generative model that integrates Switching Linear Dynamical Systems (SLDS) with Variational Autoencoders (VAEs) to learn complex, nonlinear physics from raw data. By utilizing stochastic switching variables to govern piecewise linear transitions, the model identifies interpretable latent features—such as physical boundaries and joint constraints—entirely without supervision. This approach leads to significantly more accurate future state predictions compared to deterministic transition models. We evaluate our method on low-dimensional kinematic tasks and high-dimensional image data, demonstrating its robustness and interpretability.
Introduction
In model-based reinforcement learning and control, accurate system identification is crucial for predicting environment dynamics. Real-world physics are inherently nonlinear, making them difficult to approximate. A classic solution is the Switching Linear Dynamical System (SLDS), which decomposes complex nonlinear dynamics into a sequence of simpler, locally linear regimes. While recent efforts have combined SLDS with deep learning frameworks like recurrent VAEs to handle high-dimensional data, many of these models treat transition dynamics deterministically. We argue that a probabilistic (stochastic) treatment of transition dynamics is essential for discovering robust, meaningful features in an unsupervised manner.
Methodology
Our proposed framework is a recurrent VAE that models two types of latent variables at each time step: continuous state variables ($z_t$) representing the system's state (e.g., position, velocity), and switching variables ($s_t$) that select the linear dynamics matrix for the transition to the next state.
To enable end-to-end training via backpropagation, we address the non-differentiability of discrete categorical variables for $s_t$ using a Concrete distribution (Gumbel-Softmax trick), providing a continuous relaxation. Furthermore, we implement a structured inference scheme that combines a generative transition model with an inverse measurement model via a Bayesian update, similar to a Kalman Filter. This ensures effective gradient flow through the transition model.
Experimental Setup
We evaluated the approach on several tasks:
- Multi-Agent Maze: A Box2D simulation where agents' positions are observed, requiring the model to infer velocities.
- Roboschool Reacher: A robotic arm task observing only joint angles.
- Ball in a Box: A benchmark 32x32 binary video dataset of a bouncing ball.
- FitzHugh-Nagumo (FHN): A 2D relaxation oscillator modeling neuron excitability.
Results and Discussion
Our model demonstrated superior predictive accuracy over baselines such as LSTMs and Kalman VAEs. Notably, on the Roboschool Reacher task, the Gaussian variant of our model achieved a Mean Squared Error (MSE) of 4.97E-02 for 10-step predictions, nearly halving the error of the closest baseline.
We also found that switching variables naturally encode physical constraints, such as wall boundaries or joint limits, without explicit labels. In the maze task, specific switching variables activated only when an agent was about to hit a wall. Interestingly, modeling switching variables with a continuous Gaussian distribution outperformed the discrete Concrete distribution. This "Gaussian Surprise" is attributed to the model's sensitivity to temporal discretization scales; continuous variables can smoothly scale transition matrices to compensate for larger time steps, whereas strict discrete switches struggle.
Conclusion
This work highlights the importance of stochasticity in learning interpretable and accurate dynamical models. While the Concrete distribution offers theoretical advantages, its training sensitivity remains a challenge. Future work will explore disentangling latent spaces to handle multiple independent objects and applying these learned models to real-world robotic control.
Summary updated