Towards Recurrent Autoregressive Flow Models

John Mern, Peter Morales, Mykel J. KochenderferarXiv 2020

Introduction

Modeling stochastic processes—data that evolves over time—remains a significant challenge in generative modeling. While Normalizing Flows (NFs) excel at transforming simple base distributions into complex, high-dimensional static distributions, they often struggle with temporal dependencies. Traditional conditional NFs are frequently too rigid, often limited to shifting the mean or scale based on immediate past observations. This rigidity makes them ill-equipped for non-stationary sequences where the underlying distribution may jump between multiple modes based on a long history of events.

To address these limitations, researchers from Stanford and MIT have introduced Recurrent Autoregressive Flows (RAFs). This architecture combines the expressive power of Normalizing Flows with the temporal memory of Recurrent Neural Networks (RNNs) by conditioning flow parameters on a hidden state that evolves over time.

Methodology: The RAF Cell

The core innovation of this work is the RAF Cell, a modular unit designed to process sequential data while maintaining a tractable probability density. The cell consists of two primary components:

  1. Conditioning Cell: Utilizing a Gated Recurrent Unit (GRU), this component maintains a hidden state ($h_t$) that encodes the sequence's history.
  2. Transformer Function: This component acts as the normalizing flow. Unlike standard flows with fixed parameters, the RAF cell uses the hidden state ($h_t$) to dynamically generate the weights and biases for the transformation.
The RAF Cell architecture, showing the interaction between the Conditioning Cell and the Transformer Function.

Specifically, the hidden state is partitioned into a weight vector (reshaped into a lower-triangular matrix) and a bias vector. This configuration allows for an expressive affine transformation ($z = \sigma(Wx + b)$) while ensuring the Jacobian remains lower-triangular, keeping the determinant calculation efficient ($O(d)$ time) and preserving the analytic invertibility of the flow.

Experimental Evaluation

The RAF model was evaluated across three simulated environments designed to test different aspects of stochastic modeling:

  • Hierarchical Stochastic Process: A 2D toy problem where data points are drawn from one of two "banana-shaped" distributions based on a hidden Bernoulli variable.
  • Maze Navigation: A simulation of a mouse moving through a maze with a bimodal speed distribution and random choices at intersections, creating complex, time-dependent distributions.
  • Fluid Flow Modeling: A 2D simulation of heat and mass transfer, requiring the model to predict the evolution of a bimodal temperature distribution over time.

Discussion and Results

The experiments highlighted several key advantages of the RAF architecture:

Memory and Mode Separation: By leveraging a GRU for conditioning, the model can "remember" its current distributional mode. In the hierarchical experiment, the RAF successfully separated the two modes. In contrast, standard models like Real-NVP, which lack long-term memory, often produced a "bridge" of probability between modes, failing to capture the underlying latent structure.

Comparison of Real-NVP and RAF models on a hierarchical process. The RAF model (right) correctly separates the modes, while Real-NVP (left) creates a bridge between them.

Expressive Conditioning and Performance: The use of a full triangular weight matrix allows the model to learn complex, time-varying correlations. In the maze navigation task, the RAF achieved an average log probability density of 1.83 ± 0.31, significantly outperforming a standard RNN baseline (1.2 ± 0.12). Furthermore, in fluid flow tasks, the RAF accurately tracked the motion and diffusion of fluid masses, effectively casting physical simulation as a distribution modeling problem.

Conclusion

While RAFs show great promise, challenges remain. The model can be sensitive to time-scales, occasionally struggling with sparse events like intersections in maze navigation. Additionally, "reconstruction blur" was noted in high-dimensional fluid flow experiments, likely due to the lossy nature of initial autoencoding. Future work may explore temporal dilation to handle multiple time scales and importance-weighted replay buffers to improve learning from rare events. Overall, RAFs represent a significant step toward more expressive and memory-capable generative models for temporal data.

Summary updated

BibTeX
@misc{mern2020towards,
  author = {John Mern and Peter Morales and Mykel J. Kochenderfer},
  title = {{Towards Recurrent Autoregressive Flow Models}},
  year = {2020},
  eprint = {2006.10096},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2006.10096},
}
Figure