Self-Detoxifying Language Models via Toxification Reversal
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
Other references · 30
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2016Layer Normalizationcited by 5,579
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,747
- 2019The Curious Case of Neural Text Degenerationcited by 2,881
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
- 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,548
- 2023Representation Engineering: A Top-Down Approach to AI Transparencycited by 1,239
- 2020RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Modelscited by 1,235
- 2021DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharingcited by 1,219
- 2019Plug and Play Language Models: A Simple Approach to Controlled Text Generationcited by 793
18 more
- 2023The RefinedWeb Dataset for Falcon LLM: Outperforming Curated Corpora with Web Data, and Web Data Onlycited by 755
- 2019CTRL: A Conditional Transformer Language Model for Controllable Generationcited by 754
- 2022Fine-Tuning can Distort Pretrained Features and Underperform Out-of-Distributioncited by 722
- 2023Eliciting Latent Predictions from Transformers with the Tuned Lenscited by 579
- 2022Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Spacecited by 522
- 2021DExperts: Decoding-Time Controlled Text Generation with Experts and Anti-Expertscited by 434
- 2020GeDi: Generative Discriminator Guided Sequence Generationcited by 377
- 2021Self-Diagnosis and Self-Debiasing: A Proposal for Reducing Corpus-Based Bias in NLPcited by 336
- 2023Pretraining Language Models with Human Preferencescited by 245
- 2022Quark: Controllable Text Generation with Reinforced Unlearningcited by 236
- 2022Analyzing Transformers in Embedding Spacecited by 131
- 2022Toward Transparent AI: A Survey on Interpreting the Inner Structures of Deep Neural Networkscited by 126
- 2021Detoxifying Language Models Risks Marginalizing Minority Voicescited by 106
- 2022Language Generation Models Can Cause Harm: So What Can We Do About It? An Actionable Surveycited by 80
- 2022Exploring the Limits of Domain-Adaptive Training for Detoxifying Large-Scale Language Modelscited by 67
- 2022Leashing the Inner Demons: Self-Detoxification for Language Modelscited by 19
- 2023Adding Instructions during Pretraining: Effective Way of Controlling Toxicity in Language Modelscited by 16
- 2022Language Detoxification with Attribute-Discriminative Latent Spacecited by 11
Built on by
Citing papers per year: 2023: 1; 2024: 19; 2025: 17; 2026: 8.
45 papers.
Sort:
By area:
- 2023In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steeringcited by 240
- 2025MemOS: A Memory OS for AI Systemcited by 129
- 2024Detoxifying Large Language Models via Knowledge Editingcited by 86
- 2024Usable XAI: 10 Strategies Towards Exploiting Explainability in the LLM Eracited by 45
- 2024Digital Forgetting in Large Language Models: A Survey of Unlearning Methodscited by 38
- 2024Multi-property Steering of Large Language Models with Dynamic Activation Compositioncited by 35
- 2024Model Editing as a Robust and Denoised variant of DPO: A Case Study on Toxicitycited by 33
- 2024No Two Devils Alike: Unveiling Distinct Mechanisms of Fine-tuning Attackscited by 28
- 2024Tradeoffs Between Alignment and Helpfulness in Language Models with Steering Methodscited by 26
- 2024Exploring Multilingual Concepts of Human Value in Large Language Models: Is Value Alignment Consistent, Transferable and Controllable across Languages?cited by 23
- 2025Representation Engineering for Large-Language Models: Survey and Research Challengescited by 18
- 2024Walking in Others' Shoes: How Perspective-Taking Guides Large Language Models in Reducing Toxicity and Biascited by 17
33 more
- 2026Spherical Steering: Geometry-Aware Activation Rotation for Language Modelscited by 17
- 2024Controlled Text Generation for Large Language Model with Dynamic Attribute Graphscited by 16
- 2024MultiParaDetox: Extending Text Detoxification with Parallel Data to New Languagescited by 13
- 2025Contrastive Prompting Enhances Sentence Embeddings in LLMs through Inference-Time Steeringcited by 13
- 2024Multilingual and Explainable Text Detoxification with Parallel Corporacited by 12
- 2024RSA-Control: A Pragmatics-Grounded Lightweight Controllable Text Generation Frameworkcited by 11
- 2024DESTEIN: Navigating Detoxification of Language Models via Universal Steering Pairs and Head-wise Activation Fusioncited by 9
- 2025Detoxifying Large Language Models via Autoregressive Reward Guided Representation Editingcited by 9
- 2025UniDetox: Universal Detoxification of Large Language Models via Dataset Distillationcited by 8
- 2025Breaking Bad Tokens: Detoxification of LLMs Using Sparse Autoencoderscited by 8
- 2024Large Language Models can be Strong Self-Detoxifierscited by 7
- 2024KidLM: Advancing Language Models for Children -- Early Insights and Future Directionscited by 7
- 2025IF-GUIDE: Influence Function-Guided Detoxification of LLMscited by 7
- 2025Steering When Necessary: Flexible Steering Large Language Models with Backtrackingcited by 7
- 2025Why Safeguarded Ships Run Aground? Aligned Large Language Models' Safety Mechanisms Tend to Be Anchored in The Template Regioncited by 5
- 2025Paladin: Defending LLM-enabled Phishing Emails with a New Trigger-Tag Paradigmcited by 4
- 2024CogSteer: Cognition-Inspired Selective Layer Intervention for Efficiently Steering Large Language Modelscited by 3
- 2025Breaking mBad! Supervised Fine-tuning for Cross-Lingual Detoxificationcited by 3
- 2024Cross-model Control: Improving Multiple Large Language Models in One-time Trainingcited by 2
- 2025A Survey on Training-free Alignment of Large Language Modelscited by 2
- 2025Fine-Grained Emotion Recognition via In-Context Learningcited by 2
- 2026Test-Time Detoxification without Training or Learning Anythingcited by 2
- 2025IRepair: An Intent-Aware Approach to Repair Data-Driven Errors in Large Language Modelscited by 1
- 2025Detoxification of Large Language Models through Output-layer Fusion with a Calibration Modelcited by 1
- 2025Self-Anchored Attention Model for Sample-Efficient Classification of Prosocial Text Chatcited by 1
- 2026The Geometry of Refusal: Linear Instability in Safety-Aligned LLMscited by 1
- 2026Semantic Steering for Controllable Generation: Tuning-Free Concept Erasure in Multimodal Diffusion Transformerscited by 1
- 2024Fine-Grained Detoxification via Instance-Level Prefixes for Large Language Modelscited by 0
- 2025PG-CE: A Progressive Generation Dataset with Constraint Enhancement for Controllable Text Generationcited by 0
- 2026Detoxification for LLM: From Dataset Itselfcited by 0
- 2026A Survey of Toxicity Detection and Mitigation Strategies for Multilingual Language Modelscited by 0
- 2026The Safeguard Worked. Is the LLM System Safer?cited by 0
- 2026Focusing Condition: Inference-Time Self-Contrastive Steering Elicits Better Conditional Text Embeddings in LLMscited by 0
- 2026Focusing Condition: Inference-Time Self-Contrastive Steering Elicits Better Conditional Text Embeddings in LLMs26 Sep 2026
- 2026The Safeguard Worked. Is the LLM System Safer?1 Sep 2026
- 2026Semantic Steering for Controllable Generation: Tuning-Free Concept Erasure in Multimodal Diffusion Transformers13 Aug 2026
- 2026A Survey of Toxicity Detection and Mitigation Strategies for Multilingual Language Models24 Jun 2026
- 2026The Geometry of Refusal: Linear Instability in Safety-Aligned LLMs21 Jun 2026
- 2026Detoxification for LLM: From Dataset Itself21 Apr 2026
- 2026Spherical Steering: Geometry-Aware Activation Rotation for Language Models9 Feb 2026
- 2026Test-Time Detoxification without Training or Learning Anything14 Jan 2026
- 2025Fine-Grained Emotion Recognition via In-Context Learning8 Oct 2025
- 2025Detoxifying Large Language Models via Autoregressive Reward Guided Representation Editing24 Sep 2025
- 2025PG-CE: A Progressive Generation Dataset with Constraint Enhancement for Controllable Text Generation22 Sep 2025
- 2025Paladin: Defending LLM-enabled Phishing Emails with a New Trigger-Tag Paradigm8 Sep 2025
33 more
- 2025Steering When Necessary: Flexible Steering Large Language Models with Backtracking25 Aug 2025
- 2025A Survey on Training-free Alignment of Large Language Models12 Aug 2025
- 2025MemOS: A Memory OS for AI System4 Jul 2025
- 2025Self-Anchored Attention Model for Sample-Efficient Classification of Prosocial Text Chat10 Jun 2025
- 2025IF-GUIDE: Influence Function-Guided Detoxification of LLMs2 Jun 2025
- 2025Detoxification of Large Language Models through Output-layer Fusion with a Calibration Model2 Jun 2025
- 2025Breaking mBad! Supervised Fine-tuning for Cross-Lingual Detoxification22 May 2025
- 2025Breaking Bad Tokens: Detoxification of LLMs Using Sparse Autoencoders20 May 2025
- 2025Contrastive Prompting Enhances Sentence Embeddings in LLMs through Inference-Time Steering19 May 2025
- 2025UniDetox: Universal Detoxification of Large Language Models via Dataset Distillation29 Apr 2025
- 2025Representation Engineering for Large-Language Models: Survey and Research Challenges24 Feb 2025
- 2025Why Safeguarded Ships Run Aground? Aligned Large Language Models' Safety Mechanisms Tend to Be Anchored in The Template Region19 Feb 2025
- 2025IRepair: An Intent-Aware Approach to Repair Data-Driven Errors in Large Language Models10 Feb 2025
- 2024Multilingual and Explainable Text Detoxification with Parallel Corpora16 Dec 2024
- 2024RSA-Control: A Pragmatics-Grounded Lightweight Controllable Text Generation Framework24 Oct 2024
- 2024CogSteer: Cognition-Inspired Selective Layer Intervention for Efficiently Steering Large Language Models23 Oct 2024
- 2024Cross-model Control: Improving Multiple Large Language Models in One-time Training23 Oct 2024
- 2024KidLM: Advancing Language Models for Children -- Early Insights and Future Directions4 Oct 2024
- 2024Large Language Models can be Strong Self-Detoxifiers4 Oct 2024
- 2024Walking in Others' Shoes: How Perspective-Taking Guides Large Language Models in Reducing Toxicity and Bias22 Jul 2024
- 2024Multi-property Steering of Large Language Models with Dynamic Activation Composition25 Jun 2024
- 2024No Two Devils Alike: Unveiling Distinct Mechanisms of Fine-tuning Attacks25 May 2024
- 2024Model Editing as a Robust and Denoised variant of DPO: A Case Study on Toxicity22 May 2024
- 2024DESTEIN: Navigating Detoxification of Language Models via Universal Steering Pairs and Head-wise Activation Fusion16 Apr 2024
- 2024Digital Forgetting in Large Language Models: A Survey of Unlearning Methods2 Apr 2024
- 2024MultiParaDetox: Extending Text Detoxification with Parallel Data to New Languages2 Apr 2024
- 2024Detoxifying Large Language Models via Knowledge Editing21 Mar 2024
- 2024Usable XAI: 10 Strategies Towards Exploiting Explainability in the LLM Era13 Mar 2024
- 2024Exploring Multilingual Concepts of Human Value in Large Language Models: Is Value Alignment Consistent, Transferable and Controllable across Languages?28 Feb 2024
- 2024Fine-Grained Detoxification via Instance-Level Prefixes for Large Language Models23 Feb 2024
- 2024Controlled Text Generation for Large Language Model with Dynamic Attribute Graphs17 Feb 2024
- 2024Tradeoffs Between Alignment and Helpfulness in Language Models with Steering Methods29 Jan 2024
- 2023In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steering11 Nov 2023
- 2024Model Editing as a Robust and Denoised variant of DPO: A Case Study on Toxicitycited by 33
- 2024No Two Devils Alike: Unveiling Distinct Mechanisms of Fine-tuning Attackscited by 28
- 2024Tradeoffs Between Alignment and Helpfulness in Language Models with Steering Methodscited by 26
- 2024Exploring Multilingual Concepts of Human Value in Large Language Models: Is Value Alignment Consistent, Transferable and Controllable across Languages?cited by 23
- 2025Detoxifying Large Language Models via Autoregressive Reward Guided Representation Editingcited by 9
- 2024Large Language Models can be Strong Self-Detoxifierscited by 7
- 2025Why Safeguarded Ships Run Aground? Aligned Large Language Models' Safety Mechanisms Tend to Be Anchored in The Template Regioncited by 5
- 2025A Survey on Training-free Alignment of Large Language Modelscited by 2
- 2026The Geometry of Refusal: Linear Instability in Safety-Aligned LLMscited by 1
- 2026The Geometry of Refusal: Linear Instability in Safety-Aligned LLMs21 Jun 2026
- 2025Detoxifying Large Language Models via Autoregressive Reward Guided Representation Editing24 Sep 2025
- 2025A Survey on Training-free Alignment of Large Language Models12 Aug 2025
- 2025Why Safeguarded Ships Run Aground? Aligned Large Language Models' Safety Mechanisms Tend to Be Anchored in The Template Region19 Feb 2025
- 2024Large Language Models can be Strong Self-Detoxifiers4 Oct 2024
- 2024No Two Devils Alike: Unveiling Distinct Mechanisms of Fine-tuning Attacks25 May 2024
- 2024Model Editing as a Robust and Denoised variant of DPO: A Case Study on Toxicity22 May 2024
- 2024Exploring Multilingual Concepts of Human Value in Large Language Models: Is Value Alignment Consistent, Transferable and Controllable across Languages?28 Feb 2024
- 2024Tradeoffs Between Alignment and Helpfulness in Language Models with Steering Methods29 Jan 2024
- 2025MemOS: A Memory OS for AI Systemcited by 129
- 2025MemOS: A Memory OS for AI System4 Jul 2025
- 2023In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steeringcited by 240
- 2024Detoxifying Large Language Models via Knowledge Editingcited by 86
- 2024Usable XAI: 10 Strategies Towards Exploiting Explainability in the LLM Eracited by 45
- 2024Multi-property Steering of Large Language Models with Dynamic Activation Compositioncited by 35
- 2025Representation Engineering for Large-Language Models: Survey and Research Challengescited by 18
- 2024Walking in Others' Shoes: How Perspective-Taking Guides Large Language Models in Reducing Toxicity and Biascited by 17
- 2026Spherical Steering: Geometry-Aware Activation Rotation for Language Modelscited by 17
- 2024Controlled Text Generation for Large Language Model with Dynamic Attribute Graphscited by 16
- 2024MultiParaDetox: Extending Text Detoxification with Parallel Data to New Languagescited by 13
- 2025Contrastive Prompting Enhances Sentence Embeddings in LLMs through Inference-Time Steeringcited by 13
- 2024Multilingual and Explainable Text Detoxification with Parallel Corporacited by 12
- 2024RSA-Control: A Pragmatics-Grounded Lightweight Controllable Text Generation Frameworkcited by 11
12 most cited of 32 All 32 (JSON)
- 2026Focusing Condition: Inference-Time Self-Contrastive Steering Elicits Better Conditional Text Embeddings in LLMs26 Sep 2026
- 2026The Safeguard Worked. Is the LLM System Safer?1 Sep 2026
- 2026Detoxification for LLM: From Dataset Itself21 Apr 2026
- 2026Spherical Steering: Geometry-Aware Activation Rotation for Language Models9 Feb 2026
- 2026Test-Time Detoxification without Training or Learning Anything14 Jan 2026
- 2025Fine-Grained Emotion Recognition via In-Context Learning8 Oct 2025
- 2025PG-CE: A Progressive Generation Dataset with Constraint Enhancement for Controllable Text Generation22 Sep 2025
- 2025Paladin: Defending LLM-enabled Phishing Emails with a New Trigger-Tag Paradigm8 Sep 2025
- 2025Steering When Necessary: Flexible Steering Large Language Models with Backtracking25 Aug 2025
- 2025Self-Anchored Attention Model for Sample-Efficient Classification of Prosocial Text Chat10 Jun 2025
- 2025IF-GUIDE: Influence Function-Guided Detoxification of LLMs2 Jun 2025
- 2025Detoxification of Large Language Models through Output-layer Fusion with a Calibration Model2 Jun 2025
12 newest of 32 All 32 (JSON)