Large Language Models can be Strong Self-Detoxifiers
On the map: LLM alignment / RLHF / preference optimisation → Safety alignment and jailbreak attacks
Abstract (arXiv)
Reducing the likelihood of generating harmful and toxic output is an essential task when aligning large language models (LLMs). Existing methods mainly rely on training an external reward model (i.e., another language model) or fine-tuning the LLM using self-generated data to influence the outcome. In this paper, we show that LLMs have the capability of self-detoxification without the use of an additional reward model or re-training. We propose textitSelf-disciplined Autoregressive Sampling (SASA), a lightweight controlled decoding algorithm for toxicity reduction of LLMs. SASA leverages the contextual representations from an LLM to learn linear subspaces characterizing toxic v.s. non-toxic output in analytical forms. When auto-completing a response token-by-token, SASA dynamically tracks the margin of the current output to steer the generation away from the toxic subspace, by adjusting the autoregressive sampling strategy. Evaluated on LLMs of different scale and nature, namely Llama-3.1-Instruct (8B), Llama-2 (7B), and GPT2-L models with the RealToxicityPrompts, BOLD, and AttaQ benchmarks, SASA markedly enhances the quality of the generated sentences relative to the original models and attains comparable performance to state-of-the-art detoxification techniques, significantly reducing the toxicity level by only using the LLM's internal representations.
Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Placed in Safety alignment and jailbreak attacks, one of 10 directions in LLM alignment / RLHF / preference optimisation. Builds on 50 of its 52 references that are in the map. First posted on arXiv 4 Oct 2024.
Builds on
50 of 52 references.
References · 50
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2023GPT-4 Technical Reportcited by 18,396
- 2022Training language models to follow instructions with human feedbackcited by 15,971
- 2017Proximal Policy Optimization Algorithmscited by 15,215
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
- 2021On the Opportunities and Risks of Foundation Modelscited by 4,033
- 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,720
- 2022Training Compute-Optimal Large Language Modelscited by 3,019
- 2019The Curious Case of Neural Text Degenerationcited by 2,916
38 more
- 2022BLOOM: A 176B-Parameter Open-Access Multilingual Language Modelcited by 1,984
- 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,565
- 2016Man is to Computer Programmer as Woman is to Homemaker? Debiasing Word Embeddingscited by 1,312
- 2020RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Modelscited by 1,255
- 2021Scaling Language Models: Methods, Analysis & Insights from Training Gophercited by 1,202
- 2016Semantics derived automatically from language corpora contain human-like biasescited by 901
- 2019Plug and Play Language Models: A Simple Approach to Controlled Text Generationcited by 799
- 2019CTRL: A Conditional Transformer Language Model for Controllable Generationcited by 762
- 2019Universal Adversarial Triggers for Attacking and Analyzing NLPcited by 722
- 2018Gender Bias in Coreference Resolution: Evaluation and Debiasing Methodscited by 659
- 2019The Woman Worked as a Babysitter: On Biases in Language Generationcited by 541
- 2021DExperts: Decoding-Time Controlled Text Generation with Experts and Anti-Expertscited by 441
- 2022ToxiGen: A Large-Scale Machine-Generated Dataset for Adversarial and Implicit Hate Speech Detectioncited by 422
- 2021BOLD: Dataset and Metrics for Measuring Biases in Open-Ended Language Generationcited by 412
- 2020GeDi: Generative Discriminator Guided Sequence Generationcited by 378
- 2021FUDGE: Controlled Text Generation With Future Discriminatorscited by 376
- 2021Self-Diagnosis and Self-Debiasing: A Proposal for Reducing Corpus-Based Bias in NLPcited by 337
- 2024TrustLLM: Trustworthiness in Large Language Modelscited by 285
- 2019Predicting the Type and Target of Offensive Posts in Social Mediacited by 271
- 2022Quark: Controllable Text Generation with Reinforced Unlearningcited by 237
- 2019Build it Break it Fix it for Dialogue Safety: Robustness from Adversarial Human Attackcited by 176
- 2020Recipes for Safety in Open-domain Chatbotscited by 170
- 2021Challenges in Detoxifying Language Modelscited by 169
- 2019What makes a good conversation? How controllable attributes affect human judgmentscited by 140
- 2018Learning to Write with Cooperative Discriminatorscited by 119
- 2020Towards Controllable Biases in Language Generationcited by 112
- 2021Detoxifying Language Models Risks Marginalizing Minority Voicescited by 107
- 2020CTRLsum: Towards Generic Controllable Text Summarizationcited by 98
- 2023Reward-Augmented Decoding: Efficient Controlled Text Generation With a Unidirectional Reward Modelcited by 79
- 2024Decoding-time Realignment of Language Modelscited by 67
- 2018Challenges for Toxic Comment Classification: An In-Depth Error Analysiscited by 56
- 2021A Plug-and-Play Method for Controlled Text Generationcited by 56
- 2023Self-Detoxifying Language Models via Toxification Reversalcited by 46
- 2022Critic-Guided Decoding for Controlled Text Generationcited by 45
- 2023On the Challenges of Using Black-Box APIs for Toxicity Evaluation in Researchcited by 44
- 2023Unveiling Safety Vulnerabilities of Large Language Modelscited by 27
- 2023Systematic Rectification of Language Models via Dead-end Analysiscited by 16
- 2022Language Detoxification with Attribute-Discriminative Latent Spacecited by 11
Built on by
Citing papers per year: 2025: 3; 2026: 4.
7 papers.
- 2026CausalDetox: Causal Head Selection and Intervention for Language Model Detoxificationcited by 3
- 2025GP-MoLFormer-Sim: Test Time Molecular Optimization through Contextual Similarity Guidancecited by 2
- 2025Reveal and Release: Iterative LLM Unlearning with Self-generated Datacited by 2
- 2026AI Steerability 360: A Toolkit for Steering Large Language Modelscited by 2
- 2026Cleansing the Artificial Mind: A Self-Reflective Detoxification Framework for Large Language Modelscited by 1
- 2025Can LLMs Rank the Harmfulness of Smaller LLMs? We are Not There Yetcited by 0
- 2026A Survey of Toxicity Detection and Mitigation Strategies for Multilingual Language Modelscited by 0
- 2026A Survey of Toxicity Detection and Mitigation Strategies for Multilingual Language Models24 Jun 2026
- 2026CausalDetox: Causal Head Selection and Intervention for Language Model Detoxification16 Apr 2026
- 2026AI Steerability 360: A Toolkit for Steering Large Language Models8 Mar 2026
- 2026Cleansing the Artificial Mind: A Self-Reflective Detoxification Framework for Large Language Models16 Jan 2026
- 2025Reveal and Release: Iterative LLM Unlearning with Self-generated Data18 Sep 2025
- 2025GP-MoLFormer-Sim: Test Time Molecular Optimization through Contextual Similarity Guidance5 Jun 2025
- 2025Can LLMs Rank the Harmfulness of Smaller LLMs? We are Not There Yet7 Feb 2025
Similar, not cited
Close in wording, no citation either way
- 2025Detoxification of Large Language Models through Output-layer Fusion with a Calibration Model
- 2025Breaking Bad Tokens: Detoxification of LLMs Using Sparse Autoencoders
- 2025Detoxifying Large Language Models via Autoregressive Reward Guided Representation Editing
- 2025<think> So let's replace this phrase with insult... </think> Lessons learned from generation of toxic texts with LLMs
- 2026Test-Time Detoxification without Training or Learning Anything
- 2026Measuring and Mitigating Toxicity in Large Language Models: A Comprehensive Replication Study
- 2025Refining Positive and Toxic Samples for Dual Safety Self-Alignment of LLMs with Minimal Human Interventions
- 2024Preference Tuning For Toxicity Mitigation Generalizes Across Languages