arXiv:2610.19563cs.CVOct 2026

Manuscript Offprint

arXiv:2610.19563

SaTPO: Text-to-Image Safety Alignment via Transition Preference Optimization

Ziyi Fang, Jingzhi Li, Xiaojun Jia, Xingxing Wei, Wenqi Ren, Haijun Zhang

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

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.

References (44)