The Safety-Aware Denoiser for Text Diffusion Models

Amman Yusuf, Zhejun Jiang, Mijung Park · 2026

Read The Safety-Aware Denoiser for Text Diffusion Models by Amman Yusuf, Zhejun Jiang, Mijung Park (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-08116.txt.

Introduction

Amman Yusuf, Zhejun Jiang, and Mijung Park add safety control to text diffusion models, which generate text by gradually denoising a sample instead of writing word by word. Safety tools built for ordinary generators rely on after-the-fact filtering or run-time steering, and they fit diffusion models poorly.

Their Safety-Aware Denoiser changes the denoising steps themselves, steering the final sample toward regions of text space that are provably safe. Because the control sits inside the denoiser, the base model needs no expensive retraining, and constraints can be adjusted flexibly. The authors evaluate the output against a hazard taxonomy and for memorization risks.

Catalog record

CREATORAmman Yusuf, Zhejun Jiang, Mijung Park
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE91 KB
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.08116

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

The Safety-Aware Denoiser for Text Diffusion Models Amman Yusuf, Zhejun Jiang, Mijung Park Abstract Recent work on text diffusion models offers a promising alternative to autoregressive generation, but controlling their safety remains underexplored. Existing safety approaches are geared toward autoregressive models and typically rely on post-hoc filtering or inference-time interventions. These are inadequate for effectively addressing safety risks in text diffusion models. We propose the Safety-Aware Denoiser (SAD) , a safety-guidance framework in text diffusion models. The SAD modifies the iterative denoising process such that the text sample at the final denoising step is steered toward provably safe regions of the text space. This inference-time method can integrate safety constraints into the denoiser, avoiding computationally expensive retraining of the underlying diffusion model and enabling flexible, lightweight safety guidance. We evaluate the safety of the generated text using the SAD, with respect to hazard taxonomy, memorization, and jailbreak. Experimental results show that SAD substantially reduces unsafe generations while preserving generation quality, diversity, and fluency, outperforming existing methods. These results demonstrate that our safety guidance during denoising provides an effective and scalable mechanism for enforcing safety in text diffusion models. Code is available at https://github.com/ammanyusuf/SAD . 1 Introduction Text diffusion models (TDMs) ( 3 ; 29 ; 27 ) have made rapid progress, demonstrating performance better than similarly-sized mainstream autoregressive (AR) large language models (LLMs). For instance, LLaDA ( 27 ) surpasses the performance of LLaMA3-8B ( 12 ) in mathematical reasoning and Chinese language understanding tasks. Compared to the sequential, token-by-token generation approach of AR-LLMs, TDMs progressively transform a fully masked sequence into text output through parallel generation and iterative refinement, which allows for faster inference and greater flexibility in text generation than AR-LLMs. While the potential of TDMs is significant, their safety implications are largely understudied, and their deployment raises safety concerns, including the generation of toxic content, the memorization of sensitive data, and vulnerability to jailbreak attacks. Most existing safety benchmarks focusing on toxicity and hazard of generated text are tested only on AR-LLMs ( 9 ; 13 ; 17 ) . In addition, existing safety techniques—such as post-hoc filtering, rejection sampling, or inference-time decoding constraints—are largely designed around autoregressive decoding and do not directly translate to the diffusion setting. Furthermore, the majority of jailbreak attacks target AR-LLMs, and only a few, very recent, TDM-specific jailbreaks exploit the parallel denoising in TDMs ( 21 ; 35 ; 40 ) . These papers note that TDMs can generate harmful content faster than comparable AR models, thereby accelerating the emergence of unsafe outputs. These findings underscore that TDMs present a strong attack surface, mainly because their safety weaknesses are not yet well mitigated by existing alignment techniques, and successful exploits can produce harmful text at a rapid rate. This motivates the need for defence mechanisms specifically designed for the diffusion paradigm. A straightforward solution to this issue is to retrain or fine-tune text diffusion models with safety objectives. One could also consider conditional diffusion models that sample from a safe distribution given explicit safe/unsafe labels ( 27 ) . However, these approaches are computationally expensive and inflexible, particularly as models continue to scale and are increasingly shared as frozen checkpoints. For conditional TDMs, acquiring a safety dataset is itself expensive and inflexible as safety requirements evolve. Hence, there is a dire need for lightweight, inference-time safety mechanisms that can be seamlessly integrated into the text diffusion process without increasing energy consumption by modifying or retraining the underlying model. In this work, we propose the Safety-Aware Denoiser (SAD), a principled safety-guidance framework that leverages the safe denoiser by 19 . The key idea behind SAD is to directly modify the iterative denoising process, modifying each denoising step so that the generated sample is progressively steered toward provably safe regions of the text space. Unlike post-hoc filtering methods that act only on final outputs, SAD influences the entire generation trajectory, allowing safety constraints to shape the final text in a more stable and effective manner. Notably, the SAD is training-free , requiring no retraining of the diffusion model. Safety constraints are incorporated into the denoiser itself, enabling flexible and modular safety guidance while preserving the original model’s generative capacity. This design makes SAD computationally efficient, easily deployable, and compatible with future advances in text diffusion architectures. SAD’s finite reference design enables practitioners to curate a small collection of known unsafe examples such as toxicity datasets, copyrighted documents, or training data, rather than exhaustively enumerating everything that can be safe. Our ablations show that N\approx 500-1000 references already saturates safety gains, making SAD practical even at scale. We conduct a comprehensive empirical evaluation of SAD across multiple safety dimensions, including compliance with the hazard taxonomy, reduced memorization, and robustness against jailbreak attacks. Our results demonstrate that SAD substantially reduces unsafe generations while maintaining generation quality, diversity, and fluency, underscoring the importance of safety mechanisms specifically designed for diffusion-based text generation. 2 Background We first describe the core ingredients of the two text diffusion models, MDLM ( 29 ) and LLaDA ( 27 ) , which we will use as our text diffusion models. We then describe the Safe Denoiser ( 19 ) , originally proposed for diffusion-based image generation, which we adopt and modify for safe text generation using text diffusion models. 2.1 Text Diffusion Models Similar to continuous-state-space diffusion models for image generation, TDMs also consist of forward and reverse Markov processes with latent variables. The forward process is defined by p(\mathbf{x}_{1:T}|\mathbf{x}_{0})=\prod_{t=1}^{T}q(\mathbf{x}_{t}|\mathbf{x}_{t-1}) , where the joint distribution over \mathbf{x}_{1:T} is defined by the order-1 Markov process following the conditional probability q(\mathbf{x}_{t}|\mathbf{x}_{t-1}) . This conditional probability is often assumed to be known and fixed, with a Categorical distribution over discrete random variables (a set of tokens) that determines the gradual noising process, turning a clean datapoint \mathbf{x}_{0} into a corrupted latent variable \mathbf{x}_{t} . The reverse Markov process p_{\mathbf{\bm{\theta}}}(\mathbf{x}_{0:T})=p(\mathbf{x}_{T})\prod_{t=1}^{T}p_{\mathbf{\bm{\theta}}}(\mathbf{x}_{t-1}|\mathbf{x}_{t}) is also assumed to be Categorical, but unknown and parameterized by a neural network model with parameters \mathbf{\bm{\theta}} . The exact parametrization differs model by model. The earlier work ( 3 ) using a transition matrix with an absorbing state called [MASK] showed the consistently superb performance compared to other forms of transition matrices. Due to this reason, the masked (absorbing state) diffusion has become the backbone of the mainstream text diffusion models, such as Masked Diffusion Language Models ( MDLM ) ( 29 ) and Large Language Diffusion with mAsking ( LLaDA ) ( 27 ) . These models are trained by maximizing the variational lower bound or its approximations. Once trained, they produce an entire draft of the response and then improve it progressively following each of their reverse Markov processes. This promises a phenomenal inference speed, compared to AR-LLMs. Also, unlike AR-LLMs, which limit where a prompt has to be placed, TDMs allow a prompt to sit at any arbitrary position. For instance, TDMs are well-suited to tasks such as rewriting a paragraph in the middle of an essay or refactoring a block of code. 2.2 The Safe Denoiser The safe denoiser ( 19 ) is a training-free safety guidance method proposed for safe image generation. The safe denoiser modifies the sampling trajectory by leveraging a negation set (e.g., unsafe images, copyrighted

Read the complete text