Inference-Time Alignment of Diffusion Models with Evolutionary Algorithms

Purvish Jajal, Nick John Eliopoulos, Benjamin Shiue-Hal Chou, George K. Thiruvathukal, James C. Davis, Yung-Hsiang Lu · DOI

Introduction

Diffusion models have revolutionized image generation, yet aligning their outputs with specific human preferences, safety constraints, or complex prompts remains a significant challenge. Traditional alignment techniques typically rely on expensive fine-tuning or gradient-based optimization. The latter, while effective, requires "white-box" access to the model's internal gradients and consumes substantial computational resources. This paper explores a "black-box" alternative: using evolutionary algorithms (EAs) at inference time to optimize latent noise vectors for higher reward scores.

Methodology: Evolutionary Search in Latent Space

The core proposal involves treating the diffusion process as a black box and searching the latent noise space ($z_T$) using EAs. Instead of a single random start, the system maintains a population of candidate noise vectors. Two primary search strategies were evaluated:

  1. Direct Noise Search: Evolving the initial noise vector directly.
  2. Noise Transformation Search: Evolving an affine transformation (rotation/scaling) applied to a base noise vector. This method ensures the noise remains within the "high-density shell" of the Gaussian distribution, preserving image quality.
Progression of image alignment and reward scores.

The researchers tested Genetic Algorithms (GAs) like CoSyNE, which excel at rapid short-term optimization, and Evolutionary Strategies (ES) like SNES and PGPE, which maintain better population diversity over longer horizons.

Key Results and Efficiency

The evolutionary approach demonstrates superior performance across several metrics compared to gradient-based baselines like DNO (Direct Noise Optimization).

Performance Gains

The method achieved 3–35% higher ImageReward scores on benchmarks like DrawBench and Open Image Preferences. By evolving the starting noise, the model can better satisfy complex compositional prompts that standard diffusion might ignore.

Alignment improvement for a 'Mad Max' prompt.

Computational Efficiency

One of the most striking findings is the efficiency of "blind" search. Because EAs do not require backpropagation through the diffusion chain, they are:

  • 72–80% faster than gradient-based methods.
  • 55–76% less memory-intensive, enabling alignment on consumer-grade hardware.

Discussion: Reward Hacking and Constraints

The study also highlights the phenomenon of "reward hacking." For instance, when optimizing for minimum JPEG file size, the PGPE algorithm generated empty, monochromatic images—a perfect score for the metric but a failure in utility. Furthermore, the authors emphasize the "Gaussian Shell Constraint": pushing noise vectors too far from the standard normal distribution leads to a collapse in image quality, a problem mitigated by their orthonormal transformation approach.

Conclusion

Inference-time alignment via evolutionary algorithms offers a powerful, efficient, and model-agnostic way to improve diffusion outputs. By bypassing the need for gradients, this approach democratizes high-quality alignment, making it accessible for a wider range of models and hardware configurations.

Summary updated

BibTeX
@misc{jajal2025inference,
  author = {Purvish Jajal and Nick John Eliopoulos and Benjamin Shiue-Hal Chou and George K. Thiruvathukal and James C. Davis and Yung-Hsiang Lu},
  title = {{Inference-Time Alignment of Diffusion Models with Evolutionary Algorithms}},
  year = {2025},
  eprint = {2506.00299},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.00299},
}
Figure