[Paper Review] Best Prompts for Text-to-Image Models and How to Find Them
This paper proposes a human-in-the-loop genetic algorithm to discover optimal prompt keywords for text-to-image models like Stable Diffusion, using pairwise crowdsourced comparisons to rank image quality. It identifies a custom keyword set that significantly outperforms both no keywords and the 15 most popular keywords, achieving an average rank of 43.60 on training data and 46.00 on validation data.
Recent progress in generative models, especially in text-guided diffusion models, has enabled the production of aesthetically-pleasing imagery resembling the works of professional human artists. However, one has to carefully compose the textual description, called the prompt, and augment it with a set of clarifying keywords. Since aesthetics are challenging to evaluate computationally, human feedback is needed to determine the optimal prompt formulation and keyword combination. In this paper, we present a human-in-the-loop approach to learning the most useful combination of prompt keywords using a genetic algorithm. We also show how such an approach can improve the aesthetic appeal of images depicting the same descriptions.
Motivation & Objective
- To address the lack of systematic evaluation for prompt keywords in text-to-image generation.
- To identify the most effective combination of keywords that enhance image aesthetics beyond common practices.
- To develop a scalable, human-in-the-loop method for evaluating and optimizing prompt templates.
- To release reproducible data and code to enable community-driven improvement of prompt engineering.
Proposed method
- A genetic algorithm iteratively evolves keyword sets by selecting high-ranking candidates, performing crossover and mutation, and re-evaluating them.
- For each image description, four images are generated per keyword set to ensure consistency in evaluation.
- Pairwise comparisons are conducted via crowdsourcing, where annotators select the more aesthetically pleasing image without knowing the keyword sets used.
- Bradley-Terry probabilistic ranking is applied to aggregate pairwise comparisons into a global ranking of keyword sets per description.
- Average ranks across descriptions are computed to quantify the overall aesthetic quality of each keyword set.
- A random forest regressor is trained on keyword sets and their ranks to identify the most influential keywords.
Experimental results
Research questions
- RQ1Which combination of prompt keywords produces the most aesthetically pleasing images in text-to-image generation?
- RQ2How does the performance of community-popular keywords compare to systematically optimized keyword sets?
- RQ3Can a genetic algorithm guided by human preference effectively discover superior prompt templates?
- RQ4What are the most influential keywords in improving image quality, and how do they differ from widely used ones?
Key findings
- The proposed method discovered a keyword set that achieved an average rank of 43.60 on training data and 46.00 on validation data, significantly outperforming the 'No Keywords' baseline.
- The best-performing keyword set includes: cinematic, colorful background, concept art, dramatic lighting, high detail, highly detailed, hyper realistic, intricate, intricate sharp details, octane render, smooth, studio lighting, trending on artstation.
- The most important keyword identified by the random forest model was 'colorful background', which is not among the most widely used keywords.
- The genetic algorithm improved performance over the 15 most popular keywords, which scored 14.25 on average in training and 12.50 on validation.
- The method demonstrated generalization, with strong performance on the held-out validation set, though with higher noise due to smaller sample size.
- The study confirms that popular keywords like 'trending on artstation' are not necessarily the most effective, and that systematic optimization yields better results.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.