Sequential Neural Models with Stochastic Layers

Marco Fraccaro, Søren Kaae Sønderby, Ulrich Paquet, Ole Winther

Introduction: Memory vs. Uncertainty

Modeling complex sequences like human speech or polyphonic music is notoriously difficult because it requires two distinct capabilities:

  1. Long-term Memory: The model needs to remember events from the past to maintain coherence over time.
  2. Uncertainty Modeling: Real-world data is noisy and multi-modal. There isn't just one "correct" next step, but rather a distribution of possibilities.

Standard Recurrent Neural Networks (RNNs), such as LSTMs, excel at memory but are fundamentally deterministic—they do not explicitly model the probability of their own internal states. Conversely, State Space Models (SSMs) are built for uncertainty, but they traditionally rely on simple linear transitions to keep the math tractable, making them poor at capturing the complex, nonlinear dependencies found in rich audio. This paper introduces a method to "glue" these two worlds together without losing the benefits of either.

The SRNN Architecture

To bridge this gap, the authors introduce the Stochastic Recurrent Neural Network (SRNN). The architecture is essentially a stacked "sandwich" of two layers:

  • The Deterministic Layer (RNN): A standard GRU or LSTM that processes inputs and maintains a deterministic "memory" state ($d_t$).
  • The Stochastic Layer (SSM): A latent variable layer ($z_t$) that sits on top of the RNN. Its transitions are nonlinear and depend on both the previous stochastic state and the current RNN memory.
The SRNN Generative Model stacking a deterministic RNN layer with a stochastic SSM layer.

By keeping the RNN deterministic and the SSM stochastic, the model avoids the "noisy memory" problem, where stochasticity at every step makes it hard for an RNN to retain information over long horizons.

Key Innovations in Inference

To train this architecture, the authors utilize Variational Auto-Encoders (VAEs) with two clever twists:

1. Structured Smoothing

Instead of just looking at the past to guess the current state (filtering), their inference network uses a backward-recursive RNN. This allows the model to look at the entire sequence—both past and future—to decide what the latent state at time $t$ should have been.

The SRNN Inference Network utilizing a backward-recursive RNN to look at the entire sequence for structured smoothing.

2. The "Resq" Parameterization

A common failure in these models is "KL vanishing," where the model ignores the stochastic layer entirely. The authors fixed this by parameterizing the inference network to learn only the residual (the difference) between the prior's guess and the true posterior. This forces the inference network to focus on "correcting" the model's predictions using new data, treating the inference network as a corrector of the generative model’s internal prior.

Experiments and Results

The model was evaluated on two challenging types of sequential data: raw speech and polyphonic music.

  • Raw Speech Modeling: Evaluated on the Blizzard dataset (300 hours of a single female speaker) and the TIMIT dataset (630 speakers reading short sentences). These are challenging due to their high-dimensional, continuous audio signals. On TIMIT, the SRNN achieved an average log-likelihood of $\geq 60550$, more than doubling the performance of the previous state-of-the-art VRNN ($\approx 29604$).
  • Polyphonic Music Modeling: Evaluated on four MIDI datasets (Nottingham, JSB chorales, MuseData, and Piano-midi.de). The results were comparable to other top-tier models like RNN-NADE. The authors note that music is structurally simpler than raw audio, which might explain the smaller performance gap here.

Qualitatively, visualizations of the KL divergence showed that the model's "uncertainty" spikes exactly during transitions in the audio signal, proving the stochastic layer successfully captures the unpredictable parts of speech.

Limitations and Future Work

While powerful, the SRNN has a few limitations:

  • Real-time Constraints: Because the best-performing version uses a backward RNN for "smoothing," it cannot be used for true real-time, online inference without switching to a slightly less accurate "filtering" version.
  • Computational Intensity: Training on the Blizzard dataset took 18 hours on a high-end GPU (circa 2016). The complexity of the stacked architecture is inherently higher than a simple LSTM.

Future directions suggest this layered approach could be extended to other domains like video processing or robot motion control, where separating deterministic physics from stochastic intent is crucial.

Summary updated

BibTeX
@inproceedings{fraccaro2016sequential,
  author = {Marco Fraccaro and Søren Kaae Sønderby and Ulrich Paquet and Ole Winther},
  title = {{Sequential Neural Models with Stochastic Layers}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2016},
  url = {https://openreview.net/forum?id=By-Ad_ZOWS},
}
Figure