Introduction
Generative models such as GANs, VAEs, and Normalizing Flows have revolutionized our ability to create high-fidelity data. However, a persistent challenge remains: guiding these pre-trained models to generate samples that satisfy specific constraints or maximize a reward function—a process known as posterior inference. Traditional methods like Markov Chain Monte Carlo (MCMC) are often too slow for practical use, while fine-tuning approaches frequently require differentiable rewards and specific model architectures.
This paper introduces Outsourced Diffusion Sampling, a novel framework that performs posterior inference by training a diffusion model to sample from the target distribution within the generative model's latent noise space rather than the high-dimensional data space.
Methodology
The core innovation of Outsourced Diffusion Sampling lies in treating any generative model as a deterministic mapping $x = f(z)$, where $z$ is an exogenous Gaussian noise variable. Instead of sampling the complex posterior $p(x|y)$ directly in pixel or data space, the authors "pull back" the posterior into the noise space $z$.
To learn this posterior distribution without normalized density labels, the authors employ a diffusion sampler trained via Trajectory Balance (TB). TB is an off-policy reinforcement learning objective that allows the model to learn from unnormalized densities (the product of the prior and the reward score). This approach is gradient-free with respect to the reward function, making it compatible with black-box constraints.
Key Insights
- Latent Space Smoothness: Complex, multimodal distributions in the data space often correspond to smoother, more manageable distributions in the Gaussian noise space. This makes the noise space an ideal target for diffusion-based sampling.
- Model Agnosticism: By treating the generator as a black box $f(z)$, the method works across diverse architectures, including GANs, VAEs, and Diffusion models, without requiring architectural modifications.
- Efficiency: The method avoids the slow iterations of MCMC and the heavy memory requirements of backpropagating through large models, as it only requires the scalar value of the reward function.
Experimental Results
The authors validated their approach across several domains:
- Image Generation (CIFAR-10 & FFHQ): Outsourced diffusion outperformed Hamiltonian Monte Carlo (HMC) in both sample quality (FID) and reward alignment. It successfully navigated latent spaces where MCMC methods failed.
- Protein Engineering: The method effectively generated diverse protein structures targeting specific secondary motifs ($\beta$-sheets), even when using non-differentiable structural metrics.
- RLHF for Stable Diffusion 3: Fine-tuning SD3 with Outsourced Diffusion Sampling significantly improved ImageReward scores (from 0.79 to 1.27), surpassing standard Classifier-Free Guidance.
- Inference Speed: The trained diffusion sampler can be distilled into a single-step generator, enabling near-instantaneous posterior sampling with minimal quality loss.
Conclusion
Outsourced Diffusion Sampling provides a fast, flexible, and gradient-free path for posterior inference in generative models. By shifting the sampling problem from the complex data space to the structured latent noise space, it enables efficient alignment and constraint satisfaction across a wide array of generative tasks and architectures.
Summary updated