TLDR: A new research paper compares evolutionary optimization (sep-CMA-ES) with gradient-based optimization (Adam) for enhancing image generation in Stable Diffusion XL Turbo. The study found that sep-CMA-ES consistently outperforms Adam in improving image aesthetics and prompt alignment, offering a more efficient, gradient-free method for controlling deep generative models without expensive retraining. It also consumes less VRAM and explores the solution space more effectively.
Deep generative models, particularly diffusion architectures, have revolutionized image generation. However, precisely controlling their outputs to achieve specific goals without costly retraining remains a significant challenge. A promising approach to tackle this is Embedding Space Exploration, especially when combined with Evolutionary Algorithms (EAs).
A recent study from the University of Coimbra delves into this area, comparing an evolutionary optimization method called Separable Covariance Matrix Adaptation Evolution Strategy (sep-CMA-ES) against the widely used Adaptive Moment Estimation (Adam) algorithm. The focus was on optimizing the prompt embedding vector of Stable Diffusion XL Turbo, a popular text-to-image diffusion model.
The Core Idea: Optimizing Image Generation
The research explores how these two optimization methods perform when tasked with improving the quality and relevance of images generated by AI. Instead of retraining the entire generative model, which is computationally intensive, the study focuses on tweaking the ‘prompt embedding vector’ – a numerical representation of the text prompt that guides the image generation process. By optimizing this vector, the goal is to steer the AI towards producing better images.
Measuring Success: Aesthetics and Alignment
To evaluate the generated images, the researchers used a clever combination of two metrics: the LAION Aesthetic Predictor V2, which assesses the human-perceived visual appeal on a scale of 1 to 10, and CLIPScore, which measures how well an image aligns with its given text prompt. These two scores were combined into a weighted ‘fitness function,’ allowing for flexible trade-offs between making an image look good and ensuring it accurately reflects the prompt.
Key Findings: Evolutionary Optimization Takes the Lead
The experiments, conducted on a subset of the Parti Prompts (P2) dataset, revealed a clear winner: sep-CMA-ES consistently delivered superior improvements in both aesthetic and prompt alignment metrics compared to Adam. This held true across three different scenarios: optimizing solely for aesthetics, optimizing equally for aesthetics and alignment, and optimizing solely for alignment.
For instance, in the aesthetics-only scenario, sep-CMA-ES achieved a 39.2% improvement in fitness over the baseline, while Adam managed a 25.3% improvement. In the balanced scenario, sep-CMA-ES showed a 24.1% enhancement, attributed to significant increases in both aesthetic score and CLIPScore, far surpassing Adam’s 7.0% improvement. The evolutionary method also proved more effective in prompt-alignment-only optimization, with a 37.3% increase in fitness compared to Adam’s 15.7%.
Visually, sep-CMA-ES demonstrated a greater ability to explore diverse solutions, often adding more color, shades, lighting, and details to the original scenes, especially when optimizing for aesthetics. Adam, in contrast, tended to stay closer to the generative model’s default images.
The EIGO Engine and Efficiency
To facilitate this research, the team developed the Evolutionary Image Generation Optimization (EIGO) engine, which has been made publicly available on GitHub. The study also highlighted a significant advantage of sep-CMA-ES in terms of computational resources: it required less than half the VRAM (17.6 GB) compared to Adam (39.3 GB), primarily because Adam’s gradient calculations are more resource-intensive.
This research underscores that evolutionary methods offer an efficient, gradient-free approach to optimizing diffusion models, enhancing their controllability without the need for time-consuming fine-tuning or retraining. For more in-depth technical details, you can read the full research paper here: Evolutionary Optimization Trumps Adam Optimization on Embedding Space Exploration.
Also Read:
- Boosting Optimization Algorithms with Multi-modal AI: A New Approach to Solving Complex Problems
- Fine-Grained Insights into Personalized Image Generation
Looking Ahead
While sep-CMA-ES showed impressive results, the study also acknowledged limitations, such as the prolonged execution time for evolutionary methods compared to a single image generation. Future work aims to improve algorithmic efficiency through parallelization and explore other evolutionary algorithms or hybrid approaches. The researchers also plan to evolve the EIGO engine into a more modular framework, allowing users to choose from a wider range of evaluation metrics and generative models, and even incorporate human-in-the-loop evaluation for more complex prompts.


