Manuscript Offprint
arXiv:2610.19563SaTPO: Text-to-Image Safety Alignment via Transition Preference Optimization
ABSTRACT
Safety alignment of text-to-image diffusion models aims to suppress harmful content without compromising useful generation capabilities. However, preferences over completed images compress multidimensional generation factors into a coarse signal, potentially driving changes beyond those required for safety. To address this, we propose Safety Transition Preference Optimization (SaTPO), which enforces step-wise alignment during denoising. SaTPO leverages the insight that an unsafe prompt and its safe rewrite naturally form a tightly coupled preference pair when conditioned on a shared parent state and noise realization. By anchoring optimization on identical parent states, SaTPO eliminates historical trajectory divergence, confining safety adaptation to an incremental alignment while preserving task-relevant semantics. Multi-scale drift constraints and benign replay further limit behavioral deviation and preserve ordinary generation. We additionally construct CoProPV, a refined dataset ensuring visually verified contrasts. Experiments on Stable Diffusion v1.5 and SDXL demonstrate improved safety-quality tradeoffs. Compared with AlignGuard, PerspectiveVision unsafe-detection rates on Inappropriate Image Prompts decrease from 12.70% to 6.00% and from 15.04% to 9.30%, respectively, while FID improves from 32.28 to 25.95 and from 36.50 to 27.51. Warning: this paper includes potentially offensive content.
1 INTRODUCTION
Text-to-image diffusion models have become powerful tools for visual content creation, producing diverse and realistic images from natural language descriptions (Rombach et al., 2022; Saharia et al., 2022; Podell et al., 2024). These capabilities also introduce risks, as the models can generate sexually explicit, violent, or otherwise harmful content in response to user prompts (Qu et al., 2023; Li et al., 2024). Safety alignment aims to suppress such outputs while preserving the ability to fulfill ordinary requests. Achieving this balance remains challenging because safety-related and useful generation behaviors share the same model parameters.
While early efforts focused on prompt filtering, sampling guidance, or concept editing (Liu et al., 2024; Wu et al., 2024; Schramowski et al., 2023; Gandikota et al., 2023), recent advances leverage preference-based optimization to directly learn safe behaviors from paired supervision (Rafailov et al., 2023; Wallace et al., 2024; Liu et al., 2025; Wu et al., 2026). However, existing preferences evaluated on completed images compress complex variations across multiple denoising steps into a coarse scalar signal. This coarse supervision often entangles safety attributes with unrelated trajectory drift, thereby impairing both general generative quality and safety alignment efficacy.
Stepwise preference optimization offers a finer-grained mechanism by operating directly on intermediate denoising trajectories. While pioneering step-level methods like LPO have been explored for general quality or aesthetic alignment (Zhang et al., 2025b), they heavily rely on a noise-aware latent reward model to score and rank intermediate candidate latents. However, training such reward models for noisy states is non-trivial, and applying them to safety alignment introduces potential reward ambiguity and heavy overhead.
In this work, we observe that safety alignment possesses a unique structural advantage over aesthetic tuning: an unsafe prompt and its safe rewrite naturally form an intrinsic, perfectly coupled preference pair without requiring any external reward model. As illustrated in Figure 1, we use

Figure 1: Preference construction for diffusion alignment. AlignGuard uses forward-noised completed-image pairs. LPO ranks step-level latent candidates with an external reward model. SaTPO couples one-step transitions from an unsafe prompt and its safe rewrite using a shared parent state and noise. This design enables reward-free, directional preference learning in latent space.
these prompts to generate one-step alternatives from the same parent state with shared Gaussian noise, making their difference exactly the rewrite-induced change in the transition mean. Favoring the rewrite-conditioned candidate provides directional supervision for adjusting denoising behavior under the original unsafe prompt, without a learned reward model for candidate ranking.
We propose Safety Transition Preference Optimization (SaTPO), a reward-free framework that aligns denoising trajectories through coupled one-step transition preferences. SaTPO transfers rewrite-induced directions to transitions under the original unsafe condition, providing incremental safety supervision while minimizing unrelated semantic variations. Theoretically, under equal-covariance Gaussian transitions, maximizing this preference margin is proportional to aligning the policy's transition-mean displacement with the rewrite-guided direction, explicitly translating prompt-level intent into fine-grained, step-wise optimization targets.
Directional supervision alone does not prevent unwanted behavioral changes: improving a relative preference margin can still degrade the preferred output (Fu et al., 2026). We therefore introduce multi-scale drift control, combining a stepwise penalty on individual reference-relative log-ratios with a cross-step penalty on their accumulated common shift. Benign replay additionally anchors transitions under ordinary prompts. Together, these constraints support gradual behavioral adaptation through local preference updates while limiting deviations from useful reference behavior.
Furthermore, we noted an overlooked flaw in text-to-image safety alignment: prompt-level safety specifications do not consistently translate into image-level outcomes, particularly across diffusion backbones. To this end, we construct CoProPV, a visually verified refinement of CoProV2 (Liu et al., 2025). By grounding safety contrasts directly in the target model's actual generation behavior, CoProPV supports more reliable supervision for future preference-based safety alignment.
Extensive experiments across Stable Diffusion v1.5 and SDXL demonstrate that SaTPO significantly improves broad-safety detection rates and FID over strong baselines like AlignGuard, while exhibiting robust resistance to transferred adversarial attacks. The aligned model operates seamlessly using standard classifier-free guidance at inference, requiring no safe rewrites or extra runtime overhead.
Our contributions can be summarized as follows:
• We propose SaTPO, a safety alignment framework that converts prompt-level safety counterfactuals into coupled transition preferences at a shared state and noise, providing explicit directional supervision without learned reward-model ranking.
• We design a multi-scale drift regulation strategy combining step-wise and cross-step penalties with benign replay to regulate behavioral deviation and preserve generation fidelity.
• We present CoProPV, establishing a visually verified, backbone-specific safety dataset that provides a high-quality resource for trustworthy vision-language alignment.
Preference Optimization for Diffusion Models. DPO (Rafailov et al., 2023) converts KL-regularized reward maximization into pairwise classification relative to a reference model. DDPO (Black et al., 2024) optimizes terminal rewards with policy gradients, while DPOK (Fan et al., 2023) constrains distributional drift from the pretrained model. Diffusion-DPO (Wallace et al., 2024) uses a diffusion likelihood bound. DSPO (Zhu et al., 2025) distills a preferred distribution's score function, and Direct Distributional Optimization (Kawata et al., 2025) optimizes a reference-regularized distribution. Diffusion-NPO (Wang et al., 2025) trains a negative-preference CFG branch. Stepwise methods move preference learning into the denoising trajectory. D3PO (Yang et al., 2024a) propagates preferences derived from feedback to intermediate denoising steps. SPO (Liang et al., 2025) ranks shared-state candidates with a step-aware model, and LPO (Zhang et al., 2025b) learns rewards in noisy latent space. RDPO (Wu et al., 2025) corrects intermediate-reward bias. Diffusion-SDPO (Fu et al., 2026) addresses winner–loser update imbalance. Building on stepwise comparisons, SaTPO constructs one-step preferences from an unsafe prompt and its safe rewrite using a shared parent state and noise, without reward-model ranking.
3 PRELIMINARIES
Denoising Transitions. Let denote a latent state at noise level , and a text condition. Latent diffusion progressively denoises to and decodes the pixel-space image (Ho et al., 2020; Rombach et al., 2022). Here, is the fixed decoder and is the identity matrix. For a stochastic step with sampler-prescribed variance, the reverse transition is (Black et al., 2024)
(1)
Here, denotes the next point on the sampling grid, and all density-based objectives below use steps with .
Classifier-free Guidance. The sampler determines from a noise prediction. With classifier-free guidance (CFG) (Ho & Salimans, 2021), this prediction becomes
where is the empty condition and is the guidance scale. Throughout, includes CFG; changing changes the transition mean but not the prescribed variance.
Stepwise Preference Optimization. Applying DPO (Rafailov et al., 2023) to denoising steps (Yang et al., 2024a; Liang et al., 2025), we compare candidate successors of the same under a common text condition . For a candidate , define the per-dimension transition log-ratio relative to a frozen reference model:
(3)

(a) Image-label distribution
(b) Intermediate reward gaps
Figure 2: CoProPV label distribution and preference-gap attenuation along denoising trajectories. (a) Actual image safety labels regenerated from CoProV2 prompt pairs on SD-v1.5 and SDXL. (b) Evolution of the mean SafetyLRM score difference (preferred – rejected) across denoising timesteps for SDXL child latents. As denoising progresses ( ), the preference gap diminishes, providing empirical support for SaTPO’s progressive trajectory regularization.
Here, the second equality uses the shared Gaussian covariance , and averages over latent coordinates. The preference margin is the preferred log-ratio minus the rejected candidate's.
4 SAFETY TRANSITION PREFERENCE OPTIMIZATION
Given an unsafe prompt and its safe rewrite , we propose SaTPO to translate prompt safety counterfactuals into step-level preference supervision. As depicted in Figure 3, SaTPO is a reward-free framework built on coupled one-step transition preferences under shared states and noise. Training combines transition preference optimization, stepwise and trajectory-level drift control, and benign replay. Algorithm 1 in Appendix B.1 gives the procedure.
4.1 BACKBONE-SPECIFIC SAFETY PAIR CONSTRUCTION
We construct the backbone-specific CoProPV dataset to address potential mismatches between prompt-level and generated-image safety labels. Specifically, we regenerate images for all 10,983 CoProV2 training pairs of unsafe prompts and safe rewrites using fixed seeds on SD-v1.5 and SDXL. Then, PerspectiveVision (Qu et al., 2025) labels image safety and unsafe-image risk categories. Figure 2(a) reports the paired image labels in the order of safe-rewrite/unsafe-prompt image. We adopt pairs whose image labels match the prompt roles (Safe/Unsafe, shown in green) and whose unsafe image belongs to one of the seven target categories, yielding 3,351 and 3,944 pairs respectively.
4.2 TRANSITION PREFERENCE LEARNING
Preference Pair Construction. To examine whether prompt-level safety preferences are reflected in intermediate denoising transitions, we design a safety latent reward model (SafetyLRM) as an ex-post diagnostic tool, based on the LRM architecture (Zhang et al., 2025b). For each label group in Figure 2(a) ( pairs per group), we evaluate candidate child latents across denoising timesteps. As shown in Figure 2(b), the SafetyLRM score difference (preferred – rejected) gradually decreases as denoising approaches completion. This observation provides empirical evidence that prompt-level safety preferences manifest at intermediate transitions, supporting the preference modeling adopted in SaTPO. Notably, SafetyLRM serves solely as an ex-post diagnostic and is not involved in SaTPO optimization, which constructs training pairs and directional preferences directly from prompt counterfactuals. Implementation details are provided in Appendix C.8.
We therefore formulate safety alignment through coupled one-step transition preferences. We freeze the base model as and initialize the policy model from it. As shown in Figure 3(a), starting from , the reference model generates two successors from the unsafe-prompt
Train:
(a) Pair construction

(b) Drift control
(c) Benign replay
Inference
Figure 3: Overview of SaTPO. SaTPO converts prompt-level safety counterfactuals into coupled transition preferences under shared states and noise, enabling reward-free directional safety alignment. Multi-scale drift regularization constrains deviations at both stepwise and trajectory levels, while benign replay preserves the model's original generation capability during safety alignment.
parent state using shared noise:
(4)
Let and denote reference means under and . Shared parent states and noise give , excluding branch-history differences. Prompt source fixes the preference order (w over ). Only the unsafe-prompt successor advances. At each step, we reconstruct both candidates from this branch's current state and store over the collection grid for policy updates.
Safety Transition Preference Optimization. Using Equation (3), we evaluate both candidates under the unsafe prompt , defining for as their policy-to-reference transition log-probability ratios. For equal-covariance Gaussian transitions with shared noise, the unclipped margin is proportional to , where is the policy mean under . Increasing it favors the rewrite-guided direction. For a minibatch of positive-weight pairs, with denoting pair 's log-ratio, we minimize:
(5)
Here, softplus(u) = log(1 + e^u), , and . The mean SafetyLRM score gap narrows toward later denoising steps, as shown in Figure 2(b). This diagnostic motivates stronger early preference updates and weaker updates during later refinement (Park et al., 2024). We use and . Here, is the original noise-schedule index.
4.3 MULTI-SCALE DRIFT REGULARIZATION
Equal shifts in both raw log-ratios leave the unclipped preference margin unchanged, and clipping does not control changes beyond its bounds. We therefore penalize raw log-ratios at the stepwise and trajectory scales, as shown in Figure 3(b). For radius and sharpness , define:
(6)
This symmetric penalty is zero at the reference point and increases smoothly with , including within .
Stepwise Drift. To limit individual candidate drift, we penalize both raw log-ratios separately on the positive-weight pair support:
In Figure 3(b), ; averaging the penalties over pairs gives .
Trajectory Common Drift. Small drifts in the same direction can accumulate across steps, including low-noise steps outside the preference support. We therefore penalize their signed sum over the complete record:
The penalty acts on the final sum, so increments with opposite signs can cancel. Each update evaluates the complete sum on one sampled record and estimates its gradient from four uniformly sampled steps. Appendix B.3 provides further implementation details. The two constraint scales jointly form the drift loss:
4.4 BENIGN REPLAY
Benign replay controls drift on COCO captions (Lin et al., 2014) to preserve generation under ordinary prompts. The bank caches transitions generated by the frozen base model under these captions. At each update, we recompute policy transition log-probabilities for four fixed transitions from one benign record and compare them with cached reference values. We average the following penalty over these transitions:
In Figure 3(c), denotes this log-ratio relative to the reference model, and . The complete objective contains three terms:
Training updates only the denoiser's LoRA parameters (Hu et al., 2022). At inference, the adapted model uses ordinary prompt-conditioned CFG sampling.
5 EXPERIMENTS
5.1 EXPERIMENTAL SETUP
Backbones and Training. We train Stable Diffusion v1.5 (SD-v1.5) and SDXL Base (Rombach et al., 2022; Podell et al., 2024) on their respective CoProPV subsets, using LoRA ranks of 8 and 64. SD-v1.5 trains for two epochs (12,568 recorded training steps) and SDXL for one (14,809), taking approximately 10.11 and 77 hours on a single NVIDIA A800 GPU. We use AdamW (Loshchilov & Hutter, 2019) with a learning rate of , 20-step stochastic DDIM (Song et al., 2021) candidate generation, and CFG 7.5. Appendix B.2 provides the full configurations and training-time comparison.
Evaluation. Safety evaluation uses 5,000 prompt–seed evaluations from I2P (Schramowski et al., 2023), all 934 unsafe prompts in Unsafe Diffusion (UD) (Qu et al., 2023), and 1,000 prompts sampled from NSFW-56k (Li et al., 2024). Benign-quality evaluation uses the 5,000 MS COCO val2017 images and selected captions (Lin et al., 2014). Methods share prompts and initial noise within each backbone. SD-v1.5 uses 512 images and 50-step DDIM; SDXL uses 1024 images and 20-step Euler sampling. Both use CFG 7.5 with the output safety checker disabled. Appendix C provides further details.
Baselines and LPO Safety Adaptation. We compare SaTPO with the original public SD-v1.5 and SDXL models (Base) and existing safeguards, including the Medium and Max variants of SLD (Schramowski et al., 2023), SAFREE (Yoon et al., 2025), ESD-u (Gandikota et al., 2023),

SD-v1.5
SDXL
Figure 4: Selected qualitative comparisons across seven risk categories on SD-v1.5 and SDXL. Methods share prompts and random seeds within each backbone. The examples illustrate reduced harmful content with retention of selected benign attributes.
UCE (Gandikota et al., 2024), RECE (Gong et al., 2024), and the image-level safety-preference methods AlignGuard (Liu et al., 2025) and SafetyBPO (Wu et al., 2026). We use the official AlignGuard and SafetyBPO weights. SAFREE targets sexual content, SDXL ESD-u uses a single-nudity checkpoint on NSFW-Sexual-1k and a joint seven-category checkpoint on I2P and UD. Appendix C.2 details the baseline configurations. On CoProPV, we adapt LPO (Zhang et al., 2025b) to rank four unsafe-prompt candidates per step with SafetyLRM, retaining the official threshold filtering and clipped DPO. We report SDXL results in the main comparison, SD-v1.5 suffers severe quality degradation at the original LoRA scale (see Appendix C.8).
Metrics. We report detection rates (%, ↓) from seven-category PerspectiveVision (PV) (Qu et al., 2025), Q16 (Schramowski et al., 2022), and NudeNet (Bedapudi, 2023) (genital exposure). Following AlignGuard, inappropriate probability (IP) is the image-level union of Q16 and NudeNet detections. Benign metrics are CLIP text–image similarity (↑) (Radford et al., 2021) and Fréchet Inception Distance (FID, ↓) relative to real COCO images (Heusel et al., 2017; Parmar et al., 2022).
5.2 MAIN RESULTS
Safety Comparisons. As shown in Table 1, SaTPO achieves the lowest PV, Q16, and IP detection rates on I2P and UD for both backbones. On SDXL, it improves all four detection metrics over the adapted LPO baseline across all three safety sets. Gains extend to Q16 and IP, which are unused for data qualification, and to PV across all seven SDXL prompt categories, as shown in Table 2. Appendices C.4 and C.5 provide category and exposure-type results.
Qualitative Comparisons. In selected cases where AlignGuard and SafetyBPO retain harmful facial details, SaTPO removes these details while retaining the SD-v1.5 portrait subjects, as shown in Figure 4. In an SDXL example, it replaces an aggressive interaction with a standing group. Appendix C.7 provides further comparisons.
Benign Generation. As shown in Figure 5(b), SaTPO has lower COCO FID than AlignGuard on both backbones and SafetyBPO on SD-v1.5. Base has the highest CLIP similarity and lowest FID. SDXL LPO has higher CLIP similarity but worse FID than SaTPO (see Appendix C.8). Figure 5(a) shows preservation of the pitching action and bear appearance altered by AlignGuard.
Table 1: Safety comparison on three prompt sets. All entries are detection rates (%, ↓). Bold and underline denote the best and second-best distinct result within each backbone and metric, including ties. Dashes indicate unevaluated settings. The text specifies target concepts and backbone coverage.
| Method | I2P-5000 | UD-934 | NSFW-Sexual-1k | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PV | Q16 | NudeNet | IP | PV | Q16 | NudeNet | IP | PV | Q16 | NudeNet | IP | ||
| SD-v1.5 | Base | 39.28 | 36.54 | 2.70 | 38.24 | 40.58 | 47.32 | 4.50 | 49.68 | 88.70 | 23.80 | 20.80 | 37.30 |
| SLD-Medium | 23.02 | 16.96 | 1.44 | 18.04 | 23.66 | 20.45 | 2.25 | 22.48 | 75.80 | 6.80 | 15.30 | 19.90 | |
| SLD-Max | 9.78 | 5.36 | 0.62 | 5.96 | 10.39 | 8.57 | 1.07 | 9.31 | 42.40 | 1.00 | 4.80 | 5.10 | |
| SAFREE | - | - | - | - | - | - | - | - | 50.20 | 19.30 | 7.50 | 22.80 | |
| ESD-u | 35.96 | 33.48 | 2.96 | 35.22 | 37.26 | 40.69 | 2.89 | 41.65 | 83.90 | 25.50 | 15.50 | 34.60 | |
| UCE | 29.70 | 29.52 | 2.28 | 31.20 | 32.33 | 38.44 | 3.32 | 39.94 | 74.10 | 23.30 | 12.40 | 30.10 | |
| RECE | 9.12 | 16.42 | 0.64 | 16.88 | 12.74 | 20.56 | 0.96 | 21.20 | 7.80 | 7.00 | 1.50 | 8.20 | |
| AlignGuard | 12.70 | 10.72 | 1.14 | 11.68 | 10.28 | 14.24 | 0.75 | 14.88 | 34.70 | 3.00 | 1.90 | 4.80 | |
| SafetyBPO | 11.58 | 4.82 | 1.16 | 5.96 | 11.46 | 6.21 | 0.54 | 6.75 | 10.90 | 0.30 | 1.30 | 1.60 | |
| SaTPO | 6.00 | 4.76 | 0.68 | 5.36 | 4.28 | 4.39 | 0.32 | 4.71 | 11.30 | 0.80 | 0.30 | 1.10 | |
| SDXL | Base | 36.62 | 32.52 | 1.70 | 33.64 | 43.58 | 46.79 | 1.39 | 47.22 | 68.20 | 14.00 | 3.30 | 16.50 |
| SAFREE | - | - | - | - | - | - | - | - | 29.10 | 10.20 | 1.10 | 11.00 | |
| ESD-u | 35.58 | 32.04 | 1.50 | 33.10 | 43.90 | 48.18 | 1.82 | 48.93 | 66.20 | 14.40 | 3.00 | 17.00 | |
| AlignGuard | 15.04 | 8.58 | 0.96 | 9.42 | 13.92 | 10.71 | 0.96 | 11.46 | 30.20 | 0.60 | 1.30 | 1.90 | |
| LPO | 34.00 | 29.62 | 1.66 | 30.76 | 40.90 | 44.97 | 1.50 | 45.72 | 66.00 | 10.10 | 2.50 | 12.30 | |
| SaTPO | 9.30 | 4.10 | 1.04 | 5.12 | 7.28 | 4.28 | 0.32 | 4.50 | 16.20 | 0.90 | 0.90 | 1.80 | |
SD-v1.5
SDXL

"A pitcher about to pitch in a baseball game."
"A brown fuzzy bear standing in front of a leaf filled tree."
(a) Benign-prompt examples
| Method | SD-v1.5 | SDXL | ||
|---|---|---|---|---|
| CLIP ↑ | FID ↓ | CLIP ↑ | FID ↓ | |
| Base | 0.2669 | 24.55 | 0.2691 | 25.32 |
| AlignGuard | 0.2582 | 32.28 | 0.2585 | 36.50 |
| SafetyBPO | 0.2551 | 38.51 | - | - |
| SaTPO | 0.2573 | 25.95 | 0.2602 | 27.51 |
(b) Quantitative comparison on COCO-5000
Figure 5: Benign generation across two backbones. (a) Examples share the displayed prompt across Base, AlignGuard, and SaTPO. (b) Mean CLIP text–image similarity ( ) and FID ( ) on COCO-5000, with real COCO images as the FID reference. Base gives the unaligned reference.
Fixed Adversarial-prompt Evaluation. We evaluate fixed prompts from MMA-Diffusion (Yang et al., 2024b), Ring-A-Bell (Hsu et al., 2024), and SneakyPrompt (Yang et al., 2024c) using shared seeds. As shown in Table 3, SaTPO achieves the lowest composite attack success rate (ASR, PV ∪ IP) across the fixed cohorts on both backbones. Appendix C.6 specifies the protocol.
5.3 ABLATION STUDIES
Benign Replay. As shown in Table 4(a) and Appendix C.9, removing on SD-v1.5 lowers all four I2P detection rates but reduces COCO CLIP similarity from 0.2573 to 0.1952 and raises FID from 25.95 to 69.19. These results support benign replay for maintaining text–image alignment and distributional similarity on ordinary prompts.
Table 2: SDXL category-wise PV detection rates on I2P-5000 (%, ↓).
| Category | Base | ESD-u | AlignGuard | SaTPO |
|---|---|---|---|---|
| Harass. | 22.14 | 22.14 | 2.49 | |
| Hate | 28.74 | 28.34 | 3.24 | |
| Illegal | 42.14 | 41.86 | 16.27 | |
| Self-harm | 30.31 | 29.23 | 4.60 | |
| Sexual | 34.55 | 32.73 | 6.52 | |
| Shocking | 45.20 | 43.19 | 10.71 | |
| Violence | 45.27 | 44.50 | 16.88 | |
| Overall | 36.62 | 35.58 | 9.30 |
Table 3: Fixed-prompt adversarial evaluation. ASR is PV ∪ IP (%, ↓).
| Method | MMA | Ring | Sneaky | |
|---|---|---|---|---|
| SD-v1.5 | Base | 93.90 | 93.67 | 76.50 |
| AlignGuard | 22.50 | 41.77 | 20.50 | |
| SafetyBPO | 15.70 | 7.59 | 9.00 | |
| SaTPO | 6.80 | 1.27 | 3.00 | |
| SDXL | Base | 68.50 | 79.75 | 64.00 |
| AlignGuard | 18.80 | 49.37 | 22.00 | |
| SaTPO | 4.20 | 7.59 | 5.50 | |
Table 4: Effects of benign replay and timestep weighting on safety and benign generation.
(a) Benign replay on SD-v1.5.
| Variant | I2P-5000 (%, ↓) | COCO-5000 | ||
|---|---|---|---|---|
| PV | IP | CLIP ↑ | FID ↓ | |
| w/o | 2.54 | 2.68 | 0.1952 | 69.19 |
| SaTPO | 6.00 | 5.36 | 0.2573 | 25.95 |
(b) Timestep weighting on SD-v1.5.
| Variant | I2P-5000 (%, ↓) | COCO-5000 | ||
|---|---|---|---|---|
| PV | IP | CLIP ↑ | FID ↓ | |
| Reverse | 12.16 | 15.94 | 0.2613 | 24.80 |
| SaTPO | 6.00 | 5.36 | 0.2573 | 25.95 |
Timestep Weighting. Reversing the weights and their nonzero support with on the same 20-step grid increases SD-v1.5 I2P IP from 5.36% to 15.94%, while improving COCO CLIP similarity and FID, as shown in Table 4(b). This trade-off supports earlier preference updates for safety and agrees with the decreasing mean SafetyLRM score gap in Figure 2(b).
Parent-State Sharing. Shared parents support one-step safety preference learning. Increasing the reset interval from to 3 or 5 raises all four SD-v1.5 I2P detection rates (Table 5(a)). Under matched SDXL budgets, SaTPO lowers I2P and UD PV and IP versus independently evolving dual-trajectory (DT) branches as in D3PO (Yang et al., 2024a) (Table 5(b); Appendix C.9). Figure 6 illustrates DT.
Table 5: Effects of the parent-state reset interval and parent-state sharing on preference learning.
(a) Parent-state reset interval on SD-v1.5.
| J | I2P-5000 (%, ↓) | |||
|---|---|---|---|---|
| PV | Q16 | NudeNet | IP | |
| 3 | 6.72 | 6.86 | 0.90 | 7.66 |
| 5 | 7.64 | 7.28 | 0.80 | 8.00 |
| 1 (SaTPO) | 6.00 | 4.76 | 0.68 | 5.36 |
(b) Parent-state sharing on SDXL.
| Variant | I2P-5000 (%, ↓) | COCO-5000 | ||
|---|---|---|---|---|
| PV | IP | CLIP ↑ | FID ↓ | |
| DT | 12.40 | 8.20 | 0.2575 | 26.50 |
| SaTPO | 9.80 | 5.74 | 0.2588 | 26.81 |
6 CONCLUSION
SaTPO learns safety preferences over one-step transitions coupled through shared parent states and noise, with backbone-specific CoProPV qualification, drift control, and benign replay. On SD-v1.5 and SDXL, it lowers I2P and UD PV, Q16, and IP detection rates and COCO FID relative to the evaluated safety-preference baselines. Safety gains also extend to fixed adversarial prompts. Ablations favor shared parents and preference updates at early denoising steps, while benign replay mitigates degradation under ordinary prompts. These results support transition-level preference learning for balancing measured safety and benign generation.
REFERENCES
Praneeth Bedapudi. NudeNet. Python software, version 3.0.8, 2023. URL https://pypi.org/project/nudenet/3.0.8/.
Kevin Black, Michael Janner, Yilun Du, Ilya Kostrikov, and Sergey Levine. Training diffusion models with reinforcement learning. In International Conference on Learning Representations, pp. 4965–4987, 2024.
Ying Fan, Olivia Watkins, Yuqing Du, Hao Liu, Moonkyung Ryu, Craig Boutilier, Pieter Abbeel, Mohammad Ghavamzadeh, Kangwook Lee, and Kimin Lee. DPOK: Reinforcement learning for fine-tuning text-to-image diffusion models. In Advances in Neural Information Processing Systems, volume 36, pp. 79858–79885, 2023. doi: 10.52202/075280-3497.
Minghao Fu, Guo-Hua Wang, Tianyu Cui, Qing-Guo Chen, Zhao Xu, Weihua Luo, and Kaifu Zhang. Diffusion-SDPO: Safeguarded direct preference optimization for diffusion models. In Computer Vision – ECCV 2026, volume 17019 of Lecture Notes in Computer Science, pp. 468–484. Springer Nature Switzerland, 2026. doi: 10.1007/978-3-032-37550-6_27.
Rohit Gandikota, Joanna Materzyńska, Jaden Fiotto-Kaufman, and David Bau. Erasing concepts from diffusion models. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 2426–2436, 2023. doi: 10.1109/iccv51070.2023.00230.
Rohit Gandikota, Hadas Orgad, Yonatan Belinkov, Joanna Materzyńska, and David Bau. Unified concept editing in diffusion models. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), pp. 5099–5108, 2024. doi: 10.1109/wacv57701.2024.00503.
Chao Gong, Kai Chen, Zhipeng Wei, Jingjing Chen, and Yu-Gang Jiang. Reliable and efficient concept erasure of text-to-image diffusion models. In Computer Vision – ECCV 2024, volume 15111 of Lecture Notes in Computer Science, pp. 73–88. Springer Nature Switzerland, 2024. doi:10.1007/978-3-031-73668-1_5.
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. GANs trained by a two time-scale update rule converge to a local Nash equilibrium. In Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017.
Jonathan Ho and Tim Salimans. Classifier-free diffusion guidance. In NeurIPS 2021 Workshop on Deep Generative Models and Downstream Applications, 2021. URL https://openreview.net/forum?id=qw8AKxfYbI.
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems, volume 33, pp. 6840–6851, 2020.
Chia-Yi Hsu, Yu-Lin Tsai, Chulin Xie, Chih-Hsun Lin, Jia-You Chen, Bo Li, Pin-Yu Chen, Chia-Mu Yu, and Chun-Ying Huang. Ring-A-Bell! How reliable are concept removal methods for diffusion models? In International Conference on Learning Representations, pp. 41543–41554, 2024.
Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. LoRA: Low-rank adaptation of large language models. In International Conference on Learning Representations, 2022.
Ryotaro Kawata, Kazusato Oko, Atsushi Nitanda, and Taiji Suzuki. Direct distributional optimization for provable alignment of diffusion models. In International Conference on Learning Representations, pp. 72792–72840, 2025.
Xinfeng Li, Yuchen Yang, Jiangyi Deng, Chen Yan, Yanjiao Chen, Xiaoyu Ji, and Wenyuan Xu. SafeGen: Mitigating sexually explicit content generation in text-to-image models. In Proceedings of the 2024 ACM SIGSAC Conference on Computer and Communications Security, pp. 4807–4821. Association for Computing Machinery, 2024. doi: 10.1145/3658644.3670295.
Zhanhao Liang, Yuhui Yuan, Shuyang Gu, Bohan Chen, Tiankai Hang, Mingxi Cheng, Ji Li, and Liang Zheng. Aesthetic post-training diffusion models from generic preferences with step-by-step preference optimization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 13199–13208, 2025. doi: 10.1109/cvpr52734.2025.01232.
Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C. Lawrence Zitnick. Microsoft COCO: Common objects in context. In Computer Vision – ECCV 2014, volume 8693 of Lecture Notes in Computer Science, pp. 740–755. Springer International Publishing, 2014. doi: 10.1007/978-3-319-10602-1_48.
Runtao Liu, Ashkan Khakzar, Jindong Gu, Qifeng Chen, Philip Torr, and Fabio Pizzati. Latent Guard: A safety framework for text-to-image generation. In Computer Vision – ECCV 2024, volume 15084 of Lecture Notes in Computer Science, pp. 93–109. Springer Nature Switzerland, 2024. doi: 10.1007/978-3-031-73347-5_6.
Runtao Liu, I Chieh Chen, Jindong Gu, Jipeng Zhang, Renjie Pi, Qifeng Chen, Philip Torr, Ashkan Khakzar, and Fabio Pizzati. AlignGuard: Scalable safety alignment for text-to-image generation. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 17024–17034, 2025.
Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2019.
Shilin Lu, Zilan Wang, Leyang Li, Yanzhu Liu, and Adams Wai-Kin Kong. MACE: Mass concept erasure in diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 6430–6440, 2024. doi: 10.1109/cvpr52733.2024.00615.
Ji-Hoon Park, Yeong-Joon Ju, and Seong-Whan Lee. Explaining generative diffusion models via visual analysis for interpretable decision-making process. Expert Systems with Applications, 248:123231, 2024. doi: 10.1016/j.eswa.2024.123231.
Gaurav Parmar, Richard Zhang, and Jun-Yan Zhu. On aliased resizing and surprising subtleties in GAN evaluation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 11400–11410. IEEE, 2022. doi: 10.1109/CVPR52688.2022.01112.
Minh Pham, Kelly O. Marshall, Niv Cohen, Govind Mittal, and Chinmay Hegde. Circumventing concept erasure methods for text-to-image generative models. In International Conference on Learning Representations, pp. 1156–1181, 2024.
Dustin Podell, Zion English, Kyle Lacey, Andreas Blattmann, Tim Dockhorn, Jonas Müller, Joe Penna, and Robin Rombach. SDXL: Improving latent diffusion models for high-resolution image synthesis. In International Conference on Learning Representations, pp. 1862–1874, 2024.
Yiting Qu, Xinyue Shen, Xinlei He, Michael Backes, Savvas Zannettou, and Yang Zhang. Unsafe diffusion: On the generation of unsafe images and hateful memes from text-to-image models. In Proceedings of the 2023 ACM SIGSAC Conference on Computer and Communications Security, pp. 3403–3417. Association for Computing Machinery, 2023. doi: 10.1145/3576915.3616679.
Yiting Qu, Xinyue Shen, Yixin Wu, Michael Backes, Savvas Zannettou, and Yang Zhang. UnsafeBench: Benchmarking image safety classifiers on real-world and AI-generated images. In Proceedings of the 2025 ACM SIGSAC Conference on Computer and Communications Security, pp. 3221–3235. Association for Computing Machinery, 2025. doi: 10.1145/3719027.3765088.
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. In Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pp. 8748–8763. PMLR, 2021.
Rafael Rafailov, Archit Sharma, Eric Mitchell, Stefano Ermon, Christopher D. Manning, and Chelsea Finn. Direct preference optimization: Your language model is secretly a reward model. In Advances in Neural Information Processing Systems, volume 36, pp. 53728–53741, 2023. doi: 10.52202/075280-2338.
Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 10674–10685, 2022. doi:10.1109/CVPR52688.2022.01042.
Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kam-yar Seyed Ghasemipour, Burcu Karagol Ayan, S. Sara Mahdavi, Raphael Gontijo-Lopes, Tim Salimans, Jonathan Ho, David J. Fleet, and Mohammad Norouzi. Photorealistic text-to-image diffusion models with deep language understanding. In Advances in Neural Information Processing Systems, volume 35, pp. 36479–36494, 2022. doi: 10.52202/068431-2643.
Patrick Schramowski, Christopher Tauchmann, and Kristian Kersting. Can machines help us answering question 16 in datasheets, and in turn reflecting on inappropriate content? In Proceedings of the 2022 ACM Conference on Fairness, Accountability, and Transparency, pp. 1350–1361. Association for Computing Machinery, 2022. doi: 10.1145/3531146.3533192.
Patrick Schramowski, Manuel Brack, Björn Deiseroth, and Kristian Kersting. Safe latent diffusion: Mitigating inappropriate degeneration in diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 22522–22531, 2023. doi:10.1109/cvpr52729.2023.02157.
Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. In International Conference on Learning Representations, 2021.
Bram Wallace, Meihua Dang, Rafael Rafailov, Linqi Zhou, Aaron Lou, Senthil Purushwalkam, Stefano Ermon, Caiming Xiong, Shafiq Joty, and Nikhil Naik. Diffusion model alignment using direct preference optimization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 8228–8238, 2024. doi: 10.1109/cvpr52733.2024.00786.
Fu-Yun Wang, Yunhao Shui, Jingtan Piao, Keqiang Sun, and Hongsheng Li. Diffusion-NPO: Negative preference optimization for better preference aligned generation of diffusion models. In International Conference on Learning Representations, pp. 71440–71462, 2025.
Xun Wu, Shaohan Huang, Lingjie Jiang, and Furu Wei. Rethinking DPO-style diffusion aligning frameworks. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 18068–18077, 2025. doi: 10.1109/iccv51701.2025.01679.
You Wu, Beier Zhu, and Chi Zhang. SafetyBPO: Bidirectional preference optimization for safe text-to-image generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Findings, pp. 4759–4768, 2026.
Zongyu Wu, Hongcheng Gao, Yueze Wang, Xiang Zhang, and Suhang Wang. Universal prompt optimizer for safe text-to-image generation. In Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pp. 6340–6354. Association for Computational Linguistics, 2024. doi: 10.18653/v1/2024.naacl-long.351.
Kai Yang, Jian Tao, Jiafei Lyu, Chunjiang Ge, Jiaxin Chen, Weihan Shen, Xiaolong Zhu, and Xiu Li. Using human feedback to fine-tune diffusion models without any reward model. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 8941–8951, 2024a. doi: 10.1109/cvpr52733.2024.00854.
Yijun Yang, Ruiyuan Gao, Xiaosen Wang, Tsung-Yi Ho, Nan Xu, and Qiang Xu. MMA-Diffusion: MultiModal attack on diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 7737–7746, 2024b.
Yuchen Yang, Bo Hui, Haolin Yuan, Neil Gong, and Yinzhi Cao. SneakyPrompt: Jailbreaking text-to-image generative models. In 2024 IEEE Symposium on Security and Privacy (SP), pp. 897–912. IEEE, 2024c. doi: 10.1109/SP54263.2024.00123.
Jaehong Yoon, Shoubin Yu, Vaidehi Ramesh Patil, Huaxiu Yao, and Mohit Bansal. SAFREE: Training-free and adaptive guard for safe text-to-image and video generation. In International Conference on Learning Representations, pp. 56439–56465, 2025.
Chenyu Zhang, Mingwang Hu, Wenhui Li, and Lanjun Wang. Adversarial attacks and defenses on text-to-image diffusion models: A survey. Information Fusion, 114:102701, 2025a. doi:10.1016/j.inffus.2024.102701.
Tao Zhang, Cheng Da, Kun Ding, Huan Yang, Kun Jin, Yan Li, Tingting Gao, Di Zhang, Shiming Xiang, and Chunhong Pan. Diffusion model as a noise-aware latent reward model for step-level preference optimization. In Advances in Neural Information Processing Systems, volume 38, pp. 117621–117654, 2025b. doi: 10.52202/085713-3545.
Huaisheng Zhu, Teng Xiao, and Vasant G. Honavar. DSPO: Direct score preference optimization for diffusion model alignment. In International Conference on Learning Representations, pp. 51112–51133, 2025.
A SUPPLEMENTARY MATERIAL
The supplement provides SaTPO implementation details, evaluation protocols, category-level safety results, exposure-type counts, fixed adversarial-prompt comparisons, and an exploratory local-candidate diagnostic.
B SATPO IMPLEMENTATION DETAILS
B.1 TRAINING ALGORITHM
Algorithm 1 summarizes candidate collection and policy optimization. The shared-state construction follows Equation (4); safety-pair log-ratios use the original unsafe prompt, whereas benign replay uses the corresponding benign prompt.
Algorithm 1 Safety Transition Preference Optimization (SaTPO)
Input Prompt pairs , frozen model , benign bank , denoising grid , training budget Output Adapted policy
1: with trainable LoRA parameters
2: for each prompt-pair batch within the budget do
3: ; for each
4: for in denoising order do
5: for each // Shared step noise
6:
7:
8: end for
9: // Frozen candidate records
10: for each shuffled minibatch of positive-weight pairs from do
11: for ,
12:
13: ;
14: by Equation (13)
15: four cached transitions of one deterministically selected benign record
16:
17:
18:
19:
20: end for
21: end for
22: return
B.2 DATA AND TRAINING CONFIGURATION
CoProPV uses the 10,983 CoProV2 training prompt pairs for each backbone. Images are regenerated with paired seeds and labeled with PerspectiveVision. The retained risk categories are sexual content, violence, hate, harassment, self-harm, illegal activity, and shocking content. A pair is eligible only if the safe-rewrite image receives a Safe label and the original-prompt image receives an Unsafe label in one of these categories. This yields 3,351 pairs for SD-v1.5 and 3,944 for SDXL. No CLIP threshold or category reweighting is used.
Table 6 specifies the configurations associated with the checkpoints in the quantitative comparisons of Section 5. Both start from their respective base models. SD-v1.5 trains for two epochs on Co-ProPV and SDXL for one epoch.
Training uses AdamW with moment coefficients (0.9, 0.999), numerical constant , weight decay , and gradient norm clipping at 1.0. The sampling grid retains the backbone’s original noise
Table 6: SaTPO training settings for the evaluated checkpoints. Penalty parameters refer to Equations (6)–(11).
| Setting | SD-v1.5 | SDXL |
|---|---|---|
| Training resolution | ||
| Collected denoising steps | ||
| DDIM stochasticity /CFG scale | ||
| Sampling batch / pair minibatch | ||
| LoRA rank | ||
| Learning rate | ||
| Recorded global step | ||
| Preference / clipping | ||
| Local radius | ||
| Local sharpness / weight | ||
| Common radius | ||
| Common sharpness / weight | ||
| Benign radius | ||
| Benign sharpness / weight | ||
| Benign-bank prompts / transitions per prompt |
indices. Candidate records contain all 20 collected steps, whereas the preference minibatches retain the 15 steps with positive . The local penalty uses these same minibatches without timestep weighting and the common-drift penalty uses the entire record. Cached benign transitions use zero-based sampling positions . One benign prompt record supplies four transitions per update. The replay banks use their corresponding frozen backbones and cached reference log-probabilities under the same CFG and stochastic sampler conventions.
The components of drift control and benign replay use distinct reductions. Local and benign penalties use directly, while the common penalty uses . Dividing all terms by their sharpness without rescaling their weights would change the implemented objective. Clipping in Equation (5) applies to per-dimension log-ratios, so the exponentiated clipped quantity is a geometric-mean density ratio, not the joint latent density ratio.
The SDXL training implementation retains latent-reward scoring for diagnostics, but prompt-source indices determine the training pairs. SD-v1.5 constructs pairs without loading this diagnostic model. Reward scores therefore do not enter preference optimization.
Table 7: Training time under each method's reported hardware and configuration. All entries use one GPU. AlignGuard and SafetyBPO values come from their original papers; SaTPO values come from our training records. GPU-hours do not normalize hardware performance.
| Method | Single GPU | Training time (GPU-hours) | |
|---|---|---|---|
| SD-v1.5 | SDXL | ||
| AlignGuard | RTX 5880 Ada | ||
| SafetyBPO | RTX 4090 | Not reported | |
| SaTPO | A800 80GB | ||
Table 7 compares the reported training times under each method's own hardware and configuration.
B.3 GRADIENT ESTIMATION FOR THE COMMON-DRIFT PENALTY
For a fixed record with , let and . The derivative of the normalized smooth penalty is
At the current parameters, we evaluate and without retaining a computation graph. We then sample a subset of steps uniformly without replacement and use
where sg stops gradients. Each step has inclusion probability , so the expectation of the scaled gradient sum is . Multiplication by the freshly evaluated gives the chain-rule gradient of the full-record penalty. The surrogate has the desired expected gradient conditional on the fixed record, its scalar value is not the exact penalty value. Multiplying its gradient by yields the term used in Equation (11). This construction reduces the number of steps retaining gradient graphs, while still requiring forward evaluation of all steps on the selected record.
B.4 TRANSITION-DENSITY CONVENTIONS
The policy and reference use the same DDIM variance at each evaluated step, with during training. Log-probabilities are averaged over the spatial and channel dimensions, as reflected by in Equation (3). The sampler's terminal-index convention is kept fixed across candidate generation and likelihood evaluation, the collected grid is distinguished from an optional final decoding operation. Shared perturbations yield .
Given ordered pairs , the basic objective is
where scales the preference logit and sigmoid( . The superscripts and denote the supplied ordering. Candidate construction and preference assignment determine the supervision.
C EVALUATION PROTOCOL AND ADDITIONAL RESULTS
C.1 DATASET CONSTRUCTION AND EVALUATION SCOPE
I2P. The official Inappropriate Image Prompts benchmark (Schramowski et al., 2023) contains 4,703 source rows. I2P-5000 retains all rows and adds 297 deterministic extra-seed evaluations, for a total of 4,462 distinct prompt strings. Each evaluation is assigned one primary prompt category. The counts are harassment (682 evaluations), hate (247), illegal activity (719), self-harm (739), sexual (935), shocking (896), and violence (782). These strata describe the source prompts, detectors assess all applicable unsafe outcomes within each stratum. Overall rates are weighted by the number of evaluations in each category.
Unsafe Diffusion. UD-934 (Qu et al., 2023) uses every harmful prompt in the pinned Unsafe Prompts&Images Dataset archive, comprising 500 from 4chan, 404 from Lexica, and 30 template prompts. These are 934 distinct prompts with one generation each. The count differs from the 932 reported by AlignGuard because we retain the complete pinned source archive. COCO captions from that archive are not part of UD-934.
NSFW-Sexual-1k and COCO. NSFW-Sexual-1k is an experiment-specific subset name. We sample 1,000 rows without replacement from the 56,000 nonempty prompts in SafeGen's distributed NSFW-56k file (Li et al., 2024), using selection seed 20260904. COCO-5000 (Lin et al., 2014) uses all 5,000 real val2017 images and a fixed caption per image, with selection seed 20260823. All methods within a backbone share these prompt–seed records.
C.2 BASELINE AND GENERATION SETTINGS
AlignGuard is evaluated from its released full SD-v1.5 and SDXL checkpoints. SafetyBPO uses its released SD-v1.5 positive model and negative LoRA with its dual-guidance inference rule. SLD-Medium and SLD-Max use the official guidance presets on SD-v1.5. ESD-u and UCE are reproduced on the exact evaluated backbone. We port RECE and SAFREE to SD-v1.5.
The SD-v1.5 ESD-u, UCE, and RECE checkpoints target the seven risk categories on both broad-safety sets and NSFW-Sexual-1k. SDXL ESD-u uses a joint seven-category extension on I2P and
UD and a separate single-nudity checkpoint on NSFW-Sexual-1k. SAFREE uses its nudity/sexual setting and appears only on NSFW-Sexual-1k in the main table.
SD-v1.5 generation uses DDIM50 with , resolution, and FP16. SDXL uses Euler20 at , FP16, its fixed FP16-compatible VAE, and no refiner. CFG is 7.5 for both. Negative prompts are omitted. SDXL uses zero unconditional embeddings for the empty condition. The output safety checker is disabled so that detectors evaluate the generated images before output filtering. The native safeguard or guidance mechanism of each baseline remains active. The main and adversarial tables use the SDXL 14,809-step epoch-completion checkpoint and the SD-v1.5 12,568-step checkpoint. Figure 4 uses these same checkpoints.
In Figure 4, each column matches prompts and seeds across methods within a backbone. Display categories follow the Base image's PV label. The selection illustrates baseline failures. Black overlays appear only in the figure, detector evaluation uses the unobscured images.
C.3 METRIC DEFINITIONS
For generated image , let , , denote the binary PV, Q16, and NudeNet outcomes. PV counts an image only when its output is Unsafe and its assigned category belongs to the seven target categories. Q16 uses the official learned inappropriate/appropriate prompt embeddings with CLIP ViT-L/14. when the inappropriate class wins the two-class argmax. Reported Q16 rates aggregate these binary image labels.
NudeNet version 3.0.8 (Bedapudi, 2023) uses the bundled detector and its default detection processing. when at least one returned detection indicates exposed female or male genitalia (FEMALE_GENITALIA_EXPOSED or MALE_GENITALIA_EXPOSED). We compute IP following AlignGuard and define ASR by additionally including PV.
PV, Q16, and NudeNet rates use the corresponding indicator in the same percentage formula. ASR is our evaluator-side composite for the fixed attack sets, the original attack papers use their own success criteria.
CLIP is the mean unscaled cosine similarity between normalized image and caption embeddings from CLIP ViT-L/14. FID uses Clean-FID 0.1.35 in clean mode, comparing the generated image distribution with the same 5,000 real COCO images for each method. CLIP measures caption alignment, while FID measures distributional similarity for benign generation.
C.4 I2P RESULTS BY PROMPT CATEGORY
Tables 8 and 9 report IP, PV, and Q16 for each prompt category. SDXL SaTPO is below Align-Guard on all three metrics in each stratum. The overall columns use the same evaluation counts and weighting as Table 1.
C.5 EXPOSURE-TYPE COUNTS ON BOTH BACKBONES
Tables 10 and 11 list exposure classes for both backbones. On SD-v1.5, NudeNet flags genital exposure in 3 SaTPO images, compared with 19 for AlignGuard and 13 for SafetyBPO. On SDXL, NudeNet flags 26 SaTPO images for female-breast exposure and 21 for buttock exposure, compared with 64 and 58 for AlignGuard. Its genital union is 9 images versus 13 for AlignGuard. Each image is counted at most once in each exposure class.
C.6 FIXED ADVERSARIAL-PROMPT EVALUATION
MMA-Diffusion uses 1,000 released adversarial prompts. Ring-A-Bell uses 79 nudity-targeting sensitive prompts. SneakyPrompt uses the complete 200-row meaningful cohort, comprising 124 attack-perturbed prompts and 76 zero-query source-filter bypasses whose text was not perturbed. We evaluate all 200 rows with fixed seeds, retaining both the perturbed attacks and unperturbed source-filter bypasses.
Table 8: SD-v1.5 category-wise detection rates on I2P-5000 (%, ↓). Bold and underline rank methods within each metric and category. Category sizes, in column order, are 682, 247, 719, 739, 935, 896, and 782. Overall is sample-weighted over 5,000 images.
| Method (IP) | Harass. | Hate | Illegal | Self-harm | Sexual | Shocking | Violence | Overall |
|---|---|---|---|---|---|---|---|---|
| Base | 31.23 | 38.87 | 35.33 | 40.60 | 23.74 | 54.46 | 43.35 | 38.24 |
| SLD-Medium | 16.42 | 19.84 | 14.05 | 15.56 | 6.74 | 32.81 | 21.48 | 18.04 |
| SLD-Max | 6.01 | 5.26 | 4.17 | 4.87 | 1.50 | 11.50 | 7.80 | 5.96 |
| ESD-u | 27.86 | 36.03 | 32.82 | 37.08 | 24.28 | 48.10 | 40.15 | 35.22 |
| UCE | 27.27 | 34.82 | 26.56 | 31.12 | 18.18 | 47.54 | 34.65 | 31.20 |
| RECE | 17.30 | 22.67 | 15.02 | 13.67 | 11.12 | 23.55 | 18.67 | 16.88 |
| AlignGuard | 13.20 | 14.98 | 9.60 | 11.37 | 6.31 | 14.62 | 14.58 | 11.68 |
| SafetyBPO | 4.55 | 9.72 | 4.87 | 7.98 | 1.28 | 11.61 | 4.22 | 5.96 |
| SaTPO | 8.94 | 9.31 | 5.01 | 3.92 | 2.46 | 6.36 | 4.99 | 5.36 |
| Method (PV) | Harass. | Hate | Illegal | Self-harm | Sexual | Shocking | Violence | Overall |
| Base | 15.84 | 19.43 | 39.50 | 33.96 | 56.47 | 42.75 | 46.29 | 39.28 |
| SLD-Medium | 8.65 | 8.91 | 24.76 | 15.16 | 28.24 | 27.23 | 34.78 | 23.02 |
| SLD-Max | 4.40 | 3.24 | 14.33 | 3.25 | 8.66 | 10.71 | 18.80 | 9.78 |
| ESD-u | 17.89 | 20.24 | 36.02 | 28.82 | 49.30 | 39.84 | 42.97 | 35.96 |
| UCE | 14.37 | 16.19 | 31.99 | 22.33 | 38.40 | 36.27 | 34.27 | 29.70 |
| RECE | 6.74 | 9.31 | 11.13 | 6.50 | 6.31 | 11.05 | 12.92 | 9.12 |
| AlignGuard | 6.30 | 3.64 | 16.55 | 6.50 | 16.90 | 10.38 | 21.10 | 12.70 |
| SafetyBPO | 4.40 | 4.45 | 20.58 | 6.50 | 5.78 | 12.17 | 22.89 | 11.58 |
| SaTPO | 3.52 | 5.26 | 9.87 | 1.76 | 5.24 | 5.69 | 10.10 | 6.00 |
| Method (Q16) | Harass. | Hate | Illegal | Self-harm | Sexual | Shocking | Violence | Overall |
| Base | 30.35 | 37.65 | 35.05 | 38.84 | 20.00 | 51.67 | 43.22 | 36.54 |
| SLD-Medium | 15.84 | 19.43 | 13.21 | 14.75 | 4.71 | 31.14 | 21.10 | 16.96 |
| SLD-Max | 5.72 | 4.86 | 3.48 | 4.06 | 1.07 | 10.27 | 7.67 | 5.36 |
| ESD-u | 26.69 | 35.63 | 32.27 | 34.51 | 20.86 | 46.21 | 39.39 | 33.48 |
| UCE | 26.39 | 33.60 | 26.15 | 28.69 | 14.76 | 45.76 | 33.89 | 29.52 |
| RECE | 17.16 | 22.67 | 14.60 | 12.99 | 10.70 | 22.66 | 18.41 | 16.42 |
| AlignGuard | 13.05 | 14.98 | 8.76 | 10.01 | 5.35 | 12.61 | 14.07 | 10.72 |
| SafetyBPO | 3.67 | 8.91 | 4.31 | 5.55 | 0.75 | 9.38 | 3.96 | 4.82 |
| SaTPO | 8.36 | 9.31 | 4.59 | 3.65 | 2.25 | 4.80 | 4.35 | 4.76 |
Table 9: SDXL category-wise detection rates on I2P-5000 (%, ↓). Bold and underline rank methods within each metric and category. Category sizes, in column order, are 682, 247, 719, 739, 935, 896, and 782. Overall is sample-weighted over 5,000 images.
| Method (IP) | Harass. | Hate | Illegal | Self-harm | Sexual | Shocking | Violence | Overall |
|---|---|---|---|---|---|---|---|---|
| Base | 29.18 | 37.65 | 33.52 | 40.60 | 16.58 | 47.10 | 34.78 | 33.64 |
| ESD-u | 27.86 | 40.08 | 33.66 | 40.19 | 15.40 | 45.65 | 35.04 | 33.10 |
| AlignGuard | 8.21 | 6.07 | 10.57 | 12.04 | 3.85 | 14.06 | 9.34 | 9.42 |
| LPO | 26.98 | 41.70 | 28.09 | 37.62 | 14.33 | 43.30 | 31.84 | 30.76 |
| SaTPO | 3.96 | 5.67 | 4.45 | 5.82 | 2.35 | 8.26 | 5.63 | 5.12 |
| Method (PV) | Harass. | Hate | Illegal | Self-harm | Sexual | Shocking | Violence | Overall |
| Base | 22.14 | 28.74 | 42.14 | 30.31 | 34.55 | 45.20 | 45.27 | 36.62 |
| ESD-u | 22.14 | 28.34 | 41.86 | 29.23 | 32.73 | 43.19 | 44.50 | 35.58 |
| AlignGuard | 6.60 | 4.45 | 25.17 | 10.28 | 11.98 | 16.41 | 23.02 | 15.04 |
| LPO | 23.31 | 25.91 | 38.80 | 26.39 | 33.05 | 41.74 | 40.92 | 34.00 |
| SaTPO | 2.49 | 3.24 | 16.27 | 4.60 | 6.52 | 10.71 | 16.88 | 9.30 |
| Method (Q16) | Harass. | Hate | Illegal | Self-harm | Sexual | Shocking | Violence | Overall |
| Base | 28.59 | 37.65 | 32.68 | 39.38 | 14.87 | 44.98 | 34.53 | 32.52 |
| ESD-u | 27.27 | 39.68 | 33.10 | 38.84 | 14.01 | 43.64 | 34.65 | 32.04 |
| AlignGuard | 8.06 | 6.07 | 9.74 | 11.23 | 2.67 | 12.39 | 8.95 | 8.58 |
| LPO | 26.69 | 41.30 | 27.82 | 35.99 | 13.16 | 40.40 | 31.46 | 29.62 |
| SaTPO | 3.08 | 4.45 | 4.03 | 5.14 | 1.82 | 6.03 | 4.48 | 4.10 |
Table 10: SD-v1.5 NudeNet exposure counts on 1,000 NSFW-Sexual-1k images. Each class is counted once per image; classes may overlap. Bold and underline indicate the lowest and next distinct counts, not a ranking of safety for non-genital regions.
| Exposed region | Base | SLD-Medium | SLD-Max | SAFREE | ESD-u | UCE | RECE | AlignGuard | SafetyBPO | SaTPO |
|---|---|---|---|---|---|---|---|---|---|---|
| Buttocks | 234 | 199 | 102 | 66 | 163 | 108 | 6 | 29 | 16 | |
| Female breast | 400 | 283 | 70 | 77 | 281 | 293 | 30 | 15 | ||
| Female genitalia | 74 | 46 | 11 | 17 | 52 | 41 | 6 | |||
| Male breast | 85 | 82 | 31 | 54 | 80 | 46 | 6 | |||
| Anus | 6 | 4 | ||||||||
| Feet | 185 | 139 | 88 | 185 | 187 | 125 | 151 | 94 | ||
| Armpits | 535 | 512 | 421 | 277 | 479 | 458 | 288 | 158 | ||
| Belly | 306 | 298 | 161 | 164 | 241 | 270 | 84 | |||
| Male genitalia | 144 | 117 | 38 | 58 | 107 | 90 | 15 | 2 | ||
| Genital union | 208 | 153 | 48 | 75 | 155 | 124 | 15 | 19 | 3 | |
| Any exposed class | 836 | 756 | 569 | 528 | 740 | 700 | 439 | 237 |
Table 11: SDXL NudeNet exposure counts on 1,000 NSFW-Sexual-1k images. Each class is counted once per image; classes may overlap. Bold and underline indicate the lowest and next distinct counts, not a ranking of safety for non-genital regions.
| Exposed region | Base | SAFREE | ESD-u | AlignGuard | LPO | SaTPO |
|---|---|---|---|---|---|---|
| Buttocks | 102 | 61 | 98 | 115 | ||
| Female breast | 178 | 165 | 188 | |||
| Female genitalia | 26 | 21 | 8 | 16 | ||
| Male breast | 36 | 12 | 35 | 21 | ||
| Anus | ||||||
| Feet | 184 | 188 | 173 | 164 | ||
| Armpits | 477 | 457 | 448 | 470 | ||
| Belly | 242 | 158 | 233 | 226 | ||
| Male genitalia | 7 | 10 | 9 | |||
| Genital union | 33 | 30 | 13 | 25 | ||
| Any exposed class | 663 | 638 | 597 | 655 |
Table 12 reports the individual detectors and composite ASR. SaTPO has the lowest PV and composite ASR in each cohort, with IP lowest or tied for lowest.
Table 12: Fixed-prompt adversarial evaluation (%, ↓). ASR is PV∪IP; NN denotes NudeNet. Bold and underline rank methods within each backbone, attack, and metric. MMA-Diffusion, Ring-A-Bell, and SneakyPrompt use 1,000, 79, and 200 prompts, respectively.
| Method | MMA-Diffusion | Ring-A-Bell | SneakyPrompt | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ASR | PV | Q16 | NN | IP | ASR | PV | Q16 | NN | IP | ASR | PV | Q16 | NN | IP | ||
| SD-V1 | Base | 93.90 | 92.90 | 19.90 | 36.20 | 48.70 | 93.67 | 88.61 | 15.19 | 17.72 | 32.91 | 76.50 | 73.00 | 27.50 | 11.00 | 34.00 |
| AlignGuard | 22.50 | 20.70 | 41.77 | 37.97 | 3.80 | 5.06 | 8.86 | 20.50 | 19.50 | 2.00 | ||||||
| SafetyBPO | 15.70 | 14.00 | 3.80 | 4.00 | 1.00 | |||||||||||
| SaTPO | 6.80 | 6.20 | 0.30 | 1.20 | 1.27 | 0.00 | 0.00 | 1.27 | 1.27 | 3.00 | 3.00 | 0.00 | 0.00 | 0.00 | ||
| SDXL | Base | 68.50 | 65.80 | 18.50 | 20.70 | 79.75 | 75.95 | 8.86 | 13.92 | 21.52 | 64.00 | 60.00 | 20.00 | 1.50 | ||
| AlignGuard | 18.80 | 18.00 | 49.37 | 49.37 | ||||||||||||
| SaTPO | 4.20 | 3.30 | 1.00 | 7.59 | 5.06 | 0.00 | 2.53 | 5.50 | 4.50 | 0.50 | 1.00 | |||||
C.7 ADDITIONAL QUALITATIVE COMPARISONS
Figures 7 and 8 supplement the qualitative comparison in Figure 4 with additional examples on both backbones.
C.8 LPO SAFETY ADAPTATION
SafetyLRM adapts LPO's noise-aware latent reward architecture (Zhang et al., 2025b) to safety preferences. Both reward models use the 10,983 training pairs of original CoProV2-SDXL images, before CoProPV regeneration and qualification. The pairwise cross-entropy objective favors the image associated with the safe rewrite over its unsafe-prompt counterpart, evaluating both under the original unsafe prompt. Each pair uses a shared timestep sampled from and independent noise for its two images. We train the corresponding SDXL and SD-v1.5 architectures for 30,000 updates with batch size 1, Adafactor, learning rate , and weight decay 0.01, at resolutions and , respectively.
Reward modeling uses the original CoProV2 images, policy training uses backbone-specific Co-ProPV subsets obtained by regenerating and qualifying images from the same source prompt pairs.
The SDXL LPO baseline ranks four candidates at each of 20 stochastic DDIM steps with our safety-trained SDXL reward model. It retains LPO's variance-dependent acceptance threshold and clipped DPO update. Training uses the 3,944 CoProPV prompt pairs, one epoch, LoRA rank 64, CFG 7.5, , clipping , and learning rate . The threshold ranges from 0.45 to 0.60. SafetyLRM scores child latents with the parent timestep, as in the LPO sampling convention. Filtering accepts 1,622 of 78,880 candidate comparisons, yielding 540 optimizer updates over one epoch. This native acceptance budget differs from SaTPO in both update count and computation.
On COCO-5000, SDXL LPO obtains CLIP 0.2686 and FID 28.08. Relative to SaTPO's 0.2602 and 27.51, this adaptation retains higher caption alignment but has higher FID and substantially higher unsafe-detection rates.
For SD-v1.5, the same four-candidate procedure uses rank 8, two epochs, and thresholds from 0.35 to 0.50. The trained policy at LoRA scale 1.0 exhibits severe quality degradation, with COCO CLIP 0.1653 and FID 207.57 (Table 13). The low PV rate accompanies degraded generation.
Separate calibration and confirmation evaluations select scale 0.5, recovering CLIP to 0.2625 and FID to 32.54, but I2P-5000 IP remains , compared with SaTPO's .
C.9 CANDIDATE AND SCHEDULE ABLATION DETAILS
The SD-v1.5 controls retain the main model's data, initialization, optimizer, replay bank, and 12,568-step budget. The benign-replay ablation removes only . The reverse schedule applies on , changing both weights and their nonzero support. Table 14 adds Q16 and NudeNet to the PV, IP, and COCO results in Tables 4(a) and 4(b).
Table 13: SD-v1.5 LPO with SafetyLRM at the original scale 1.0 and independently calibrated scale 0.5, using the same policy. Detection rates (%, ↓) and COCO-5000 quality.
| Dataset | Scale | PV | Q16 | NudeNet | IP |
|---|---|---|---|---|---|
| I2P-5000 | 1.0 | 2.20 | 37.84 | 0.06 | 37.86 |
| I2P-5000 | 0.5 | 28.28 | 34.02 | 2.46 | 35.58 |
| UD-934 | 1.0 | 1.50 | 40.47 | 0.00 | 40.47 |
| UD-934 | 0.5 | 31.69 | 43.58 | 3.32 | 45.07 |
| NSFW-Sexual-1k | 1.0 | 7.40 | 29.50 | 0.20 | 29.60 |
| NSFW-Sexual-1k | 0.5 | 85.50 | 22.50 | 11.60 | 29.70 |
| COCO-5000 | CLIP ↑ | FID ↓ | |||
| 1.0 | 0.1653 | 207.57 | |||
| 0.5 | 0.2625 | 32.54 | |||
Table 14: SD-v1.5 I2P-5000 ablations (12,568 steps; %, ↓).
| Variant | Q16 | NudeNet |
|---|---|---|
| w/o | 2.30 | 0.38 |
| Reverse | 14.14 | 2.14 |
| SaTPO | 4.76 | 0.68 |
For multistep construction, both branches reset to the same unsafe-prompt parent every steps, then evolve under their respective conditions using shared step noise. Policy and reference likelihoods use each branch's own parent and the original unsafe prompt. Other losses are unchanged.
Figure 6 illustrates the SDXL DT control, which retains separate parents throughout denoising while sharing initial and per-step noise.
Its matched SaTPO control changes parent sharing, retaining the 3,944 pairs, initialization, objective, optimizer, replay bank, loss weights, and 8,839-step budget. Table 15 reports all four detection metrics.
Table 15: SDXL ablation of parent-state sharing at 8,839 training steps. Detection rates (%, ↓).
| Variant | I2P-5000 | UD-934 | ||||||
|---|---|---|---|---|---|---|---|---|
| PV | Q16 | NudeNet | IP | PV | Q16 | NudeNet | IP | |
| DT | 12.40 | 7.40 | 0.90 | 8.20 | 11.56 | 8.03 | 0.64 | 8.67 |
| SaTPO | 9.80 | 4.56 | 1.20 | 5.74 | 8.46 | 3.85 | 1.18 | 5.03 |

Figure 6: Dual-trajectory (DT) candidate construction.
C.10 SAFETYLRM DIAGNOSTIC OF LOCAL CANDIDATES
We group source pairs by the PerspectiveVision labels of their safe-rewrite and unsafe-prompt images into Safe/Safe, Safe/Unsafe, Unsafe/Unsafe, and Unsafe/Safe. We evaluate 140 pairs per group with one seed each at eight parent timesteps, yielding 4,480 comparisons across all four groups. Frozen SDXL constructs paired child latents from a shared unsafe-prompt parent state using shared noise. SafetyLRM scores both under the original unsafe prompt at the parent timestep, candidate identities follow prompt source. These scores are diagnostic.
Table 16 reports nonnegative-gap frequencies and mean gaps. Aggregate agreement rates are 84.73% for Safe/Safe, 87.41% for Safe/Unsafe, 83.84% for Unsafe/Unsafe, and 79.91% for Unsafe/Safe. Thus, SafetyLRM generally agrees with the prompt-assigned order, including for pairs with reversed complete-image labels. Mean score gaps decrease toward later denoising, while agreement exceeds 50% in every group–timestep combination.
Table 16: SafetyLRM diagnostic (140 pairs per group). Pref. is agreement with prompt-source ordering (%, including ties); Gap is the mean score for the safe-rewrite candidate minus that for the unsafe-prompt candidate. Groups follow the corresponding complete-image PV labels.
| Parent t | Safe/Safe | Safe/Unsafe | Unsafe/Unsafe | Unsafe/Safe | ||||
|---|---|---|---|---|---|---|---|---|
| Pref. | Gap | Pref. | Gap | Pref. | Gap | Pref. | Gap | |
| 951 | 85.71 | +2.3553 | 92.14 | +3.2182 | 87.86 | +2.7746 | 87.14 | +2.1221 |
| 851 | 86.43 | +1.5343 | 87.86 | +2.4755 | 85.00 | +1.6670 | 78.57 | +1.4626 |
| 751 | 85.00 | +0.7654 | 86.43 | +1.2624 | 90.71 | +0.8521 | 77.86 | +0.6379 |
| 651 | 82.86 | +0.3561 | 88.57 | +0.7382 | 80.00 | +0.4452 | 75.00 | +0.2521 |
| 601 | 77.86 | +0.2598 | 83.57 | +0.5237 | 79.29 | +0.3121 | 75.71 | +0.2282 |
| 501 | 85.00 | +0.2245 | 85.00 | +0.3022 | 81.43 | +0.2271 | 83.57 | +0.1536 |
| 351 | 87.86 | +0.1117 | 90.00 | +0.1608 | 83.57 | +0.1259 | 83.57 | +0.0766 |
| 101 | 87.14 | +0.0534 | 85.71 | +0.0655 | 82.86 | +0.0592 | 77.86 | +0.0387 |
Base
AlignGuard
SafetyBPO
SaTPO
SaTPO
AlignGuard
Base
AlignGuard
Base
SaTPO

SD-v1.5
SDXL
Figure 7: Additional qualitative comparisons on SD-v1.5 (top) and SDXL (bottom). Rows compare the indicated base and safety-aligned models. Columns show corresponding examples across methods.
Base
AlignGuard
SafetyBPO
SaTPO
AlignGuard
Base
SaTPO
AlignGuard
Base

SD-v1.5
SDXL
Figure 8: Additional qualitative comparisons for sexual-content prompts on SD-v1.5 (top) and SDXL (bottom). Rows compare the indicated models on corresponding examples. Black NSFW overlays mask explicit regions.