# Differentiable Particle Filtering without Modifying the Forward Pass

arXiv: https://arxiv.org/abs/2106.10314 · HTML: https://mlsanity.com/paper/2106.10314/

## Key facts

- Cited by 18 papers in the map (data through 14 Oct 2026).
- Builds on 23 of its 51 references that are in the map.
- First posted on arXiv 18 Jun 2021.

## Builds on (most cited first, 23 of 23)

- [PyTorch: An Imperative Style, High-Performance Deep Learning Library](https://mlsanity.com/paper/1912.01703/) (2019)
- [The Concrete Distribution: A Continuous Relaxation of Discrete Random Variables](https://mlsanity.com/paper/1611.00712/) (2016)
- [Automatic differentiation in machine learning: a survey](https://mlsanity.com/paper/1502.05767/) (2015)
- [Importance Weighted Autoencoders](https://mlsanity.com/paper/1509.00519/) (2015)
- [Black Box Variational Inference](https://mlsanity.com/paper/1401.0118/) (2013)
- [INTERACTION Dataset: An INTERnational, Adversarial and Cooperative moTION Dataset in Interactive Driving Scenarios with Semantic Maps](https://mlsanity.com/paper/1910.03088/) (2019)
- [Deep Variational Reinforcement Learning for POMDPs](https://mlsanity.com/paper/1806.02426/) (2018)
- [Gradient Estimation Using Stochastic Computation Graphs](https://mlsanity.com/paper/1506.05254/) (2015)
- [Variational Sequential Monte Carlo](https://mlsanity.com/paper/1705.11140/) (2017)
- [Filtering Variational Objectives](https://mlsanity.com/paper/1705.09279/) (2017)
- [Tighter Variational Bounds are Not Necessarily Better](https://mlsanity.com/paper/1802.04537/) (2018)
- [Auto-Encoding Sequential Monte Carlo](https://mlsanity.com/paper/1705.10306/) (2017)
- [Particle Filter Networks with Application to Visual Localization](https://mlsanity.com/paper/1805.08975/) (2018)
- [Differentiable Particle Filters: End-to-End Learning with Algorithmic Priors](https://mlsanity.com/paper/1805.11122/) (2018)
- [Differentiable Particle Filtering via Entropy-Regularized Optimal Transport](https://mlsanity.com/paper/2102.07850/) (2021)
- [DiCE: The Infinitely Differentiable Monte-Carlo Estimator](https://mlsanity.com/paper/1802.05098/) (2018)
- [Pathwise Derivatives Beyond the Reparameterization Trick](https://mlsanity.com/paper/1806.01851/) (2018)
- [Nested Sequential Monte Carlo Methods](https://mlsanity.com/paper/1502.02536/) (2015)
- [Towards Differentiable Resampling](https://mlsanity.com/paper/2004.11938/) (2020)
- [Stochastic Backpropagation through Mixture Density Distributions](https://mlsanity.com/paper/1607.05690/) (2016)
- [Loaded DiCE: Trading off Bias and Variance in Any-Order Score Function Estimators for Reinforcement Learning](https://mlsanity.com/paper/1909.10549/) (2019)
- [Parallel resampling in the particle filter](https://mlsanity.com/paper/1301.4019/) (2013)
- [Revisiting Reweighted Wake-Sleep for Models with Stochastic Control Flow](https://mlsanity.com/paper/1805.10469/) (2018)

## Built on by (most cited first, 18 of 18)

- [Automatic Differentiation of Programs with Discrete Randomness](https://mlsanity.com/paper/2210.08572/) (2022)
- [Normalizing Flow-based Differentiable Particle Filters](https://mlsanity.com/paper/2403.01499/) (2024)
- [Efficient Learning of the Parameters of Non-Linear Models using Differentiable Resampling in Particle Filters](https://mlsanity.com/paper/2111.01409/) (2021)
- [Sequential Monte Carlo for Inclusive KL Minimization in Amortized Variational Inference](https://mlsanity.com/paper/2403.10610/) (2024)
- [Enhanced SMC2: Leveraging Gradient Information from Differentiable Particle Filters Within Langevin Proposals](https://mlsanity.com/paper/2407.17296/) (2024)
- [Learning to be Smooth: An End-to-End Differentiable Particle Smoother](https://mlsanity.com/paper/2502.10546/) (2025)
- [Particle-Based Score Estimation for State Space Model Learning in Autonomous Driving](https://mlsanity.com/paper/2212.06968/) (2022)
- [Differentiable and Stable Long-Range Tracking of Multiple Posterior Modes](https://mlsanity.com/paper/2404.08789/) (2024)
- [Deep Variational Sequential Monte Carlo for High-Dimensional Observations](https://mlsanity.com/paper/2501.05982/) (2025)
- [DiffPF: Differentiable Particle Filtering with Generative Sampling via Conditional Diffusion Models](https://mlsanity.com/paper/2507.15716/) (2025)
- [PyDPF: A Python Package for Differentiable Particle Filtering](https://mlsanity.com/paper/2510.25693/) (2025)
- [Diffusion differentiable resampling](https://mlsanity.com/paper/2512.10401/) (2025)
- [Auto-differentiable data assimilation: Co-learning of states, dynamics, and filtering algorithms](https://mlsanity.com/paper/2603.20891/) (2026)
- [Differentiable Particle Filtering using Optimal Placement Resampling](https://mlsanity.com/paper/2402.16639/) (2024)
- [Accelerated Inference for Partially Observed Markov Processes using Automatic Differentiation](https://mlsanity.com/paper/2407.03085/) (2024)
- [Learning Flock: Enhancing Sets of Particles for Multi~Sub-State Particle Filtering with Neural Augmentation](https://mlsanity.com/paper/2408.11348/) (2024)
- [Learning state and proposal dynamics in state-space models using differentiable particle filters and neural networks](https://mlsanity.com/paper/2411.15638/) (2024)
- [Efficient Learning of Deep State Space Models via Importance Smoothing](https://mlsanity.com/paper/2605.21108/) (2026)

## Abstract (arXiv)

Particle filters are not compatible with automatic differentiation due to the presence of discrete resampling steps. While known estimators for the score function, based on Fisher's identity, can be computed using particle filters, up to this point they required manual implementation. In this paper we show that such estimators can be computed using automatic differentiation, after introducing a simple correction to the particle weights. This correction utilizes the stop-gradient operator and does not modify the particle filter operation on the forward pass, while also being cheap and easy to compute. Surprisingly, with the same correction automatic differentiation also produces good estimators for gradients of expectations under the posterior. We can therefore regard our method as a general recipe for making particle filters differentiable. We additionally show that it produces desired estimators for second-order derivatives and how to extend it to further reduce variance at the expense of additional computation.
