Gradient-free sampling method speeds up latent space tracking
Gradient-Free Sampling from Generative Models via Stochastic Bounded Extremum Seeking
Machine Learning
Summary
Sampling from complex computer models often requires knowing how the model's output changes with input, which can be slow or impossible for some models. This paper presents a new way to sample from such models without needing to calculate these changes directly, by using a special oscillating signal to drive the process. The authors show mathematically that their method approximates popular sampling techniques well, even for tricky models with sharp changes. While it's not faster for typical setups, it works best in hidden latent spaces when the model changes over time and is a black box.
What this means in practice
- •For machine learning engineers: Sample evolving latent representations in generative models when direct gradients are unavailable or expensive to compute.
- •For medical imaging developers: Track time-varying image data from limited projection measurements using latent-space sampling of energy-based image models.
Tested on one dataset.
Authors
Alexander Scheinker
Abstract
We introduce a sampling approach for energy- and score-based generative models that requires no gradient evaluations of the model. Replacing the drift term that would normally contain the score $\nabla_\mathbf{x} \log p_θ(\bf{x})$ with a high-frequency dithered cosine of the model's \textit{value}, $\sqrt{αω}\,\cos(ωt + k \log p_θ(\bf{x}))$, produces, in the high-frequency averaging limit, Langevin Markov chain Monte Carlo for energy-based models and the reverse-time SDE of score-based diffusion. We prove that trajectories of the dithered Itô SDE converge to those of the target SDE, driven by the same Brownian motion, uniformly on compact time intervals in probability, by an averaging argument that extends bounded extremum seeking (ES) to Itô processes, with an explicit $O(ω^{-1/2})$ mean-square rate under global bounds. The approach is not confined to smooth targets: it extends to $C^{1,1}$ energies with discontinuous curvature (without ellipticity requirement) and to Sobolev energies whose Hessians exist only off measure zero sets; for Lipschitz energies with gradient kinks the averaged limit remains well posed; the Krylov-Röckner integrability class is the boundary of provability. The approach provides a hard \textit{a priori} bound on the per-step update rate and applies to explicitly time-varying targets on finite horizons. Gradient-free pixel-space sampling is not competitive with well-tuned backpropagation-based samplers at practical evaluation budgets; the regime where the approach offers an advantage is latent-space sampling when the model is a black box and the target drifts in time. We demonstrate latent-space tracking for time-varying images on CelebA-HQ ($256{\times}256$) from limited 1D projection measurements and latent-space EBM sampling on CIFAR-10.