Particle Filter Recurrent Neural Networks

Xiao Ma, Péter Karkus, David Hsu, Wee Sun Lee

Abstract

Recurrent neural networks (RNNs) have been extraordinarily successful for prediction with sequential data. To tackle highly variable and noisy real-world data, we introduce Particle Filter Recurrent Neural Networks (PF-RNNs), a new RNN family that explicitly models uncertainty in its internal structure: while an RNN relies on a long, deterministic latent state vector, a PF-RNN maintains a latent state distribution, approximated as a set of particles. For effective learning, we provide a fully differentiable particle filter algorithm that updates the PF-RNN latent state distribution according to the Bayes rule. Experiments demonstrate that the proposed PF-RNNs outperform the corresponding standard gated RNNs on a synthetic robot localization dataset and 10 real-world sequence prediction datasets for text classification, stock price prediction, etc.

Introduction: Addressing Determinism in Sequential Modeling

Standard Recurrent Neural Networks (RNNs), such as LSTMs and GRUs, maintain a "memory" of past inputs using a single hidden vector ($h$). While powerful, this deterministic approach struggles with real-world data that is highly variable, noisy, or multi-modal—situations where multiple conflicting hypotheses about the state might be true simultaneously.

Comparison between standard RNN (deterministic update) and PF-RNN (stochastic Bayesian update).

To capture complex distributions, researchers typically increase the size of the hidden vector, but this leads to a massive increase in parameters and data requirements. Traditional "model-based" solutions like Particle Filters are excellent at tracking uncertain states but usually require handcrafted physical models and are difficult to integrate into end-to-end deep learning pipelines due to non-differentiable resampling steps.

Methods: The PF-RNN Architecture

The authors introduce PF-RNNs, specifically PF-LSTM and PF-GRU, which serve as drop-in replacements for their standard counterparts. The key innovations include:

  1. Latent Particle Representation: Instead of one hidden vector, the model maintains $K$ particles, each with its own state and weight. The "belief" of the network is the distribution formed by these particles.
  2. Stochastic Memory Update: Each particle updates its state using a learned transition function. To maintain differentiability, the authors use the reparameterization trick (sampling noise from a standard Gaussian and scaling it) to inject stochasticity into the latent dynamics.
  3. Learned Observation Model: A discriminative function learns to update particle weights based on how well each particle's state explains the current input.
  4. Soft Resampling: To solve the differentiability problem, the authors use a "soft resampling" technique. Instead of hard selection, they resample from a mixture of the current particle distribution and a uniform distribution, allowing gradients to flow through the weights.
Architectural details of PF-LSTM and PF-GRU cells including soft-resampling.

Experimental Evaluation

The authors evaluated PF-RNNs on 13 different datasets, ranging from synthetic robot localization to real-world regression and classification tasks.

  • Synthetic Localization: In a 2D robot localization task in symmetric mazes, PF-RNNs demonstrated superior belief tracking. In the most difficult 27x27 maze, PF-LSTM achieved a Mean Square Error (MSE) of 2.86, compared to 4.48 for a standard LSTM with a similar parameter count.
  • Regression and Classification: On datasets like NASDAQ (stock index), AIR (air quality), and GAS (chemical sensing), PF-RNNs outperformed standard gated RNNs on 90% of the tested scenarios.

Key Insights

  • Parameter Efficiency: Increasing the number of particles ($K$) improves the model's ability to represent complex beliefs without increasing the number of trainable parameters. This makes the model more sample-efficient on smaller datasets.
  • Robustness to Ambiguity: Visualizations showed particles "spreading out" during high uncertainty (symmetric maze parts) and re-converging upon finding unique landmarks.
  • Superiority over Ensembles: A PF-RNN with $K$ particles performs significantly better than an ensemble of $K$ independent RNNs, validating the Bayesian update mechanism.

Conclusion

PF-RNNs bridge the gap between Bayesian state-space models and deep learning. By embedding a fully differentiable particle filter into the RNN structure, they provide a robust framework for modeling uncertainty in sequential data without sacrificing the ease of training via standard backpropagation.

Summary updated

BibTeX
@inproceedings{ma2020particle,
  author = {Xiao Ma and Péter Karkus and David Hsu and Wee Sun Lee},
  title = {{Particle Filter Recurrent Neural Networks}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i04.5952},
}
Figure