Introduction
Diffusion models have established themselves as the state-of-the-art for generative tasks across multiple modalities, from high-fidelity image synthesis to discrete text generation. However, ensuring these models align with specific user preferences—such as adhering to complex prompts, maintaining aesthetic quality, or avoiding toxic content—remains a significant hurdle. Traditional alignment methods typically rely on computationally expensive fine-tuning or restrictive gradient-based guidance.
This paper introduces Feynman-Kac (FK) steering, a universal, inference-time framework designed to guide diffusion models toward desired attributes without requiring any model retraining. By treating the denoising process as a particle system and applying rare-event simulation techniques, FK steering allows smaller, base models to outperform larger, fine-tuned counterparts through efficient inference-time compute scaling.
The Alignment Challenge
Currently, practitioners generally rely on three strategies to align diffusion models, each with distinct drawbacks:
- Fine-tuning (RLHF/DPO): While effective, fine-tuning is resource-intensive and often leads to "mode collapse," where the model loses its original diversity to maximize a specific reward.
- Gradient Guidance: This method is efficient but requires the reward function to be differentiable and the data to be continuous. This makes it unsuitable for discrete modalities like text or for use with black-box reward models.
- Best-of-N Sampling: A simple approach where $N$ samples are generated and the best is selected. This is highly inefficient, as compute is wasted on low-quality trajectories that could have been identified and discarded early in the process.
FK steering addresses these limitations by providing a gradient-free, modality-agnostic framework that is significantly more efficient than Best-of-N sampling.
Feynman-Kac Diffusion Steering
The core of the proposed method is the Feynman-Kac Interacting Particle System. Rather than generating a single sample, the algorithm maintains $k$ parallel generation paths, referred to as "particles." The process proceeds through a sequence of intermediate denoising steps, punctuated by a "Score-Resample-Continue" loop:
- Score: At predefined intervals, the algorithm pauses to evaluate the current state of each particle using a "potential" function. This potential is derived from an intermediate reward—for instance, by predicting the final output from the current noisy state and scoring it with a reward model.
- Resample: Particles with high potential scores are cloned, while those with low scores are terminated. This ensures that the computational budget is focused on the most promising trajectories.
- Continue: The surviving (and cloned) particles resume the denoising process until the next evaluation point.
This framework is highly flexible. The authors demonstrate that the choice of "potential" function—such as scoring based on the maximum reward achieved so far versus the incremental improvement between steps—allows users to trade off between absolute reward maximization and sample diversity.
Experimental Results
Image Synthesis: Scaling Beats Model Size
In text-to-image benchmarks (GenEval, ImageReward, HPS), FK steering demonstrated remarkable efficiency. A base Stable Diffusion v2.1 model (0.8B parameters) equipped with FK steering ($k=4$) outperformed the much larger SDXL-DPO (2.6B parameters), a model specifically fine-tuned for human preferences. Notably, the FK-steered model achieved these superior results using fewer total FLOPs and less wall-clock time (9.1s vs. 11.5s in parallel) than the larger fine-tuned model.
Discrete Text Generation
Because FK steering does not require gradients, it is uniquely suited for discrete text diffusion models. Evaluations on the CoLA (linguistic acceptability) and OpenWebText datasets showed that FK steering consistently improved perplexity and adherence to linguistic constraints compared to standard sampling and Best-of-N approaches.
Red-Teaming and Rare-Event Simulation
To test the framework's ability to steer toward rare attributes, the authors applied FK steering to a toxicity red-teaming task. Starting with a text model that had a baseline toxicity rate of only 0.3%, FK steering ($k=8$) successfully steered the generation to reach a 64.7% toxicity rate. This significantly outperformed standard gradient guidance methods, highlighting its utility in safety testing and stress-testing generative systems.
Discussion and Future Work
FK steering represents a shift toward inference-time scaling laws, suggesting that compute spent during the generation process can be as valuable as compute spent during training. By pruning "doomed" trajectories early, the method achieves a high degree of control without the risks of mode collapse associated with fine-tuning.
However, the method's effectiveness remains tied to the quality of the reward model; a flawed reward function can lead to "reward hacking," where the model generates samples that score well but do not meet the actual underlying goal. Future research directions include developing adaptive compute allocation—where the number of particles $k$ changes dynamically based on the difficulty of the prompt—and extending the framework to complex domains like protein design and molecular generation.
Summary updated