Learning proposals for sequential importance samplers using reinforced variational inference

Zafarali Ahmed, Arjun Karuvally, Doina Precup, Simon Gravel

In fields ranging from epidemiology to finance, researchers frequently rely on stochastic processes to model complex data. A persistent challenge in this domain is the "bridging" problem: if you only observe the final state of a process—such as the total number of infected individuals at the end of an outbreak—how can you accurately infer the starting conditions and the hidden trajectory it took to get there?

Traditionally, this is solved using Sequential Importance Sampling. However, this method requires a "proposal distribution," which is essentially an educated guess of the trajectory's shape. If this guess is poor, the sampler becomes highly inefficient. Historically, these proposal distributions have been painstakingly handcrafted by domain experts using specialized heuristics.

This paper introduces a novel approach to automate this process by bridging approximate inference and reinforcement learning (RL). By framing the search for a proposal distribution as a policy optimization problem, the authors demonstrate that off-the-shelf RL algorithms can effectively learn these heuristics from scratch.

The VI-RL Bridge: Methods and Mechanics

The core innovation of this work is Reinforced Variational Inference (RVI). The authors establish a mathematical mapping between two seemingly distinct fields: Variational Inference (VI) and Reinforcement Learning (RL).

In Variational Inference, the goal is to approximate a complex probability distribution by minimizing the Kullback-Leibler (KL) divergence, which is equivalent to maximizing the Evidence Lower Bound (ELBO). The researchers show that this ELBO objective can be elegantly rewritten as an RL problem:

  • The State: The current position of the particle or process in the trajectory.
  • The Action: The choice of the next step, moving backward in time from the final observation toward the start.
  • The Reward: The log-ratio of the true model's transition probability to the proposal's probability.

By treating the log-likelihood ratio as a natural reward signal, the authors utilize the REINFORCE algorithm and Generalized Advantage Estimation (GAE) to train a neural network. This network acts as a "policy" that proposes trajectories highly likely to have caused the observed data.

Automatic Heuristics and Experimental Insights

To validate RVI, the authors utilized standard synthetic environments based on 1D and 2D Random Walks. While simple, these environments allow for precise error measurement because the true posterior can be calculated analytically.

One of the most compelling findings is the model's ability to learn "automatic heuristics." The learned proposals successfully adapt to push particles toward the valid starting window. For instance, if the final observation is far from the origin, the learned policy heavily skews the trajectory back toward the valid starting area, perfectly mimicking the intuition a human expert would encode into a handcrafted proposal.

Comparison of handcrafted proposals versus learned RVI proposals across different end points.

Key Results and Performance

The RVI approach demonstrates strong competitive performance, particularly for common observations near the center of the distribution.

  • Competitive with Experts: The KL-based RVI method (VI-KL) performed on par with ISSoft, a highly optimized, handcrafted importance sampler.
  • Superior to Naive Approaches: RVI significantly outperformed naive Monte Carlo (MC) methods. As the distance between the starting window and the end point increases, naive MC fails completely, whereas RVI maintains its robustness.
  • Objective Function Trade-offs: The authors also experimented with minimizing the $\chi^2$ divergence instead of KL. While theoretically superior for reducing variance, the $\chi^2$ objective creates a "sparse reward" environment where the RL agent only receives feedback at the very end of a trajectory. Consequently, it performed poorly in practice compared to the KL objective.
Performance comparison (KL divergence) of RVI methods against handcrafted (ISSoft) and naive Monte Carlo (MC) baselines across varying end points.

Limitations and Future Directions

While RVI presents a significant step forward in automating inference, the authors note several limitations and areas for future work:

  1. The Rare Observation Trap: The method struggles when the observed data is an extreme outlier. In RL terms, this represents a severe exploration problem: if the agent never accidentally stumbles upon a valid path to the start, it receives no reward and cannot learn.
  2. The Fine-Tuning Paradox: Surprisingly, taking a model pre-trained on a variety of end-points and fine-tuning it on a specific one actually decreased performance. This suggests that the KL divergence objective might not perfectly align with downstream evaluation metrics.
  3. Scaling Complexity: Successfully applying this method to complex, high-dimensional real-world biological or physical models will require more robust gradient estimators to handle increased variance and better exploration strategies (like reward shaping) to navigate rare events.

Ultimately, Reinforced Variational Inference proves that the decades of optimization tricks developed for Reinforcement Learning can be powerfully repurposed to solve fundamental problems in statistical inference.

Summary updated

BibTeX
@inproceedings{ahmed2019learning,
  author = {Zafarali Ahmed and Arjun Karuvally and Doina Precup and Simon Gravel},
  title = {{Learning proposals for sequential importance samplers using reinforced variational inference}},
  booktitle = {DeepRLStructPred @ ICLR},
  year = {2019},
}
Figure