Efficient Stochastic Optimisation via Sequential Monte Carlo

James Cuin, Davide Carbone, Yanbo Tang, O. Deniz Akyildiz

TL;DR

Optimising machine learning models whose gradients require expectations over intractable distributions usually forces a painful tradeoff between slow, nested MCMC loops and biased, lagging particle approximations. SOSMC (Stochastic Optimisation via Sequential Monte Carlo) solves this by maintaining a reweighted, evolving particle system across optimization steps, delivering unbiased-in-the-limit gradient estimates at a fraction of the computational cost of standard Markov chain methods.

What Problem Does This Paper Address?

In applications like training energy-based models (EBMs), maximum marginal likelihood estimation (MMLE), and reward fine-tuning of generative models, calculating the loss gradient $\nabla_\theta \ell(\theta)$ requires taking an expectation over a parameter-dependent distribution $\pi_\theta(x) \propto \exp(-U_\theta(x))$. Because the normalizing constant (partition function) of $\pi_\theta$ is intractable, calculating this gradient is notoriously difficult.

Existing solutions fall into two extremes:

  1. Nested-loop MCMC methods: Run multiple Markov chain Monte Carlo steps at every single optimization iteration to draw fresh samples from $\pi_\theta$. These are accurate but computationally prohibitive.
  2. Persistent single-loop heuristics (e.g., PCD, Implicit Diffusion): Maintain a persistent set of unweighted particles and update them by just one MCMC step per parameter update. This is fast, but because $\theta$ changes continuously, the particles lag behind the true target distribution, introducing severe non-equilibrium bias and slow convergence.

Methods

The authors introduce SOSMC (Stochastic Optimisation via Sequential Monte Carlo), a unified framework treating stochastic optimization through the lens of Feynman–Kac flows:

  • Sequential Importance Sampling: Instead of discarding previous particles or using unweighted persistent particles, SOSMC propagates particles across optimization iterations using a forward transition kernel $K_k$ and corrects for the distribution shift from $\pi_{\theta_{k-1}}$ to $\pi_{\theta_k}$ via incremental importance weights $G_k$.
  • Flexible Kernels: The framework generalizes beyond the standard Unadjusted Langevin Algorithm (ULA). Users can plug in reversible, Metropolis-adjusted kernels—such as MALA, Random-Walk Metropolis (RWM), or Hamiltonian Monte Carlo (HMC)—as well as proximal Moreau–Yosida kernels for non-differentiable potentials.
  • Resampling & Adaptive Steps: When the Effective Sample Size (ESS) drops below a threshold $\tau N$, particles are resampled to eliminate weight degeneracy. The authors also show the $\chi^2$-divergence between successive targets scales as $\mathcal{O}(\gamma^2 \|\nabla \ell\|^2)$, motivating an adaptive step-size rule that tunes $\gamma_k$ dynamically based on ESS.
  • Autograd Surrogate Losses: Because naive automatic differentiation through sampling trajectories yields incorrect path-wise gradients, the authors formulate scalar surrogate losses with stopgrad operations that reconstruct exact score-function covariance gradients directly through standard autodiff libraries.
       [ θ_{k-1} ] --------------------------> [ θ_k ]
            |                                     ^
            v                                     | (Compute weighted
     Propagate Particles                          |  gradient estimate)
     X_{k-1} ~> X_k via K_k                       |
            |                                     |
            v                                     |
     Update & Normalize Weights ------------------+
     W_k = W_{k-1} * G_k(X_{k-1}, X_k)
            |
    (If ESS < τN: Resample)

Datasets

The authors evaluated SOSMC across multiple synthetic and real-world benchmarks:

  • 2D Gaussian Mixture Landscape: Analytically tractable mixture potentials ($V_{\text{dual}}, V_{\text{sparse}}, V_{\text{tight}}$) paired with non-differentiable or discontinuous rewards ($R_{\text{smooth}}, R_{\text{hard}}, R_{\text{multi}}, R_{\text{tight}}$).
  • 2D Synthetic EBM Benchmarks: Standard planar datasets—Two Moons, Circles, and Blobs—with half-plane indicator rewards ($R_{\text{lower}}, R_{\text{upper}}, R_{\text{left}}, R_{\text{right}}$).
  • MNIST: A convolutional EBM pre-trained on MNIST digits, fine-tuned under image-space rewards (brightness, darkness, and vertical mass distribution).
  • Bayesian Image Deblurring (MMLE): Inverse problem setups on $292 \times 119$ and $292 \times 150$ images (Acoustic Guitar, Flower) blurred under local averaging operators and corrupted by Gaussian noise, regularized with non-differentiable Total Variation (TV) priors.

Key Insights and Ideas

  • Importance weights fix the non-equilibrium lag: By weighting particles by the ratio of target densities and proposal transitions, SOSMC accounts for parameter movement without having to run Langevin chains to stationarity at every step.
  • Metropolis correction prevents mode collapse: In challenging multi-modal landscapes with tight reward regions ($V_{\text{tight}}$), uncorrected Langevin dynamics often fail to transition between modes. SOSMC equipped with MALA or HMC kernels maintains ergodicity and reliably finds isolated reward modes.
  • Weighted particles track expectations during training: In single-loop methods like Implicit Diffusion (ImpDiff), the unweighted particle reward is a poor proxy for the true expected reward under the evolving model. Weighted SOSMC particle rewards accurately track the ground-truth expected reward throughout training, avoiding costly offline evaluation chains.

Key Results

  • Langevin Reward Tuning: Under tight multimodal setups ($V_{\text{tight}}, R_{\text{tight}}$), SOSMC variants with MALA/HMC achieved terminal rewards of $\approx \mathbf{0.399}$ compared to $\mathbf{0.014}$ for ImpDiff and $\mathbf{0.000}$ for SOUL (which completely failed to explore the mode).
  • EBM 2D Tuning: Under identical wall-clock runtime budgets, SOSMC-ULA consistently reached lower loss contours in fewer iterations than ImpDiff (e.g., reaching lower KL-divergence vs. fresh reward frontiers).
  • Bayesian Image Deblurring: SOSMC-MYULA significantly outperformed the Moreau–Yosida Particle Gradient Descent (MYPGD) baseline across all setups:
  • Setup A (Guitar): MSE dropped from $312.71 \to \mathbf{215.47}$; SSIM increased from $0.74 \to \mathbf{0.80}$.
  • Setup B (Flower): MSE dropped from $220.42 \to \mathbf{136.63}$; SSIM increased from $0.75 \to \mathbf{0.81}$.
  • Setup C (Severe Blur Guitar): MSE dropped from $1520.36 \to \mathbf{1030.20}$; SSIM nearly doubled from $0.22 \to \mathbf{0.41}$.

Limitations and Future Work

  • Theoretical Guarantees for Finite Particles: The formal convergence analysis assumes idealized, exact expectation calculations. A fully non-asymptotic analysis merging interacting particle system error bounds ($\mathcal{O}(1/N)$ bias/MSE) with biased stochastic gradient descent remains open.
  • Scaling to High-Dimensional Generation: While demonstrated on convolutional EBMs on MNIST and image inverse problems, scaling SOSMC to large-scale diffusion models or modern high-resolution EBMs will require handling particle degeneracy in higher-dimensional spaces.
  • Accelerated Optimizers: Integrating SOSMC gradient estimators into accelerated/momentum-based stochastic optimizers alongside adaptive ESS schemes is an indicated next step.

Summary updated

BibTeX
@inproceedings{cuin2026efficient,
  author = {James Cuin and Davide Carbone and Yanbo Tang and O. Deniz Akyildiz},
  title = {{Efficient Stochastic Optimisation via Sequential Monte Carlo}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=hCIBCAS1Hi},
}
Figure