Introduction
Modern text-to-image (T2I) diffusion models like Stable Diffusion and SDXL have set new standards for image synthesis. However, they frequently encounter a "fidelity-diversity trade-off." To ensure an image strictly aligns with a text prompt (fidelity), practitioners often use strong guidance techniques like Classifier-Free Guidance. This often causes the model to "collapse" into a few predictable modes, producing repetitive and nearly identical images for the same prompt. Contrastive Noise Optimization (CNO) is a lightweight pre-processing method designed to solve this mode collapse problem by optimizing initial noise latents before the denoising process begins.
Methodology: Optimizing at the Source
The core innovation of CNO is its intervention at the very beginning of the generation pipeline. Instead of starting with purely random Gaussian noise, CNO runs a quick optimization loop on a batch of initial noise latents ($z_T$).
Key components of the method include:
- Tweedie Data Space: Optimization is performed in a space that represents the image's content rather than raw noise. Using Tweedie’s formula, the system projects the initial noise into a "one-step denoised" estimate of the final image.
- Contrastive InfoNCE Loss: This loss function applies two opposing forces: repulsion, which pushes different samples in the batch away from each other to maximize semantic diversity, and attraction, which pulls each sample toward its original version to preserve prompt fidelity.
- Computational Efficiency: By using adaptive average pooling and a stop-gradient operator, CNO avoids full backpropagation through the massive U-Net, adding only a negligible 5% computational overhead to standard sampling.
Key Insights
- Diversity as a Source Problem: The researchers found that shaping the initial distribution of noise is more effective than steering the model during denoising steps. By "pre-distributing" the noise, the model naturally explores different creative paths.
- Pareto Dominance: CNO does not merely shift the trade-off between quality and diversity; it pushes the entire Pareto frontier forward. It consistently achieves higher diversity and higher aesthetic scores (such as PickScore) than competing methods.
Key Results and Evaluation
CNO was evaluated using Stable Diffusion v1.5, SDXL, and Stable Diffusion 3 on prompts from the MS-COCO validation set. Evaluation metrics included CLIPScore for alignment and Vendi Score for diversity.
As shown in the comparison below, CNO consistently outperforms baselines like DDIM and CADS in producing semantically varied results for the same prompt.
Beyond visual diversity, CNO proved robust to hyperparameter choices and highly efficient. For example, on SD1.5, it increased batch generation time by only ~0.7 seconds compared to the standard DDIM sampler. Human preference metrics (PickScore and Image-Reward) further confirmed that CNO produces images that are both more varied and more visually appealing to users.
Conclusion
Contrastive Noise Optimization offers a robust, efficient, and model-agnostic solution to the diversity problem in diffusion models. By shifting the focus to the initial noise distribution, CNO enables high-fidelity generation without sacrificing the creative variety essential for many real-world applications. Future work may explore applying similar contrastive strategies to intermediate denoising steps to further enhance results for complex compositional prompts.
Summary updated