mlsanityData to 7 Oct 2026

Mitigating Text Toxicity with Counterfactual Generation

arXiv 2405.09948 ↗First posted 16 May 2024cs.CLcited by 2

Not on the map. Why?

Abstract (arXiv)

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.

Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 33 of its 67 references that are in the map. First posted on arXiv 16 May 2024.

Builds on

33 of 67 references.

References · 33

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  3. 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
  4. 2017A Unified Approach to Interpreting Model Predictionscited by 6,488
  5. 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
  6. 2019BERTScore: Evaluating Text Generation with BERTcited by 5,462
  7. 2017Axiomatic Attribution for Deep Networkscited by 3,350
  8. 2019A Survey on Bias and Fairness in Machine Learningcited by 1,911
  9. 2019Explainable Artificial Intelligence (XAI): Concepts, Taxonomies, Opportunities and Challenges toward Responsible AIcited by 1,543
  10. 2017Learning Important Features Through Propagating Activation Differencescited by 1,454
  11. 2022LaMDA: Language Models for Dialog Applicationscited by 1,218
  12. 2017Explanation in Artificial Intelligence: Insights from the Social Sciencescited by 1,201
21 more
  1. 2024Gemma: Open Models Based on Gemini Research and Technologycited by 889
  2. 2023Bias and Fairness in Large Language Models: A Surveycited by 626
  3. 2021Annotators with Attitudes: How Annotator Beliefs And Identities Bias Toxic Language Detectioncited by 258
  4. 2019FACE: Feasible and Actionable Counterfactual Explanationscited by 232
  5. 2021Polyjuice: Generating Counterfactuals for Explaining, Evaluating, and Improving Modelscited by 219
  6. 2020Explaining NLP Models via Minimal Contrastive Editing (MiCE)cited by 105
  7. 2019The Dangers of Post-hoc Interpretability: Unjustified Counterfactual Explanationscited by 97
  8. 2019Beyond BLEU: Training Neural Machine Translation with Semantic Similaritycited by 84
  9. 2018Fighting Offensive Language on Social Media with Unsupervised Text Style Transfercited by 55
  10. 2021Text Detoxification using Large Pre-trained Neural Modelscited by 52
  11. 2023Combining Generative Artificial Intelligence (AI) and the Internet: Heading towards Evolution or Degradation?cited by 41
  12. 2022Detoxifying Text with MaRCo: Controllable Revision with Experts and Anti-Expertscited by 36
  13. 2021Civil Rephrases Of Toxic Texts With Self-Supervised Transformerscited by 32
  14. 2023CREST: A Joint Framework for Rationalization and Counterfactual Text Generationcited by 24
  15. 2021A Framework and Benchmarking Study for Counterfactual Generating Methods on Tabular Datacited by 19
  16. 2020Towards A Friendly Online Community: An Unsupervised Style Transfer Framework for Profanity Redactioncited by 17
  17. 2021Text Counterfactuals via Latent Optimization and Shapley-Guided Searchcited by 16
  18. 2023Personalizing Content Moderation on Social Media: User Perspectives on Moderation Choices, Interface Design, and Laborcited by 16
  19. 2023TIGTEC : Token Importance Guided TExt Counterfactualscited by 8
  20. 2023Evaluating self-attention interpretability through human-grounded experimental protocolcited by 5
  21. 2023Toward Stronger Textual Attack Detectorscited by 3

Built on by

Cited by year

Citing papers per year: 2025: 2.

2 papers.