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. 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.
翻译:培训前语言模型(LMS)显示,培训前语言模型(LMS)很容易产生有毒语言。在这项工作中,我们系统地探索领域适应培训,以减少语言模型的毒性。我们从三个方面进行这项研究:培训程序、模型大小和参数效率。关于培训程序,我们提议利用LMS的基因变异功能,为地区适应培训生成非毒性数据集,这可以减轻接触偏差,并显示比使用培训前的包件更具数据效率。我们证明,自发方法始终超越自动和人类评估中各种模型规模的现有基线,即使使用1/3个较小的培训设备。然后,我们全面研究参数大小从126MM到530B(3x大于GPT-3)的LMS脱毒方法。我们发现,大型LMS的毒性水平与使用培训前培训程序规模小于小于培训程序。大型LMS(LMS)需要更加努力去毒化。我们还探索脱氧化模式的节能培训方法,但比整个交易阶段的适应标准要更精确。我们证明,在跨层中,在升级和整层中要进行更精确的修改。