Exploring the Limits of Domain-Adaptive Training for Detoxifying Large-Scale Language Models

Boxin Wang, Wei Ping, Chaowei Xiao, Peng Xu, Mostofa Patwary +4 more
2/8/2022
cs.CLcs.AIcs.CY

Official code: NVIDIA/Megatron-LM (18,604 stars, Python, last commit 2026-05-03).

Abstract

Pre-trained language models (LMs) are shown to easily generate toxic language. In this work, we systematically explore domain-adaptive training to reduce the toxicity of language models.

Show full abstract

We conduct this study on three dimensions: training corpus, model size, and parameter efficiency. For the training corpus, we propose to leverage the generative power of LMs and generate nontoxic datasets for domain-adaptive training, which mitigates the exposure bias and is shown to be more data-efficient than using a curated pre-training corpus. We demonstrate that the self-generation method consistently outperforms the existing baselines across various model sizes on both automatic and human evaluations, even when it uses a 1/3 smaller training corpus. We then comprehensively study detoxifying LMs with parameter sizes ranging from 126M up to 530B (3x larger than GPT-3), a scale that has never been studied before. We find that i) large LMs have similar toxicity levels as smaller ones given the same pre-training corpus, and ii) large LMs require more endeavor to detoxify. We also explore parameter-efficient training methods for detoxification. We demonstrate that adding and training adapter-only layers in LMs not only saves a lot of parameters but also achieves a better trade-off between toxicity and perplexity than whole model adaptation for the large-scale models.

View on arXivView PDF

Code Implementations(1)

NVIDIA/Megatron-LMOfficial100%

Ongoing research training transformer models at scale

18,6044,818Python, ShellMar 21, 20197 months agoNOASSERTION
large-language-modelsmodel-paratransformers

Similar Papers

Cite this paper

@article{wang2022exploring,
  title  = {Exploring the Limits of Domain-Adaptive Training for Detoxifying Large-Scale Language Models},
  author = {Boxin Wang and Wei Ping and Chaowei Xiao and Peng Xu and Mostofa Patwary and Mohammad Shoeybi and Bo Li and Anima Anandkumar and Bryan Catanzaro},
  year   = {2022},
  eprint = {2202.04173},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2202.04173}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2202.04173.svg)](https://codeofpaper.com/paper/2202.04173)

Discussion