Manuscript Offprint

arXiv:2610.22264

SCOPE: Semantic Bounded Credit Optimization for Prompt Engineering in Text-to-image Generation

Yufei Jiao, Jinfa Huang, Zeyue Xue, Tianyu Xie, Yuexiao Ma, Rongrong Ji, Xiawu Zheng, Jiebo Luo

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Reinforcement learning (RL) enables language models to improve text-to-image (T2I) generation by rewriting prompts for a frozen image generator. Existing methods typically apply a single signal derived from the image to individual subword tokens, although objects, counts, attributes, and relations form coherent semantic spans. We propose SCOPE, an objective based on Group Relative Policy Optimization (GRPO) that aligns update weighting with this structure. The rewriter jointly generates an enhanced prompt and its semantic partition. SCOPE pools shifts in policy log probabilities within each span to derive a shared coefficient for its token losses while retaining a single advantage for each completion. It requires neither separate span rewards nor additional image renders. Across Qwen-Image, SD3, and FLUX.1-dev, SCOPE achieves average relative gains over vanilla GRPO of 9.48% on GenEval and 7.62% on T2I-CompBench. Ablation studies show that both semantic boundaries and pooling within spans contribute to these gains, supporting semantic structure as a practical inductive bias for prompt engineering with RL.

Email: Yufei Jiao yufei@stu.xmu.edu.cn, Jinfa Huang jhuang90@ur.rochester.edu

Code: github.com/MAC-AutoML/SCOPE

1 Introduction

Text-to-image (T2I) generation models [6, 8, 15, 16, 34, 36, 40–43, 54, 55, 60] turn language into visual content, with prompts serving as the primary interface for controlling generation. Small wording changes can determine whether an image preserves object counts, binds colors correctly, or places objects in the intended spatial relation. As diffusion and flow generators grow larger, retraining or lightly adapting the visual decoder is often expensive and risks image quality [1, 5, 7, 11, 12, 20, 26, 29, 30, 38, 39]. Prompt adaptation offers a cheaper alternative by improving the language interface while keeping the image generator fixed.

Prompt optimization with a frozen generator can be formulated as a reinforcement learning problem. A language policy rewrites the input prompt, the T2I model renders an image, and an evaluator assigns a scalar reward based on the requested composition. Recent methods [15, 34, 55] exploit this feedback loop to improve T2I alignment while keeping the visual backbone fixed. GRPO converts rewards from grouped rewrites into an advantage for each completion without requiring a learned critic [28, 46]. The objective applies this advantage across token positions without accounting for semantic span boundaries.

Compositional prompt edits to objects, attributes, counts, spatial relations, and scene context form coherent phrases that can span several subword tokens. Tokenizer boundaries reflect subword segmentation and need not coincide with these semantic units. An object description can combine an identity, a count, and an attribute, while a relation phrase links multiple objects. Words expressing each edit jointly specify a compositional constraint, even across multiple subword units. The image reward evaluates the resulting

Figure

Figure 1. Comparison of uniform token weighting in GRPO and semantic span weighting in SCOPE. A T2I evaluator provides a single reward for the image. Standard GRPO derives an advantage for the completion and applies it across token positions. However, compositional prompt edits are naturally organized into semantic phrases whose boundaries need not align with tokenizer positions. SCOPE preserves the same advantage for the completion and derives a shared coefficient for each semantic span from shifts in policy log probabilities. This coefficient modulates all token updates within the span.

composition holistically, without direct attribution to constituent spans or tokens. This exposes a fundamental credit assignment bottleneck: uniform token-level updates fragment coherent compositional edits across arbitrary subword boundaries, yet estimating dense per-span rewards incurs prohibitive rendering overhead.

To bridge this gap, we introduce Semantic Bounded Credit Optimization for Prompt Engineering (SCOPE), a GRPO-compatible objective that modulates token updates across semantic spans. The rewriter outputs a prompt rewrite and its semantic partition, mapped onto rollout tokens. SCOPE pools shifts in token log probabilities between the current and old policies within each span to derive a detached coefficient. This coefficient reweights the contribution of the shared advantage to each token loss in the clipped GRPO surrogate. The objective retains a loss for each valid token and a single advantage for each completion. SCOPE uses the existing rendering and reward pipeline, without separate rewards or advantages for individual spans, additional image renders, or a learned critic. Moreover, SCOPE serves as a strict generalization of standard GRPO, seamlessly recovering uniform token updates when span modulation is neutralized ( β=0\beta = 0).

Across Qwen-Image, SD3, and FLUX.1-dev, SCOPE consistently outperforms vanilla GRPO on GenEval [13] and T2I-CompBench [18]. Ablations favor pooling policy shifts within semantic spans over weighting individual tokens, and semantic boundaries over random boundaries or fixed windows. The token weighting comparison tests the contribution of pooling over semantic units. The random and fixed window controls test the contribution of semantic boundaries beyond grouping neighboring tokens. Together, these comparisons separate semantic structure from generic reweighting. Overall, we make three contributions:

  • We identify semantic credit fragmentation in T2I prompt rewriting with RL. A single signal per completion, derived from the image, drives updates to tokenizer positions. Compositional edits form coherent semantic spans whose boundaries need not align with the subword boundaries imposed by the tokenizer.

  • We introduce SCOPE, an objective compatible with GRPO that pools policy log probability shifts within semantic spans to assign shared token weights. It retains one advantage per completion without separate span rewards or advantages, additional image renders, or a learned critic.

• We demonstrate that SCOPE consistently outperforms the vanilla GRPO baseline on GenEval and T2I-CompBench. These gains hold across three frozen T2I backbones: Qwen-Image, SD3, and FLUX.1-dev.

References (59)