TL;DR
Ask an automated prompt optimizer to spice up your text-to-image prompt, and it might give you stunning lighting while quietly turning your "white tiger king in a blue suit" into a suitless tiger holding a disembodied head. StruPO solves this by extracting an explicit scene graph of your prompt's objects and relationships, using it both to guide surgical text edits and to grade the final image. The result is a fast, single-pass prompt editor that makes images look dramatically better without losing the plot—even when transferred to totally unseen image generators.
What Problem Does This Paper Address?
Text-to-image (T2I) models like Stable Diffusion are notoriously picky about phrasing. Users write what they want to see; generators care about how you ask—lighting, medium, and stylistic flourishes. Automatic prompt optimizers bridge this gap, rewriting a plain prompt $x$ into a vivid prompt $y$.
Here is the catch: aesthetics and faithfulness often pull in opposite directions. Most learned optimizers rely on global text–image similarity (like CLIP scores) to stay on topic. Unfortunately, global embeddings are blurry. An image missing a requested crown or swapping coat colors can still score high on overall topical similarity.
Recent methods fix this at test time by generating an image, asking a vision-language critic what is missing, and iteratively rewriting the prompt in a slow, expensive loop. The authors ask: Can we internalize that structural critique into a fast, reusable editing policy that gets it right in a single pass?
Methods
StruPO (Structured Prompt Optimization) treats prompt rewriting as a single-step reinforcement learning (RL) problem built around a shared scene graph—a map of objects (with attributes attached, like "gold crown") and their relations.
Here is what happens under the hood:
- Calibrated Scene Graphs (DSE): Text parsers can be gullible—if a prompt says "a girl photographed with a Leica lens," a naive parser expects to see a literal camera lens floating in the scene. StruPO renders one initial calibration image and uses open-vocabulary vision models (GLIP and BLIP) to prune away stylistic or camera-related parser hallucinations while keeping core syntactic objects intact.
- Hybrid Encoding & Surgical Edits (MHE & EAG): Instead of letting an LLM rewrite the prompt from scratch—which invites hallucination—StruPO fuses text features with graph neural network (GCN) features and feeds them to a token-level editor (initialized from BART-base). The editor is restricted to three explicit operations: deleting tokens, reordering what remains, and inserting new stylistic phrases into the gaps.
- Smoothing Noisy Rewards & Environment-Aware GRPO: After warm-starting with supervised fine-tuning (SFT), the policy trains via Group Relative Policy Optimization (GRPO) using feedback from rendered images. Training RL on visual grounding is tricky because vision detectors are uncertain and diffusion seeds are random. Instead of hard pass/fail thresholds (which create nasty gradient cliffs), StruPO uses a smooth, clipped-log confidence reward alongside aesthetic and CLIP scores. Furthermore, for every candidate edit, StruPO renders $M=3$ images and averages their rewards before comparing edits—ensuring the model learns from good phrasing rather than lucky random seeds.
Datasets
No brand-new benchmark datasets are introduced; instead, the authors construct a training pipeline from existing repositories and test across strict in-domain and out-of-domain splits:
- Training: 72K human-optimized prompts from Lexica are stripped of style modifiers (via heuristics and GPT-4o) to create 144K input–target pairs for SFT. RL uses 24K input prompts without targets.
- Evaluation: Three disjoint 2K-prompt test sets: Lexica and DiffusionDB (in-domain) and MS-COCO captions (out-of-domain, representing natural scene descriptions).
Key Insights and Ideas
- Prompts need editors, not ghostwriters: When the authors ablated the token-editing module (EAG) and let the model generate free-form text—even with the scene graph and RL rewards intact—structural consistency dropped by over 7 percentage points. Biasing the action space toward local edits is crucial for preserving user intent.
- Relational complexity is the real differentiator: Almost any optimizer can keep single nouns in a prompt. As scenes get denser with relationships ($3+$ relations), standard rewriters wobble wildly, whereas StruPO's relation recall stays rock-steady near 70%.
- Good structural edits speak a universal language: Because StruPO outputs plain text rather than generator-specific embeddings, prompts trained exclusively on Stable Diffusion v1.5 transfer zero-shot to newer architectures like FLUX.1-dev.
Key Results
- In-Domain Gains (SD v1.5): On Lexica, StruPO achieves an aesthetic gain ($\text{AES}_\Delta$) of +0.63 while boosting Relation Recall (RR) to 69.64%—nearly 8 points higher than the strongest baseline—and topping held-out Gemini-VQA evaluations (82.4%). It sweeps all metrics on DiffusionDB ($\text{AES}_\Delta$ +0.91, Scene Graph Recall 79.22%).
- Out-of-Domain Trade-offs: On COCO, iterative baseline VisualPrompter gets higher relation recall (76.01% vs. 66.59%) by being ultra-literal, but actually hurts image aesthetics ($\text{AES}_\Delta$ -0.36). StruPO delivers the highest aesthetic jump (+1.02) while keeping consistency competitive with GPT-4o.
- Zero-Shot Backbone Transfer: Evaluated without retraining on FLUX.1-dev, StruPO hits 62.43% RR (vs. Promptist's 53.41%) and the highest aesthetic gain (+1.14).
- Human Preference: In a 15-annotator study across 2K Lexica prompts, StruPO beat all five baselines on both aesthetics and consistency, with consistency win–loss margins widening from +6% to +16% (vs. Promptist) when prompts had 3 or more relations.
Limitations and Future Work
- Graph Expressiveness: Object–relation graphs handle local attributes well, but struggle to represent exact object counts, negation ("no clouds"), occlusion, metaphors, or abstract emotional tone.
- Conservative Bias: Because the editor prefers local token adjustments, it can be overly restrictive when a clunky user prompt genuinely needs a complete structural overhaul.
- Compute Overhead: Rendering an initial calibration image adds test-time latency compared to pure text-only rewriters, and rendering multiple images per rollout increases offline RL training costs.
- Future Directions: Developing richer semantic representations (to capture counting and abstract intent) and adaptive policies that know when to edit locally versus rewrite globally.
Summary updated