From Structural Feedback to Prompt Policies: Learning Faithful Text-to-Image Prompt Editors

Wentao Ye, Yali Ye, Zhiqing Xiao, Ru Peng, Xinpeng Ti, Liyao Li, Zhanming Shen, Peng Lu, Jie Zhang, Haobo WangNeurIPS 2026

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.

Figure 1: Similar global embedding scores can conceal different structural errors. A scene graph makes object attributes and relations explicit.

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.

Figure 2: Overview of StruPO. Calibrated structural intent conditions the DSE–MHE–EAG editor and defines image-grounded consistency feedback. Environment-aware GRPO averages renders of each candidate before comparing edit rollouts.

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.
Figure 3: The three edit operations used by EAG. Tokens are first retained or deleted, the retained subsequence is reordered, and new tokens are inserted into the resulting slots.
  • 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%.
Relation recall across increasing relational complexity on Lexica.
  • 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

Abstract

Prompt optimization should improve the image a user receives without changing the scene the user requested. Yet stylistic rewriting can weaken object attributes and relations even when global text--image similarity remains high. We propose StruPO, a structure-aware prompt editor that uses a calibrated scene graph as a shared representation for policy conditioning and image-grounded supervision. The graph exposes what should be preserved, while deletion, reordering, and insertion provide a token-aligned way to modify the prompt. This turns structural feedback from an external critique into a training signal for a reusable editing policy. Learning from that signal requires handling both uncertain grounding and stochastic image generation. StruPO retains grounding confidence through smooth reward shaping and averages multiple images for each edit before computing group-relative advantages. Experiments span three disjoint 2K-prompt test sets and four frozen generation backbones, with comparisons to learned prompt optimizers, iterative structural feedback, diffusion-model fine-tuning, and inference-time attention control. StruPO improves the faithfulness--aesthetics trade-off, with consistent gains in relational fidelity. Independent automatic evaluators and a 15-annotator study provide complementary evidence, and human preference margins increase with relation complexity. Controlled ablations connect these gains to graph conditioning, local editing, and image-grounded learning. The resulting policy produces reusable optimized text in one pass after graph calibration, without an iterative critique--rewrite loop.
BibTeX
@inproceedings{ye2026from,
  author = {Wentao Ye and Yali Ye and Zhiqing Xiao and Ru Peng and Xinpeng Ti and Liyao Li and Zhanming Shen and Peng LU and Jie Zhang and Haobo Wang},
  title = {{From Structural Feedback to Prompt Policies: Learning Faithful Text-to-Image Prompt Editors}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=DikML74WUt},
}
Figure