Adding Instructions during Pretraining: Effective way of Controlling Toxicity in Language Models

Shrimai Prabhumoye, Mostofa Patwary, Mohammad Shoeybi, Bryan Catanzaro


Abstract
Pretrained large language models have become indispensable for solving various natural language processing (NLP) tasks. However, safely deploying them in real world applications is challenging because they generate toxic content. To address this challenge, we propose two novel pretraining data augmentation strategies that significantly reduce model toxicity without compromising its utility. Our two strategies are: (1) MEDA: adds raw toxicity score as meta-data to the pretraining samples, and (2) INST: adds instructions to those samples indicating their toxicity. Our results indicate that our best performing strategy (INST) substantially reduces the toxicity probability up to 61% while preserving the accuracy on five benchmark NLP tasks as well as improving AUC scores on four bias detection tasks by 1.3%. We also demonstrate the generalizability of our techniques by scaling the number of training samples and the number of model parameters.
Anthology ID:
2023.eacl-main.193
Volume:
Proceedings of the 17th Conference of the European Chapter of the Association for Computational Linguistics
Month:
May
Year:
2023
Address:
Dubrovnik, Croatia
Editors:
Andreas Vlachos, Isabelle Augenstein
Venue:
EACL
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
2636–2651
Language:
URL:
https://aclanthology.org/2023.eacl-main.193
DOI:
10.18653/v1/2023.eacl-main.193
Bibkey:
Cite (ACL):
Shrimai Prabhumoye, Mostofa Patwary, Mohammad Shoeybi, and Bryan Catanzaro. 2023. Adding Instructions during Pretraining: Effective way of Controlling Toxicity in Language Models. In Proceedings of the 17th Conference of the European Chapter of the Association for Computational Linguistics, pages 2636–2651, Dubrovnik, Croatia. Association for Computational Linguistics.
Cite (Informal):
Adding Instructions during Pretraining: Effective way of Controlling Toxicity in Language Models (Prabhumoye et al., EACL 2023)
Copy Citation:
PDF:
https://aclanthology.org/2023.eacl-main.193.pdf
Video:
 https://aclanthology.org/2023.eacl-main.193.mp4