D iffu D etox: A Mixed Diffusion Model for Text Detoxification (2023)

Abstract: Text detoxification is a conditional text generation task aiming to remove offensive content from toxic text. It is highly useful for online forums and social media, where offensive content is frequently encountered. Intuitively, there are diverse ways to detoxify sentences while preserving their meanings, and we can select from detoxified sentences before displaying text to users. Conditional diffusion models are particularly suitable for this task given their demonstrated higher generative diversity than existing conditional text generation models based on language models. Nonetheless, text fluency declines when they are trained with insufficient data, which is the case for this task. In this work, we propose DiffuDetox, a mixed conditional and unconditional diffusion model for text detoxification. The conditional model takes toxic text as the condition and reduces its toxicity, yielding a diverse set of detoxified sentences. The unconditional model is trained to recover the input text, which allows the introduction of additional fluent text for training and thus ensures text fluency. Extensive experimental results and in-depth analysis demonstrate the effectiveness of our proposed DiffuDetox.

## introduction toxic texts with offensive and abusive words are frequently encountered in online forums and social media. such a harmful online environment can lead to mental health problems @xcite , which motivates considerable research efforts @xcite @xcite in text detoxification, i.e., a conditional text generation task aiming to remove offensive content from sentences while preserving their meanings. intuitively, there exist diverse ways to detoxify a given sentence. as shown in ## methodology as the overall framework of diffudetox shown in figure 1 details, our proposed diffusion model for text detoxification improves text fluency in the low-training data regime by using a mixture of a conditional and unconditional diffusion model. we overview diffusion models before discussing diffudetox in detail. ## conclusion in this paper, we approach the text detoxification task with diffusion models for their demonstrated high generative diversity. we introduced diffudetox, a mixed conditional and unconditional diffusion model, where the conditional part reduces toxicity whereas the unconditional part ensures fluency. experimental results show diffudetox achieves human-level text detoxification performance, making it promising to be applied in realworld text detoxification systems to benefit users.