Toxicity mitigation consists in rephrasing text in order to remove offensive or harmful meaning. Neural natural language processing (NLP) models have been widely used to target and mitigate textual toxicity. However, existing methods fail to detoxify text while preserving the initial non-toxic meaning at the same time. In this work, we propose to apply counterfactual generation methods from the eXplainable AI (XAI) field to target and mitigate textual toxicity. In particular, we perform text detoxification by applying local feature importance and counterfactual generation methods to a toxicity classifier distinguishing between toxic and non-toxic texts. We carry out text detoxification through counterfactual generation on three datasets and compare our approach to three competitors. Automatic and human evaluations show that recently developed NLP counterfactual generators can mitigate toxicity accurately while better preserving the meaning of the initial text as compared to classical detoxification methods. Finally, we take a step back from using automated detoxification tools, and discuss how to manage the polysemous nature of toxicity and the risk of malicious use of detoxification tools. This work is the first to bridge the gap between counterfactual generation and text detoxification and paves the way towards more practical application of XAI methods.
GloSS over Toxicity: Understanding and Mitigating Toxicity in LLMs via Global Toxic Subspace
Institute of Computing Technology, Chinese Academy of Sciences(中国科学院计算技术研究所);University of Chinese Academy of Sciences(中国科学院大学);Dalian University of Technology(大连理工大学)
Do Prompts Guarantee Safety? Mitigating Toxicity from LLM Generations through Subspace Intervention
Department of Computer Science(计算机科学系);School of Computing, National University of Singapore(新加坡国立大学计算机学院);Department of Electronics and Communications Engineering(电子与通信工程系)
Mitigating Biases of Large Language Models in Stance Detection with Counterfactual Augmented Calibration
Harbin Institute of Technology, Shenzhen(哈尔滨工业大学(深圳));Peng Cheng Laboratory(鹏城实验室);The Chinese University of Hong Kong(香港中文大学);King’s College London(伦敦国王学院);The 30th Research Institute of China Electronics Technology Group Corporation(中国电子科技集团公司第三十研究所)
DynaCF: Mitigating Shortcut Learning in Reward Models via Dynamic Counterfactual Sensitivity
The Chinese University of Hong Kong, Shenzhen(香港中文大学(深圳));New Jersey Institute of Technology(新泽西理工学院);Institute of Computing Technology, CAS(中国科学院计算技术研究所)
Mitigating Gender Bias in Distilled Language Models via Counterfactual Role Reversal
University of Southern California(南加州大学);Information Sciences Institute(信息科学研究所);Amazon Alexa(亚马逊Alexa);Harvard University(哈佛大学);University of California, Los Angeles(加州大学洛杉矶分校)
Cross-Lingual Transfer of Debiasing and Detoxification in Multilingual LLMs: An Extensive Investigation
Institute for Logic, Language and Computation, University of Amsterdam(逻辑、语言与计算研究所,阿姆斯特丹大学);Center for Language and Cognition, University of Groningen(语言与认知中心,格罗宁根大学)
On the Robustness of Knowledge Editing for Detoxification
Hubei Provincial Key Laboratory of Artificial Intelligence(人工智能与智能学习湖北省重点实验室);Research Center for Network Media, School of Computer Science, Central China Normal University, Wuhan, China(网络媒体研究中心,计算机科学学院,中央民族大学,武汉,中国)
Take its Essence, Discard its Dross! Debiasing for Toxic Language Detection via Counterfactual Causal Effect
School of Computer Science and Technology, Dalian University of Technology(大连理工大学计算机科学与技术学院);School of Foreign Chinese, Dalian University of Technology(大连理工大学对外汉语学院)
ELITE: Enhanced Language-Image Toxicity Evaluation for Safety
Yonsei University(延世大学);Kyung Hee University(庆熙大学);Korea Institute of Science(韩国科学研究院);Seoul National University(首尔国立大学);Sookmyung Women's University(_sookmyung女子大学)
CoBA: Counterbias Text Augmentation for Mitigating Various Spurious Correlations via Semantic Triples
DATUMO;AITRICS;Brainventures;Graduate School of Advanced Imaging Sciences, Multimedia and Film, Chung-Ang University(Chung-Ang大学高级影像科学、多媒体与电影研究生院);Department of Artificial Intelligence, Chung-Ang University(Chung-Ang大学人工智能系)