mlsanityData to 7 Oct 2026

Self-Detoxifying Language Models via Toxification Reversal

arXiv 2310.09573 ↗First posted 14 Oct 2023cs.CLcited by 45

On the map: LLM safety and security → Safety alignment, refusal and guardrails

Abstract (arXiv)

Language model detoxification aims to minimize the risk of generating offensive or harmful content in pretrained language models (PLMs) for safer deployment. Existing methods can be roughly categorized as finetuning-based and decoding-based. However, the former is often resource-intensive, while the latter relies on additional components and potentially compromises the generation fluency. In this paper, we propose a more lightweight approach that enables the PLM itself to achieve "self-detoxification". Our method is built upon the observation that prepending a negative steering prompt can effectively induce PLMs to generate toxic content. At the same time, we are inspired by the recent research in the interpretability field, which formulates the evolving contextualized representations within the PLM as an information stream facilitated by the attention layers. Drawing on this idea, we devise a method to identify the toxification direction from the normal generation process to the one prompted with the negative prefix, and then steer the generation to the reversed direction by manipulating the information movement within the attention layers. Experimental results show that our approach, without any fine-tuning or extra components, can achieve comparable performance with state-of-the-art methods.

Key facts. Cited by 45 papers in the map (data through 7 Oct 2026). Placed in Safety alignment, refusal and guardrails, one of 12 directions in LLM safety and security. Builds on 31 of its 38 references that are in the map. First posted on arXiv 14 Oct 2023.

Builds on

31 of 38 references.

Closest ancestors · 1

Same direction, newest first

  1. 2023The Capacity for Moral Self-Correction in Large Language Models15 Feb

Other references · 30

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2022Training language models to follow instructions with human feedbackcited by 15,712
  3. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  4. 2016Layer Normalizationcited by 5,579
  5. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,747
  6. 2019The Curious Case of Neural Text Degenerationcited by 2,881
  7. 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
  8. 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,548
  9. 2023Representation Engineering: A Top-Down Approach to AI Transparencycited by 1,239
  10. 2020RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Modelscited by 1,235
  11. 2021DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharingcited by 1,219
  12. 2019Plug and Play Language Models: A Simple Approach to Controlled Text Generationcited by 793
18 more
  1. 2023The RefinedWeb Dataset for Falcon LLM: Outperforming Curated Corpora with Web Data, and Web Data Onlycited by 755
  2. 2019CTRL: A Conditional Transformer Language Model for Controllable Generationcited by 754
  3. 2022Fine-Tuning can Distort Pretrained Features and Underperform Out-of-Distributioncited by 722
  4. 2023Eliciting Latent Predictions from Transformers with the Tuned Lenscited by 579
  5. 2022Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Spacecited by 522
  6. 2021DExperts: Decoding-Time Controlled Text Generation with Experts and Anti-Expertscited by 434
  7. 2020GeDi: Generative Discriminator Guided Sequence Generationcited by 377
  8. 2021Self-Diagnosis and Self-Debiasing: A Proposal for Reducing Corpus-Based Bias in NLPcited by 336
  9. 2023Pretraining Language Models with Human Preferencescited by 245
  10. 2022Quark: Controllable Text Generation with Reinforced Unlearningcited by 236
  11. 2022Analyzing Transformers in Embedding Spacecited by 131
  12. 2022Toward Transparent AI: A Survey on Interpreting the Inner Structures of Deep Neural Networkscited by 126
  13. 2021Detoxifying Language Models Risks Marginalizing Minority Voicescited by 106
  14. 2022Language Generation Models Can Cause Harm: So What Can We Do About It? An Actionable Surveycited by 80
  15. 2022Exploring the Limits of Domain-Adaptive Training for Detoxifying Large-Scale Language Modelscited by 67
  16. 2022Leashing the Inner Demons: Self-Detoxification for Language Modelscited by 19
  17. 2023Adding Instructions during Pretraining: Effective Way of Controlling Toxicity in Language Modelscited by 16
  18. 2022Language Detoxification with Attribute-Discriminative Latent Spacecited by 11

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2023: 1; 2024: 19; 2025: 17; 2026: 8.

45 papers.

Sort:

By area:

  1. 2023In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steeringcited by 240
  2. 2025MemOS: A Memory OS for AI Systemcited by 129
  3. 2024Detoxifying Large Language Models via Knowledge Editingcited by 86
  4. 2024Usable XAI: 10 Strategies Towards Exploiting Explainability in the LLM Eracited by 45
  5. 2024Digital Forgetting in Large Language Models: A Survey of Unlearning Methodscited by 38
  6. 2024Multi-property Steering of Large Language Models with Dynamic Activation Compositioncited by 35
  7. 2024Model Editing as a Robust and Denoised variant of DPO: A Case Study on Toxicitycited by 33
  8. 2024No Two Devils Alike: Unveiling Distinct Mechanisms of Fine-tuning Attackscited by 28
  9. 2024Tradeoffs Between Alignment and Helpfulness in Language Models with Steering Methodscited by 26
  10. 2024Exploring Multilingual Concepts of Human Value in Large Language Models: Is Value Alignment Consistent, Transferable and Controllable across Languages?cited by 23
  11. 2025Representation Engineering for Large-Language Models: Survey and Research Challengescited by 18
  12. 2024Walking in Others' Shoes: How Perspective-Taking Guides Large Language Models in Reducing Toxicity and Biascited by 17
33 more
  1. 2026Spherical Steering: Geometry-Aware Activation Rotation for Language Modelscited by 17
  2. 2024Controlled Text Generation for Large Language Model with Dynamic Attribute Graphscited by 16
  3. 2024MultiParaDetox: Extending Text Detoxification with Parallel Data to New Languagescited by 13
  4. 2025Contrastive Prompting Enhances Sentence Embeddings in LLMs through Inference-Time Steeringcited by 13
  5. 2024Multilingual and Explainable Text Detoxification with Parallel Corporacited by 12
  6. 2024RSA-Control: A Pragmatics-Grounded Lightweight Controllable Text Generation Frameworkcited by 11
  7. 2024DESTEIN: Navigating Detoxification of Language Models via Universal Steering Pairs and Head-wise Activation Fusioncited by 9
  8. 2025Detoxifying Large Language Models via Autoregressive Reward Guided Representation Editingcited by 9
  9. 2025UniDetox: Universal Detoxification of Large Language Models via Dataset Distillationcited by 8
  10. 2025Breaking Bad Tokens: Detoxification of LLMs Using Sparse Autoencoderscited by 8
  11. 2024Large Language Models can be Strong Self-Detoxifierscited by 7
  12. 2024KidLM: Advancing Language Models for Children -- Early Insights and Future Directionscited by 7
  13. 2025IF-GUIDE: Influence Function-Guided Detoxification of LLMscited by 7
  14. 2025Steering When Necessary: Flexible Steering Large Language Models with Backtrackingcited by 7
  15. 2025Why Safeguarded Ships Run Aground? Aligned Large Language Models' Safety Mechanisms Tend to Be Anchored in The Template Regioncited by 5
  16. 2025Paladin: Defending LLM-enabled Phishing Emails with a New Trigger-Tag Paradigmcited by 4
  17. 2024CogSteer: Cognition-Inspired Selective Layer Intervention for Efficiently Steering Large Language Modelscited by 3
  18. 2025Breaking mBad! Supervised Fine-tuning for Cross-Lingual Detoxificationcited by 3
  19. 2024Cross-model Control: Improving Multiple Large Language Models in One-time Trainingcited by 2
  20. 2025A Survey on Training-free Alignment of Large Language Modelscited by 2
  21. 2025Fine-Grained Emotion Recognition via In-Context Learningcited by 2
  22. 2026Test-Time Detoxification without Training or Learning Anythingcited by 2
  23. 2025IRepair: An Intent-Aware Approach to Repair Data-Driven Errors in Large Language Modelscited by 1
  24. 2025Detoxification of Large Language Models through Output-layer Fusion with a Calibration Modelcited by 1
  25. 2025Self-Anchored Attention Model for Sample-Efficient Classification of Prosocial Text Chatcited by 1
  26. 2026The Geometry of Refusal: Linear Instability in Safety-Aligned LLMscited by 1
  27. 2026Semantic Steering for Controllable Generation: Tuning-Free Concept Erasure in Multimodal Diffusion Transformerscited by 1
  28. 2024Fine-Grained Detoxification via Instance-Level Prefixes for Large Language Modelscited by 0
  29. 2025PG-CE: A Progressive Generation Dataset with Constraint Enhancement for Controllable Text Generationcited by 0
  30. 2026Detoxification for LLM: From Dataset Itselfcited by 0
  31. 2026A Survey of Toxicity Detection and Mitigation Strategies for Multilingual Language Modelscited by 0
  32. 2026The Safeguard Worked. Is the LLM System Safer?cited by 0
  33. 2026Focusing Condition: Inference-Time Self-Contrastive Steering Elicits Better Conditional Text Embeddings in LLMscited by 0