Introduction
While diffusion models have demonstrated unprecedented capabilities in generating realistic images, steering them toward specific user preferences or "rewards"—such as a particular artistic style, facial attribute, or non-visual constraint like file size—remains a significant challenge.
Currently, the field relies on two primary approaches to align these models:
- Fine-tuning: Re-training the model using Reinforcement Learning (RL). This is computationally expensive and frequently leads to "reward over-optimization," where the model generates high-reward samples that lack visual diversity or appear unnatural.
- Inference-time Guidance: Keeping the base model frozen and nudging the generation process. Gradient-based methods require a differentiable reward function and heavy memory for backpropagation. Conversely, gradient-free methods (like standard "Best-of-N" sampling) are flexible but highly inefficient, often requiring hundreds of full image generations to yield a single optimal sample.
To bridge this gap, researchers introduce Controlled Denoising (CoDe), a gradient-free, inference-time guidance method. CoDe aligns diffusion models with specific rewards without the need for expensive fine-tuning or differentiable reward functions, achieving a superior balance between reward alignment, image quality, and computational efficiency.
Methodology: Blockwise Sampling and Tweedie's Formula
The core innovation of CoDe lies in its blockwise sampling strategy. Instead of generating $N$ full images and selecting the best one at the very end (Standard Best-of-N), or greedily picking the best sample at every single denoising step (Step-wise), CoDe divides the denoising trajectory into blocks of size $B$.
At each block, the model generates $N$ parallel "candidate" paths for the next $B$ steps. To evaluate which path is most promising before the image is fully denoised, CoDe leverages Tweedie’s formula. This mathematical property allows the model to estimate the final "clean" image ($\hat{x}_0$) from a noisy intermediate state. The reward function is then calculated on this estimated clean image, and the highest-scoring path is selected to continue to the next block.
Additionally, the authors introduce Noise Conditioning ($\eta$). For tasks where a reference image is provided (e.g., style transfer), the denoising process begins from a partially noised version of the reference rather than pure Gaussian noise. This parameter acts as a control knob, allowing users to balance how much the output resembles the reference image versus how strictly it adheres to the text prompt.
Experimental Setup
The researchers evaluated CoDe using Stable Diffusion v1.5 (trained on the LAION-400M dataset). The method was tested across a variety of specialized scenarios:
- Gaussian Mixture Models (GMM): A synthetic 2D case study used for theoretical validation.
- Image Generation Tasks: Style guidance, facial attribute alignment, stroke-based generation, and overall aesthetic quality improvement.
- Compressibility: A unique test utilizing a non-differentiable reward (JPEG file size) to demonstrate the unique advantages of gradient-free guidance.
Key Findings and Results
- The Efficiency of "Peeking": By utilizing Tweedie’s formula to "look ahead" at the potential final image, CoDe makes intelligent routing decisions mid-generation. This approach makes it 10–15x more efficient than standard Best-of-N sampling.
- The "Goldilocks" Block Size: The study reveals that blockwise control provides an optimal middle ground. Step-wise guidance ($B=1$) often causes a total collapse in image diversity due to reward over-optimization, while full-chain guidance ($B=T$) is computationally prohibitive.
- Handling the "Un-guideable": Because CoDe operates without gradients, it can optimize for non-differentiable rewards that traditional guidance methods cannot handle. For example, it successfully guided the model to produce highly "compressible" images (smaller JPEG sizes) without sacrificing visual semantics.
- Superior Trade-offs and Speed: In aesthetic and style tasks, CoDe achieved better text alignment (measured by T-CLIP) and lower divergence from the base model (measured by FID) compared to gradient-based methods like Universal Guidance (UG). Furthermore, CoDe proved to be roughly 4x faster than Universal Guidance while delivering higher-quality results.
Limitations and Future Directions
While highly efficient compared to standard Best-of-N sampling, CoDe still requires more compute than a standard single-pass generation because it must sample $N$ paths per block. Additionally, its performance is sensitive to hyperparameter tuning, requiring the right balance between the number of samples ($N$), block size ($B$), and noise ratio ($\eta$).
For future work, the authors suggest exploring adaptive control, where the block size $B$ or sample size $N$ dynamically shifts during generation. For instance, the model could use a higher number of samples in the early stages to establish the correct global structure, and fewer samples in the later stages when refining fine-grained details.
Summary updated