Leashing the Inner Demons: Self-Detoxification for Language Models

Authors

  • Canwen Xu University of California, San Diego
  • Zexue He University of California, San Diego
  • Zhankui He University of California, San Diego
  • Julian McAuley University of California, San Diego

DOI:

https://doi.org/10.1609/aaai.v36i10.21406

Keywords:

Speech & Natural Language Processing (SNLP), Humans And AI (HAI), Machine Learning (ML)

Abstract

Language models (LMs) can reproduce (or amplify) toxic language seen during training, which poses a risk to their practical application. In this paper, we conduct extensive experiments to study this phenomenon. We analyze the impact of prompts, decoding strategies and training corpora on the output toxicity. Based on our findings, we propose a simple yet effective unsupervised method for language models to ``detoxify'' themselves without an additional large corpus or external discriminator. Compared to a supervised baseline, our proposed method shows better toxicity reduction with good generation quality in the generated content under multiple settings. Warning: some examples shown in the paper may contain uncensored offensive content.

Downloads

Published

2022-06-28

How to Cite

Xu, C., He, Z., He, Z., & McAuley, J. (2022). Leashing the Inner Demons: Self-Detoxification for Language Models. Proceedings of the AAAI Conference on Artificial Intelligence, 36(10), 11530–11537. https://doi.org/10.1609/aaai.v36i10.21406

Issue

Section

AAAI Technical Track on Speech and Natural Language Processing