Skip to content

SaTPO: Safety alignment of text-to-image diffusion models via transition preference optimizationSaTPO: Text-to-Image Safety Alignment via Transition Preference Optimization

arXiv: Jailbreaks, Prompt Injection, Poisoning & Defenses· arXiv:2610.19563· Ziyi Fang, Jingzhi Li, Xiaojun Jia, Xingxing Wei, Wenqi Ren, Haijun ZhangInstitute of Information Engineering, Chinese Academy of Sciences; University of Chinese Academy of Sciences; University of Science and Technology Beijing; Nanyang Technological University; Beihang University; Sun Yat-sen UniversityIndexed by this site · 2026-10-15· Originally publishedDefenses

Quick read

Defenses

Based on the paper PDF (AI-generated); refer to the original

SaTPO uses shared parent states to turn unsafe prompts and safe rewrites into single-step transition preferences. On I2P, SD-v1.5's PV drops from 12.70% to 6.00%.

Questions
Text-to-image diffusion models generate harmful images per user prompts, while safety and normal generation share parameters. Image-level preferences compress multi-step denoising into a coarse signal, which the authors believe entangles unrelated trajectory drift.
Methods
SaTPO turns unsafe prompts and their safe rewrites into single-step preferences under shared parent state and noise, then optimizes under the original unsafe condition. Drift penalties and COCO benign replay constrain deviation. CoProPV regenerates on the backbone and verifies with PerspectiveVision. Inference is standard CFG.
Experiments and results
I2P PV: SaTPO 6.00%, AlignGuard 12.70% on v1.5; 9.30% and 15.04% on SDXL (Table 1). COCO FID is 25.95 and 27.51, while AlignGuard is 32.28 and 36.50. NSFW is not the lowest in every category.
Limitations and future work
The paper does not specifically discuss limitations. Experiments report SD-v1.5 and SDXL, I2P-5000, UD-934, NSFW-Sexual-1k, and COCO-5000, plus three fixed adversarial prompt sets. The paper does not report detector–human agreement or repeated variance.
Experimental setupStable Diffusion v1.5 (SD-v1.5)、SDXL Base · CoProPV、CoProV2 et al. · PV、Q16 et al.
Evaluated models
Stable Diffusion v1.5 (SD-v1.5)SDXL Base
Benchmarks
CoProPVCoProV2I2P-5000UD-934NSFW-Sexual-1kCOCO-5000MMA-DiffusionRing-A-BellSneakyPrompt
Metrics
PVQ16NudeNetIPCLIPFIDASR
AI summarySaTPO performs stepwise safety preference optimization during the diffusion denoising process, improving the safety-quality trade-off in text-to-image generation on Stable Diffusion v1.5 and SDXL. It forms tightly coupled preference pairs by pairing unsafe prompts with their safe rewrites in the same parent state to avoid trajectory divergence, and uses multi-scale drift constraints and benign replay to preserve normal generation. Compared to AlignGuard, PerspectiveVision's unsafe detection rate on Inappropriate Image Prompts dropped from 12.70% to 6.00% on Stable Diffusion v1.5 and from 15.04% to 9.30% on SDXL, with FID dropping to 25.95 and 27.51, respectively.

SaTPO performs stepwise safety preference optimization during the diffusion denoising process, improving the safety-quality trade-off in text-to-image generation on Stable Diffusion v1.5 and SDXL. It forms tightly coupled preference pairs by pairing unsafe prompts with their safe rewrites in the same parent state to avoid trajectory divergence, and uses multi-scale drift constraints and benign replay to preserve normal generation. Compared to AlignGuard, PerspectiveVision's unsafe detection rate on Inappropriate Image Prompts dropped from 12.70% to 6.00% on Stable Diffusion v1.5 and from 15.04% to 9.30% on SDXL, with FID dropping to 25.95 and 27.51, respectively.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Image-level preferences compress multi-step factors into a coarse signal; SaTPO instead uses single-step transition alignment under shared states.

    Safety preference on image generation compresses multi-step denoising factors into a coarse signal, and alignment alters generation behavior beyond safety.

    • Scenario: Text-to-image diffusion models can generate images from natural language, and can also generate sexually explicit, violent, or other harmful content based on user prompts (Section 1). Safety alignment aims to reduce such outputs while preserving generation capability for normal requests; both behaviors share the same set of parameters.
    • Existing limitations: The authors state that image-generation preferences compress changes across multiple denoising steps into a coarse scalar, entangling safety attributes with irrelevant trajectory drift, harming both generation quality and alignment effectiveness. Step-wise methods like LPO require noise-aware latent reward models to rank intermediate candidates; the authors state such reward models are hard to train and introduce reward ambiguity and overhead when used for safety.
    • Observation: An unsafe prompt and its safe rewrite, under the same parent state and the same Gaussian noise, naturally form a coupled preference pair; their difference is the change in transition mean caused by the rewrite, requiring no additional reward model for ranking.
    • Proposal: Safety Transition Preference Optimization (SaTPO) transfers the rewrite direction to the single-step transition under the original unsafe condition, and uses multi-scale drift constraints and benign replay to limit deviation. Additionally, visual verification is performed on the target backbone, yielding CoProPV. Inference uses standard classifier-free guidance without rewriting prompts.
  2. What related research exists?

    The paper divides related work into external/internal defenses and diffusion preference optimization; SaTPO does not use reward model ranking.

    The paper divides related work into safe text-to-image generation and diffusion preference optimization, and positions SaTPO on stepwise comparison.

    • External and sampling-period defenses: POSI (Wu et al., 2024) rewrites prompts; Latent Guard (Liu et al., 2024) detects unsafe concepts in text representations. SLD (Schramowski et al., 2023) adds safety guidance during denoising; SAFREE (Yoon et al., 2025) combines text subspace projection with latent re-attention.

    • Internal erasure and bypass: ESD (Gandikota et al., 2023) does negative-guidance distillation; UCE (Gandikota et al., 2024) uses closed-form cross-attention updates; MACE (Lu et al., 2024) does scalable erasure; RECE (Gong et al., 2024) iteratively erases target embeddings. Circumventing Concept Erasure (Pham et al., 2024), Ring-A-Bell (Hsu et al., 2024), and MMA-Diffusion (Yang et al., 2024b) demonstrate vulnerabilities under implicit or adversarial prompts.

    • Image-level safety preference: AlignGuard (Liu et al., 2025) does image-level safety DPO with category adapter merging. SafetyBPO (Wu et al., 2026) learns bidirectional prompt-level and image-level preferences, then distills collaborative positive and negative guidance models.

    • Endpoint or distribution preference: DPO (Rafailov et al., 2023) writes the KL-regularized reward relative to a reference model as pairwise classification. DDPO (Black et al., 2024) uses policy gradient to optimize endpoint rewards; DPOK (Fan et al., 2023) constrains distribution drift relative to a pretrained model. Diffusion-DPO (Wallace et al., 2024) uses a diffusion likelihood bound. DSPO (Zhu et al., 2025) distills the score of a preference distribution; 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 preference: D3PO (Yang et al., 2024a) propagates feedback preferences to intermediate denoising steps. SPO (Liang et al., 2025) uses step-aware model ranking of shared-state candidates; 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) handles update imbalance between winners and losers. The introduction states LPO relies on noise-aware latent reward models, which have reward ambiguity and overhead for safety.

    • Baseline methods: Original SD-v1.5 and SDXL (Base), SLD-Medium/Max, SAFREE, ESD-u, UCE, RECE, AlignGuard, SafetyBPO, and LPO ranked with SafetyLRM on CoProPV.

    • Benchmarks/datasets: Training uses CoProPV, obtained from CoProV2 via visual verification; evaluation uses I2P, Unsafe Diffusion, NSFW-56k subset, and MS COCO val2017; adversarial evaluation uses fixed prompts from MMA-Diffusion, Ring-A-Bell, and SneakyPrompt.

    The authors place SaTPO on stepwise comparison: using unsafe prompts and their safe rewrites, constructing single-step preferences under shared parent states and noise, without reward model ranking (Section 2).

  3. How does the paper address this problem?

    SaTPO turns unsafe prompts and safe rewrites into single-step transition preferences under shared parent state and noise.

    SaTPO turns prompt-level safety counterfactuals into single-step transition preferences under shared parent state and noise, with drift constraints and benign replay. Inference uses only CFG under the original prompt condition, without safe rewrites.

    Problem Setup

    • Transition: Latent xt at noise level t and text condition c, the stochastic reverse step is homoscedastic Gaussian with mean μθ(xt, c, t) and variance σt²I. Density-based objectives use only steps with σt>0.
    • CFG: Sampling mean comes from classifier-free guidance, with empty condition denoted ∅ and guidance scale g. Changing the condition changes only the transition mean, not the prescribed variance. g is 7.5 for both training and evaluation.
    • Log-ratio: Relative to a frozen reference model, the per-dimension transition log-ratio of a candidate is

    ℓθ(x′;xt,c)=1/dlog(pθ(x′|xt,c))/(pref(x′|xt,c)) It represents the policy's transition log-probability relative to the reference, averaged over latent dimensions. Under shared Gaussian covariance, it equals the difference of two squared distances divided by 2dσt². The preference margin is the log-ratio of the preferred candidate minus that of the rejected candidate.

    CoProPV

    • Motivation: The authors note that prompt-level safety descriptions do not always correspond to image-level outcomes and vary across diffusion backbones.
    • Construction: For all 10,983 training prompt pairs from CoProV2 (unsafe prompt cU and safe rewrite cS), regenerate with fixed seeds on SD-v1.5 and SDXL, then label image safety and risk categories with PerspectiveVision.
    • Retention: Keep pairs where the safe-rewrite image is Safe and the original-prompt image is Unsafe and belongs to one of seven categories (sexual content, violence, hate, harassment, self-harm, illegal activities, shocking). This yields 3,351 pairs (SD-v1.5) and 3,944 pairs (SDXL). No CLIP thresholds or category reweighting are used.

    Transition Preference

    • Pairing: The base model is frozen as pref, and policy pθ is initialized from it. The reference model generates two successors from the same unsafe-prompt parent state and the same noise, with conditions cS and cU. Shared parent state and noise make their difference equal to the reference mean difference, without branch-history differences. Preference order is fixed by prompt source, with the rewrite side preferred over the original side. Only the unsafe-prompt branch moves forward. Recording τ saves parent states, two candidates, timestep, and cU on the collection grid T.
    • Loss: Both candidates compute policy log-ratios relative to the reference under cU. The authors state that with equal covariance and shared noise, the unclipped margin is proportional to the inner product of the policy mean shift and the rewrite guidance direction; increasing the margin biases toward the rewrite direction. The minibatch applies time-weighted softplus to clipped log-ratios, yielding LDPO. Clipping bounds are log(1−ε) and log(1+ε), with ε=0.1 and β=500.
    • Time Weighting: SafetyLRM is used only for post-hoc diagnostics, not in SaTPO. The caption states that as denoising progresses (t→0), preference gaps shrink (Figure 2(b)), so early steps get higher weight and later steps lower. w(t)=3ut²−2ut³, with ut=clip((t−250)/250, 0, 1). In 20-step recordings, 15 positive-weight steps enter the preference minibatch.

    Drift, Replay, and Training

    • Two-Level Drift: If both raw log-ratios shift equally, the unclipped margin is unchanged, and clipping ignores out-of-bound changes. Lloc adds a symmetric penalty Φ to each log-ratio; Lcom penalizes the signed sum of both means over the entire record, with gradients estimated from 4 uniformly sampled steps, while forward passes still go through the full record. Ldrift is a weighted sum of the two terms. Radius, sharpness, and weights vary by backbone (Table 6).
    • Benign Replay: Cache transitions on COCO captions using the frozen base model, with a library of 1,024 captions and 4 transitions each. Each update recomputes log-ratios for 4 transitions in one record, applying Φ relative to cached reference values.
    • Total Objective and Updates:

    ℒSaTPO=ℒDPO+ℒdrift+λbenℒben That is, the sum of preference loss, drift penalty, and benign replay. Only the denoiser LoRA is updated. SD-v1.5 uses rank 8, two rounds, and 12,568 recorded steps; SDXL uses rank 64, one round, and 14,809. AdamW with learning rate 10−5. Candidates are collected with 20-step random DDIM (η=1).

  4. What experiments did the paper conduct?

    On SD-v1.5 and SDXL, I2P PV detection rates are 6.00% and 9.30%, respectively.

    Experimental Setup

    • Backbones and Training: Stable Diffusion v1.5 and SDXL Base, each trained on its own CoProPV subset. The main text reports approximately 10.11 hours and approximately 77 hours on a single NVIDIA A800 GPU; Table 7 reports approximately 76.95 GPU hours for SDXL and states no cross-hardware normalization.
    • Safety Sets: I2P-5000 is 5,000 prompt–seed evaluations (all 4,703 official rows retained, plus 297 additional seeds, 4,462 distinct prompts). UD-934 is all 934 harmful prompts from Unsafe Diffusion. NSFW-Sexual-1k samples 1,000 prompts from the 56,000 non-empty prompts of NSFW-56k.
    • Benign Set and Generation: COCO-5000 uses all 5,000 real images and fixed captions from MS COCO val2017. Within the same backbone, methods share prompts and initial noise. SD-v1.5 uses 512², 50-step DDIM (η=0); SDXL uses 1024², 20-step Euler, without refiner. CFG is 7.5 for both. Output safety checkers are disabled; each baseline's own guardrails or guidance remain enabled.
    • Baselines: Base, SLD-Medium/Max, SAFREE, ESD-u, UCE, RECE, AlignGuard and SafetyBPO with official weights, and LPO ranking four candidates with SafetyLRM on CoProPV. SAFREE is reported only on NSFW-Sexual-1k. The SDXL block of Table 1 does not include SLD, UCE, RECE, or SafetyBPO. SDXL ESD-u uses a seven-class joint checkpoint for I2P/UD and a separate nude checkpoint for NSFW-Sexual-1k.
    • Metrics: PV is the PerspectiveVision seven-class unsafe detection rate; Q16 uses CLIP ViT-L/14 binary argmax; NudeNet (3.0.8) treats genital exposure as positive; IP is the image-level union of Q16 and NudeNet. Lower detection rates are better. Benign metrics are CLIP image-text similarity (↑) and FID relative to real COCO (↓). ASR on fixed adversarial sets is PV∪IP.
    • Not Reported: The paper does not report number of repetitions or variance, nor agreement between detectors and human judgment.

    Main Results

    The detection rates below are from Table 1 (%, ↓), FID from Figure 5(b) on COCO-5000 (↓).

    Swipe horizontally to read the table

    Methodv1.5 I2P PVXL I2P PVv1.5 UD PVXL UD PVv1.5 FID
    Base39.2836.6240.5843.5824.55
    AlignGuard12.7015.0410.2813.9232.28
    SafetyBPO11.58Not reported11.46Not reported38.51
    LPONot reported34.00Not reported40.90Not reported
    SaTPO6.009.304.287.2825.95
    • Authors' Interpretation: The authors state that SaTPO achieves the lowest PV, Q16, and IP on I2P and UD across both backbones (Table 1). SDXL COCO FID is 27.51 for SaTPO, 36.50 for AlignGuard, and 25.32 for Base; CLIP is 0.2602, 0.2585, and 0.2691 (Figure 5(b)). Base has the highest CLIP and lowest FID.
    • Not Lowest in Every Cell: On SD-v1.5 NSFW-Sexual-1k, PV is 11.30% for SaTPO, 7.80% for RECE, and 10.90% for SafetyBPO (Table 1). SD-v1.5 I2P NudeNet is 0.62% for SLD-Max, 0.64% for RECE, and 0.68% for SaTPO. SDXL I2P NudeNet is 0.96% for AlignGuard and 1.04% for SaTPO; Q16 on that set's NSFW is 0.60% for AlignGuard and 0.90% for SaTPO.
    • Categories and Examples: The authors state that on SDXL, PV improvements over AlignGuard cover all seven I2P prompt categories (Table 2). Illegal is 25.17% for AlignGuard and 16.27% for SaTPO; Violence is 23.02% and 16.88%. The authors state that selected examples in Figure 4 reduce harmful content while preserving some benign attributes; Figure 5(a) preserves the pitching motion and bear appearance relative to AlignGuard.

    Fixed Adversarial Prompts

    • What Was Tested: Fixed prompts from MMA-Diffusion (1,000), Ring-A-Bell (79), and SneakyPrompt (200, with 124 perturbed prompts and 76 zero-query source-filter bypasses), with shared seeds (Appendix C.6).
    • Results: ASR on SD-v1.5 is 6.80%, 1.27%, and 3.00% for SaTPO; 22.50%, 41.77%, and 20.50% for AlignGuard; and 15.70%, 7.59%, and 9.00% for SafetyBPO (Table 3, order: MMA, Ring, Sneaky). On SDXL, SaTPO is 4.20%, 7.59%, and 5.50%; AlignGuard is 18.80%, 49.37%, and 22.00%.
    • Authors' Interpretation: The authors state that on these fixed queues, SaTPO has the lowest composite ASR across both backbones. Table 12 states the lowest PV and ASR for each queue, and the lowest or tied-lowest IP. On SDXL Ring-A-Bell, Q16 is 2.53% for SaTPO and 0.00% for AlignGuard.

    Ablations and LPO Adaptation

    • Replay and Time Weighting: Removing Lben, SD-v1.5 I2P PV/IP is 2.54%/2.68% versus SaTPO's 6.00%/5.36%; COCO CLIP drops from 0.2573 to 0.1952, and FID from 25.95 to 69.19 (Table 4(a)). The authors state this supports using benign replay to maintain image-text alignment and distribution similarity on normal prompts. With weight reversed to w(952−t), I2P IP is 15.94%, CLIP 0.2613, FID 24.80 (Table 4(b)). The authors state this supports earlier preference updates.
    • Parent State: Increasing reset interval J from 1 to 3 or 5 raises all four I2P detection rates on SD-v1.5; IP is 5.36% (J=1), 7.66% (J=3), and 8.00% (J=5) (Table 5(a)). With matched budget of 8,839 steps, SDXL dual-trajectory DT has I2P PV/IP of 12.40%/8.20%, while shared parent state is 9.80%/5.74% (Table 5(b)), not the main result's 9.30%. With the same budget, Table 15 I2P NudeNet is 0.90% for DT and 1.20% for SaTPO.
    • LPO: SDXL adaptation accepts 1,622 of 78,880 comparisons, with 540 optimization updates per round (Appendix C.8). Its COCO CLIP is 0.2686 and FID 28.08; main-result SaTPO is 0.2602 and 27.51. SD-v1.5 at LoRA scale 1.0 has CLIP 0.1653 and FID 207.57; at scale 0.5, I2P IP is 35.58% versus SaTPO's 5.36% (Table 13).

    Other Ablations and Analyses

    • NSFW-Sexual-1k (1,000 images) genital union counts: SD-v1.5 SaTPO 3, AlignGuard 19, SafetyBPO 13 (Table 10); SDXL SaTPO 9, AlignGuard 13 (Table 11).
    • SafetyLRM diagnostics, 140 pairs per group, eight parent timesteps: agreement rate between Safe/Unsafe and prompt-source order is 87.41%; mean score difference for that group is +3.2182 at t=951 and +0.0655 at t=101 (Table 16).
    • SD-v1.5 I2P per-category is not lowest in every cell: Hate PV is 5.26% for SaTPO and 3.64% for AlignGuard (Table 8).
    • Training time (own hardware, not normalized): AlignGuard approximately 14 / 126 GPU hours, SafetyBPO approximately 1.5 / not reported, SaTPO 10.11 / approximately 76.95 (Table 7, SD-v1.5 / SDXL).
  5. What are some points that can be further explored?

    The paper does not specifically discuss limitations or future directions.

    The paper does not specifically discuss limitations or future directions.

    Limitations and Future Directions Noted by the Authors

    The paper does not specifically discuss limitations. The Conclusion, appendices, and main text have no dedicated Limitations, Discussion, or Future Work sections, nor do they state experiments the authors plan next.

    Experimental Coverage

    • Alignment targets are Stable Diffusion v1.5 and SDXL Base; training updates only denoiser LoRA (Section 4.4, 5.1).
    • Safety detection is reported on I2P-5000, UD-934, NSFW-Sexual-1k; benign quality on COCO-5000 CLIP and FID (Section 5.1–5.2, Figure 5(b)).
    • Main comparisons include Base, SLD, SAFREE, ESD-u, UCE, RECE, AlignGuard, SafetyBPO, and adapted LPO. Table 1's SDXL block omits SLD, UCE, RECE, SafetyBPO; SAFREE appears only on NSFW-Sexual-1k.
    • Adversarial evaluation uses fixed prompts and shared seeds from MMA-Diffusion, Ring-A-Bell, and SneakyPrompt (Section 5.2, Appendix C.6).
    • The paper does not report detector–human agreement or variance across repeated runs. SafetyLRM is used only for post-hoc diagnosis and LPO ranking, not in the SaTPO loss (Section 4.2, Appendix C.8).
  6. Summarize the main content of the paper

    SaTPO performs single-step preference alignment under shared states and reduces detection rates on I2P and UD across both backbones.

    SaTPO trains text-to-image models on denoising transitions, using single-step preferences over shared states to suppress harmful images while constraining deviation from normal generation.

    • Problem: Image-level preferences compress multi-step denoising into a coarse signal. The authors believe safety attributes become entangled with unrelated trajectory drift; stepwise ranking with noise-latent reward models introduces ambiguity and overhead.
    • Approach: Unsafe prompts and their safe rewrites produce two successors from the same parent state and same noise, then bias toward the rewrite-guided transition mean under the original unsafe condition. Stepwise and cross-step drift penalties, plus benign replay on COCO captions. Supervision comes from CoProPV, regenerated by backbone and verified by PerspectiveVision: 3,351 pairs for SD-v1.5, 3,944 for SDXL. Only LoRA is trained; inference uses standard CFG.
    • Detection: In Table 1, I2P PV is SaTPO 6.00% vs AlignGuard 12.70% on SD-v1.5, and 9.30% vs 15.04% on SDXL; UD PV is 4.28% vs 7.28%. The authors state that on these two sets, PV, Q16, and IP are lowest with SaTPO on both backbones. NSFW-Sexual-1k is not uniformly so: SD-v1.5 PV is SaTPO 11.30%, RECE 7.80%, SafetyBPO 10.90%.
    • Quality and fixed prompts: COCO-5000 FID, SD-v1.5: SaTPO 25.95, AlignGuard 32.28, Base 24.55; SDXL: 27.51, 36.50, 25.32 (Figure 5(b)). Base has highest CLIP and lowest FID. Fixed-prompt ASR on SD-v1.5 MMA-Diffusion is 6.80% (Table 3). The authors state shared parent states and earlier preference updates correspond to lower safety detection, and benign replay maintains alignment and distribution similarity on normal prompts.
    • Conclusion: The authors state these results support using transition-level preference learning to balance measured safety and benign generation. The paper does not specifically discuss limitations.
Read originalarxiv.org