CCS: Controllable and Constrained Sampling with Diffusion Models via Initial Noise Perturbation

Bowen Song, Zecheng Zhang, Zhaoxu Luo, Jason Hu, Wei Yuan, Jing Jia, Zhengxu Tang, Guanyang Wang, Liyue Shen

Abstract

While diffusion models have revolutionized high-quality image synthesis, achieving precise control over the statistical properties of generated distributions remains a significant challenge. We introduce Controllable and Constrained Sampling (CCS), a training-free framework designed to generate a distribution of samples centered around a target image with exact diversity constraints. Our approach is founded on the discovery of a surprisingly linear relationship between perturbations in the initial noise space and the resulting changes in pixel space. By employing Spherical Linear Interpolation (Slerp) and an automated controller tuning mechanism, CCS maintains high perceptual quality and structural integrity while meeting user-specified Mean Squared Error (MSE) targets. We validate CCS across diverse benchmarks, including FFHQ, CIFAR-10, and satellite imagery, demonstrating its superiority over existing posterior sampling methods.

Introduction

Controllable generation in diffusion models typically focuses on per-sample constraints, such as ensuring a generated face possesses specific attributes. However, emerging applications in fields like differential privacy, data augmentation, and scientific simulation require control over the entire distribution of samples. For instance, a researcher might need to generate 100 variations of a specific image that are, on average, a precise distance (MSE) from the original.

Existing methods often struggle with this task, frequently resulting in blurry outputs, degraded image quality as diversity increases, or requiring computationally expensive retraining. CCS addresses these gaps by leveraging the underlying geometry of the diffusion ODE sampling process to provide precise, training-free control.

The Linearity Property

The theoretical cornerstone of CCS is the discovery of a linearity property within the diffusion sampling trajectory. The authors demonstrate that the change in the final output image is approximately a linear function of the perturbation applied to the initial noise vector.

Despite the highly non-linear nature of the neural networks (UNets) driving diffusion models, the response of the output to initial noise perturbations exhibits remarkable linearity, with $R^2$ values exceeding 0.98 in pixel-based models. This observation simplifies a complex high-dimensional control problem into a predictable linear relationship, allowing for precise manipulation of the output distribution.

Methodology

CCS Sampling and Geometry

High-dimensional Gaussian noise vectors typically concentrate on a thin hypersphere (the "Gaussian shell"). Standard additive noise often pushes the starting vector off this shell, leading to out-of-distribution states that result in blurry, low-quality images. To preserve image quality, CCS utilizes Spherical Linear Interpolation (Slerp). By interpolating between the original noise and a random perturbation on the hypersphere, CCS ensures the model always begins the sampling process from a "natural" noise state.

Controller Tuning (CT)

Because the relationship between the perturbation scale ($C_0$) and the resulting MSE is linear and predictable, the authors implement a Controller Tuning mechanism. This uses a simple binary search algorithm to automatically identify the exact $C_0$ required to satisfy a user-specified diversity or MSE target, removing the need for manual trial-and-error.

Partial-Inversion CCS (P-CCS)

For complex Latent Diffusion Models (LDMs) like Stable Diffusion, the authors introduce Partial-Inversion CCS. This variant initiates the sampling process from an intermediate timestep rather than pure noise. This approach better accommodates the complexities of the VAE latent space and the non-linearities introduced by Classifier-Free Guidance (CFG).

Experimental Results

The effectiveness of CCS was evaluated across several benchmarks, including high-resolution human faces (FFHQ, CelebA-HQ), general objects (CIFAR-10), and satellite imagery (fMoW).

  • Precision and Accuracy: CCS achieved target MSE values with significantly higher accuracy than baseline methods such as Diffusion Posterior Sampling (DPS) and Iterative Latent Variable Refinement (ILVR).
  • Perceptual Quality: On the FFHQ dataset, CCS maintained superior PSNR and higher perceptual quality scores (measured via MUSIQ and CLIP-IQA) compared to other methods at equivalent diversity levels.
  • Robustness in Latent Space: While the linearity is slightly less perfect in LDMs ($R^2 \approx 0.95$) due to the non-linear VAE decoder, CCS remains highly effective for semantic editing and structural variation tasks.

Discussion and Limitations

CCS represents a significant step toward predictable diffusion sampling. However, certain limitations remain. The non-linearity of the VAE in latent models acts as a minor bottleneck for precision; future iterations may incorporate the VAE's Hessian to further refine control. Additionally, "full" inversion remains mathematically challenging in high-CFG settings, though P-CCS provides a robust practical workaround.

Beyond MSE, the authors suggest that the CCS framework could be extended to more complex statistical constraints, potentially allowing for the control of specific semantic features or higher-order moments within the generated distribution.

Summary updated

BibTeX
@inproceedings{song2025ccs,
  author = {Bowen Song and Zecheng Zhang and Zhaoxu Luo and Jason Hu and Wei Yuan and Jing Jia and Zhengxu Tang and Guanyang Wang and Liyue Shen},
  title = {{CCS: Controllable and Constrained Sampling with Diffusion Models via Initial Noise Perturbation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=64lk7JQAU1},
}
Figure