Civil Rephrases Of Toxic Texts With Self-Supervised Transformers (2021)

Abstract: Platforms that support online commentary, from social networks to news sites, are increasingly leveraging machine learning to assist their moderation efforts. But this process does not typically provide feedback to the author that would help them contribute according to the community guidelines. This is prohibitively time-consuming for human moderators to do, and computational approaches are still nascent. This work focuses on models that can help suggest rephrasings of toxic comments in a more civil manner. Inspired by recent progress in unpaired sequence-to-sequence tasks, a self-supervised learning model is introduced, called CAE-T5. CAE-T5 employs a pre-trained text-to-text transformer, which is fine tuned with a denoising and cyclic auto-encoder loss. Experimenting with the largest toxicity detection dataset to date (Civil Comments) our model generates sentences that are more fluent and better at preserving the initial content compared to earlier text style transfer systems which we compare with using several scoring systems and human evaluation.

## introduction there are many ways to express our opinions. when we exchange views online, we do not always immediately measure the emotional impact of our message. even when the opinions expressed are legitimate, well-intentioned and constructive, a poor phrasing may make the conversation go awry @xcite . recently, natural language processing (nlp) research has tackled the problem of abusive language detection by developing accurate classification models that flag toxic (or abusive, offensive, hateful) comments @xcite comments test set and the more civil rephrasing generated by our model. the third example shows that its strategy may involve shifting the original intent, since "republican" is not a non-offensive synonym of "moron". @xcite @xcite @xcite @xcite . the prospect of healthier conversations, nudged by machine learning (ml) systems, motivates the development of natural language understanding and generation (nlu and nlg) models that could later be integrated in a system suggesting alternatives to vituperative comments before they are posted. a first approach would be to train a text-to-text model @xcite on a corpus of parallel comments where each offensive comment has a courteous and fluent rephrasing written by a human annotator. however, such a solution requires a large paired labeled dataset, in practice difficult and expensive to collect (see section 4.5). consequently, we limit our setting to the unsupervised case where the comments are only annotated in attributes related to toxicity, such as the civil comments dataset @xcite . we summarize our investigations with the following research question: rq: can we fine-tune end-to-end a pre-trained text-to-text transformer to suggest civil rephrasings of rude comments using a dataset solely annotated in toxicity? answering this question might provide researchers with an engineering proof-of-concept that would enable further exploration of the many complex questions that arise from such a tool being used in conversations. the main contributions of this work are the following: with no human hand-crafting in its design) that can be generalized and later applied to related and/or unexplored attribute transfer tasks. while several of the ideas we combine in our model have been studied independently, to the best of our knowledge, no existing unsupervised models combine sequence-to-sequence bi-transformers, transfer learning from large pre-trained models, and self-supervised fine-tuning (denoising autoencoder and cycle consistency). we discuss the related work introducing these tools and techniques in the following section. ## related work unsupervised complex text attribute transfer (like civil rephrasing of toxic comments) remains in its early stages, and our particular applied task has only a single antecedent @xcite . there is a great variety of useful works to tackle the task and this section attempts to summarize the vast majority of these works. we describe below the recent strategies (such as attention mechanisms @xcite that led to significant progress in supervised nlu and nlg tasks. then, we present the most related lines of work in unsupervised text-to-text tasks. @xcite showed that transformer architectures, based on attention mechanisms, achieved state-of-the-art results when applied to supervised neural machine translation (nmt). more generally, transformers have proven capable in various nlp and speech tasks @xcite @xcite . moreover, transformers benefit from pre-training before being fine-tuned on downstream tasks @xcite @xcite @xcite . subsequent research has adopted uni-transformers in many supervised classification and regression tasks @xcite and in unsupervised language modeling @xcite @xcite , until @xcite proposed a unified pre-trained bi-transformer applicable to any text classification, text regression and text-to-text task. further, recent works tackle the language detoxification of unconditional language models @xcite . ## conclusion and future work this work is the second one to tackle civil rephrasing to our knowledge and the first one to address it with a fully end-to-end discriminator-free textto-text self-supervised training. cae-t5 leverages the nlu / nlg power offered by large pre-trained bi-transformers. the quantitative and qualitative analysis shows that ml systems could contribute to some extent to pacify online conversations, even though many generated examples still suffer from critical semantic drift. in the future, we plan to explore whether the decoding can benefit from nar generation @xcite . we are also interested in the recent paradigm shift proposed by @xcite , where the generated tokens representation is continuous, allowing more flexibility in plugging attribute classifiers without sampling.