TL;DR
DiffRGD introduces a distribution-aware inference-time guidance framework for diffusion models that prevents sample degradation caused by "distributional drift." By constraining the guidance optimization to a spherical manifold derived from the latent Gaussian distribution and solving it via Riemannian Gradient Descent (RGD), DiffRGD achieves state-of-the-art results across image restoration and conditional generation tasks without requiring any network retraining or fine-tuning.
What Problem Does This Paper Address?
Diffusion models excel at generating high-quality images, but controlling their output typically requires expensive retraining or fine-tuning (e.g., training conditional models like ControlNet). To bypass this cost, researchers use inference-time guidance, which steers the generative process using a differentiable objective function (like a reconstruction loss or a style similarity metric) during sampling.
However, standard guidance methods (such as Diffusion Posterior Sampling, or DPS) inject gradients directly into the ambient space without considering the underlying structure of the diffusion process. Because each step of a diffusion model expects the latent variables to follow a specific isotropic Gaussian distribution, these unconstrained updates cause the latents to drift away from the true distribution. This "off-manifold" phenomenon accumulates errors over multiple sampling steps, ultimately introducing artifacts and degrading the final image quality.
Methods
The authors propose DiffRGD (Riemannian Gradient Descent for Diffusion Guidance) to explicitly preserve the latent Gaussian structure during optimization.
The core mathematical insight relies on the polar decomposition of an isotropic Gaussian. Any sample from a Gaussian distribution can be decoupled into a radial component ($r$, which follows a chi distribution) and a directional component ($u$, a unit vector uniformly distributed on a sphere).
Instead of performing unconstrained gradient descent, DiffRGD fixes the sampled radius $r$ at each timestep to construct a spherical manifold ($\mathcal{S}_{t,r}$) centered around the diffusion model's predicted mean ($\bm{\mu}_t$). The guidance task is then framed as a constrained optimization problem restricted entirely to this sphere.
To solve this efficiently, the authors leverage Riemannian Gradient Descent (RGD):
- Compute the Euclidean Gradient: Calculate the standard gradient of the guidance loss function.
- Project onto the Tangent Space: Project the Euclidean gradient onto the tangent space of the spherical manifold, removing the radial component.
- Retraction: Take a step along the tangent space and apply a retraction operator to map the updated latent variable precisely back onto the spherical manifold.
Because the optimization is confined to the sphere, the directional component is refined to satisfy the guidance objective while the radial statistics of the original Gaussian distribution remain perfectly intact.
Datasets
The framework was evaluated across several standard image datasets for different tasks:
- FFHQ ($256 \times 256$ and $1024 \times 1024$): Used for image restoration tasks including inpainting, super-resolution, and deblurring.
- ImageNet ($256 \times 256$): Used to validate inpainting, super-resolution, and image denoising performance.
- CelebA-HQ ($256 \times 256$): Used for conditional face generation tasks driven by segmentation maps, sketches, and FaceID embeddings.
- WikiArt: Used to source distinct style images for style-guided text-to-image generation.
Key Insights and Ideas
- Geometry-Aware Constraints: Treating the latent space as a curved manifold reflecting the time-dependent Gaussian distribution—rather than a flat Euclidean space—is crucial for maintaining sample fidelity.
- Decoupling Magnitude and Direction: Fixing the noise magnitude (radius) while optimizing the noise direction allows the model to satisfy external conditions without altering the statistical properties required by the pre-trained sampler.
- Plug-and-Play Integration: DiffRGD requires zero modifications to the underlying diffusion model weights, making it seamlessly compatible with popular foundation models like Stable Diffusion.
Key Results
DiffRGD was compared against several prominent inference-time guidance baselines, including DPS, MPGD, DSG, and ADMMDiff.
- Image Restoration: In 1,000-step DDIM sampling on FFHQ for inpainting, DiffRGD achieved a PSNR of 34.04 and an FID of 21.88, significantly outperforming the second-best method, ADMMDiff (PSNR: 32.38, FID: 29.52).
- Fewer Sampling Steps: When reducing the sampling trajectory to 100 steps, competing methods like DPS experienced severe performance drops. DiffRGD maintained robust performance, outperforming baselines in both Gaussian deblurring and super-resolution.
- Computational Efficiency: While slower than unconstrained methods due to its inner-loop optimization, DiffRGD achieved a 1.23× speedup in image restoration and a 2.8× speedup in conditional generation tasks compared to ADMMDiff, the leading mathematically constrained baseline.
Limitations and Future Work
- Dependence on Base Model Accuracy: Because the spherical manifold is centered on the model-predicted mean ($\bm{\mu}_t$), any inherent bias or poor prediction from the underlying diffusion model will propagate through the guidance steps.
- Inner-Loop Overhead: Performing multiple Riemannian optimization steps per diffusion timestep incurs higher computational costs than simple, unconstrained gradient methods.
- Extension to Non-Gaussian Samplers: The current geometric formulation relies strictly on the Gaussian transition structures of DDPM/DDIM frameworks, meaning it cannot be directly applied to deterministic flow matching models without a complete redesign of the manifold geometry.
- Future Directions: The authors suggest exploring alternating optimization schemes where the radius $r$ is jointly optimized alongside the direction, rather than being held fixed via a sampling heuristic.
Summary updated