Introduction
Text-to-image (T2I) diffusion models have revolutionized digital art, yet they remain notoriously sensitive to the specific phrasing of input prompts. Achieving high-quality results often requires "prompt engineering"—a labor-intensive process of trial and error where users add "magic" modifiers and manually adjust word weights. This paper introduces Prompt Auto-Editing (PAE), a framework that automates this process by optimizing not just the vocabulary of a prompt, but also the temporal and quantitative influence of each token.
The Challenge of Granular Control
Existing automated prompt optimizers typically focus on rephrasing or appending keywords. However, they lack control over the dynamics of the diffusion process. Diffusion models generate images over multiple denoising steps; a word's influence should ideally vary depending on whether the model is establishing global structure or refining fine textures. PAE addresses this by introducing the Dynamic Fine-control Prompt (DF-Prompt), represented as a set of triples: $\langle \text{token}, \text{effect range}, \text{weight} \rangle$.
Methodology: Prompt Auto-Editing (PAE)
The PAE framework operates in two distinct stages to transform simple text into optimized DF-Prompts:
- Supervised Fine-tuning (SFT): The system first learns to expand short "plain" prompts with relevant modifiers. The authors curated a dataset of 450,000 prompts from Lexica.art and DiffusionDB, filtering for high aesthetic and semantic quality. A GPT-2 model was fine-tuned on this data to predict effective keyword additions.
- Online Reinforcement Learning (RL): To move beyond simple text expansion, the model uses Proximal Policy Optimization (PPO) to predict the optimal weight and "effect range" (the specific time steps during denoising) for each modifier. The reward function balances visual beauty (Aesthetic Score), semantic alignment (CLIP Score), and human preference (PickScore).
Dynamic vs. Static Control
A key insight of this research is that "timing is everything." Texture-related modifiers and artist-specific styles are often more effective when introduced during the latter half of the diffusion process, once the basic layout is established. Conversely, applying heavy modifiers throughout the entire process can lead to over-saturation or loss of the original intent.
Key Results and Performance
PAE consistently outperforms both human-written prompts and existing state-of-the-art optimizers like Promptist across multiple benchmarks:
- Human Preference: On the Lexica.art benchmark, PAE achieved a PickScore of 73.9%, surpassing the original human prompts (72.5%) and Promptist (68.4%).
- Aesthetics and Realism: PAE recorded the highest Aesthetic Scores (6.12) and improved realism as measured by the CMMD metric (1.125).
- Qualitative Impact: Beyond metrics, PAE demonstrates an intelligent ability to expand semantic content—for instance, adding contextually relevant backgrounds or lighting—while maintaining the core subject of the user's original request.
Conclusion and Future Directions
While PAE significantly advances automated prompt engineering, challenges remain, such as "attribute leakage" (where colors or textures bleed between objects). Future work aims to incorporate spatial control by adding attention maps to the RL action space, allowing the model to determine not just when a word matters, but where in the image it should be applied. By treating prompts as dynamic instructions rather than static strings, PAE moves T2I generation toward a more intuitive and powerful creative tool.
Summary updated