Breaking Bad Tokens: Detoxification of LLMs Using Sparse Autoencoders
On the map: Mechanistic interpretability → Steering and probing for LLM safety
Abstract (arXiv)
Large language models (LLMs) are now ubiquitous in user-facing applications, yet they still generate undesirable toxic outputs, including profanity, vulgarity, and derogatory remarks. Although numerous detoxification methods exist, most apply broad, surface-level fixes and can therefore easily be circumvented by jailbreak attacks. In this paper we leverage sparse autoencoders (SAEs) to identify toxicity-related directions in the residual stream of models and perform targeted activation steering using the corresponding decoder vectors. We introduce three tiers of steering aggressiveness and evaluate them on GPT-2 Small and Gemma-2-2B, revealing trade-offs between toxicity reduction and language fluency. At stronger steering strengths, these causal interventions surpass competitive baselines in reducing toxicity by up to 20%, though fluency can degrade noticeably on GPT-2 Small depending on the aggressiveness. Crucially, standard NLP benchmark scores upon steering remain stable, indicating that the model's knowledge and general abilities are preserved. We further show that feature-splitting in wider SAEs hampers safety interventions, underscoring the importance of disentangled feature learning. Our findings highlight both the promise and the current limitations of SAE-based causal interventions for LLM detoxification, further suggesting practical guidelines for safer language-model deployment.
Key facts. Cited by 9 papers in the map (data through 14 Oct 2026). Placed in Steering and probing for LLM safety, one of 13 directions in Mechanistic interpretability. Builds on 48 of its 79 references that are in the map. First posted on arXiv 20 May 2025.
Builds on
48 of 79 references.
References · 48
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2017Proximal Policy Optimization Algorithmscited by 15,215
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 8,065
- 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,899
- 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,886
- 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,100
- 2019BoolQ: Exploring the Surprising Difficulty of Natural Yes/No Questionscited by 2,183
- 2018Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book Question Answeringcited by 2,164
- 2019Fine-Tuning Language Models from Human Preferencescited by 2,150
- 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,565
- 2023Sparse Autoencoders Find Highly Interpretable Features in Language Modelscited by 1,420
- 2016Man is to Computer Programmer as Woman is to Homemaker? Debiasing Word Embeddingscited by 1,312
36 more
- 2020RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Modelscited by 1,255
- 2019Energy and Policy Considerations for Deep Learning in NLPcited by 1,254
- 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
- 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
- 2024Sparse Feature Circuits: Discovering and Editing Interpretable Causal Graphs in Language Modelscited by 435
- 2024Gemma Scope: Open Sparse Autoencoders Everywhere All At Once on Gemma 2cited by 394
- 2020GeDi: Generative Discriminator Guided Sequence Generationcited by 378
- 2023Toxicity in ChatGPT: Analyzing Persona-assigned Language Modelscited by 360
- 2023Emergent Linear Representations in World Models of Self-Supervised Sequence Modelscited by 319
- 2024Jumping Ahead: Improving Reconstruction Fidelity with JumpReLU Sparse Autoencoderscited by 300
- 2024LLM Agents Grounded in Self-Reports Enable General-Purpose Simulation of Individualscited by 249
- 2024Assessing the Brittleness of Safety Alignment via Pruning and Low-Rank Modificationscited by 231
- 2025AxBench: Steering LLMs? Even Simple Baselines Outperform Sparse Autoencoderscited by 218
- 2024A Mechanistic Understanding of Alignment Algorithms: A Case Study on DPO and Toxicitycited by 185
- 2025Emergent Misalignment: Narrow finetuning can produce broadly misaligned LLMscited by 172
- 2024A is for Absorption: Studying Feature Splitting and Absorption in Sparse Autoencoderscited by 160
- 2023Simulating Opinion Dynamics with Networks of LLM-based Agentscited by 154
- 2024An Adversarial Perspective on Machine Unlearning for AI Safetycited by 123
- 2021Detoxifying Language Models Risks Marginalizing Minority Voicescited by 107
- 2025LLM Social Simulations Are a Promising Research Methodcited by 99
- 2025Sparse Autoencoders Do Not Find Canonical Units of Analysiscited by 88
- 2021Desiderata for Representation Learning: A Causal Perspectivecited by 76
- 2024A Complete Survey on LLM-based AI Chatbotscited by 71
- 2023Word Embeddings Are Steers for Language Modelscited by 70
- 2022Exploring the Limits of Domain-Adaptive Training for Detoxifying Large-Scale Language Modelscited by 68
- 2023Self-Detoxifying Language Models via Toxification Reversalcited by 46
- 2024Beyond Demographics: Aligning Role-playing LLM-based Agents Using Human Belief Networkscited by 39
- 2024Model Editing as a Robust and Denoised variant of DPO: A Case Study on Toxicitycited by 35
- 2023LLM-as-a-tutor in EFL Writing Education: Focusing on Evaluation of Student-LLM Interactioncited by 29
- 2024SLM-Mod: Small Language Models Surpass LLMs at Content Moderationcited by 27
- 2024Can LLMs Recognize Toxicity? A Structured Investigation Framework and Toxicity Metriccited by 23
- 2025Compromising Honesty and Harmlessness in Language Models via Deception Attackscited by 17
- 2025Position: Editing Large Language Models Poses Serious Safety Riskscited by 15
- 2024Zero-shot Persuasive Chatbots with LLM-Generated Strategies and Information Retrievalcited by 14
Built on by
Citing papers per year: 2025: 1; 2026: 8.
9 papers.
- 2026Locate, Steer, and Improve: A Practical Survey of Actionable Mechanistic Interpretability in Large Language Modelscited by 27
- 2026State Contamination in Memory-Augmented LLM Agentscited by 5
- 2026CausalDetox: Causal Head Selection and Intervention for Language Model Detoxificationcited by 3
- 2026Steering Without Breaking: Mechanistically Informed Interventions for Discrete Diffusion Language Modelscited by 3
- 2025ConceptGuard: Neuro-Symbolic Safety Guardrails via Sparse Interpretable Jailbreak Conceptscited by 2
- 2026REINS: Refusal-Enhanced Inhibitory Steering with Sparse Autoencoder Featurescited by 1
- 2026A Survey of Toxicity Detection and Mitigation Strategies for Multilingual Language Modelscited by 0
- 2026When Safety Speaks a Language: A Mechanistic Analysis of Safety-Language Identity Entanglement in LLMscited by 0
- 2026TRACE: Temporal Risk Assessment and Concept Editing for Safer Language Generationcited by 0
- 2026TRACE: Temporal Risk Assessment and Concept Editing for Safer Language Generation11 Oct 2026
- 2026When Safety Speaks a Language: A Mechanistic Analysis of Safety-Language Identity Entanglement in LLMs30 Aug 2026
- 2026REINS: Refusal-Enhanced Inhibitory Steering with Sparse Autoencoder Features28 Aug 2026
- 2026A Survey of Toxicity Detection and Mitigation Strategies for Multilingual Language Models24 Jun 2026
- 2026State Contamination in Memory-Augmented LLM Agents16 May 2026
- 2026Steering Without Breaking: Mechanistically Informed Interventions for Discrete Diffusion Language Models8 May 2026
- 2026CausalDetox: Causal Head Selection and Intervention for Language Model Detoxification16 Apr 2026
- 2026Locate, Steer, and Improve: A Practical Survey of Actionable Mechanistic Interpretability in Large Language Models20 Jan 2026
- 2025ConceptGuard: Neuro-Symbolic Safety Guardrails via Sparse Interpretable Jailbreak Concepts22 Aug 2025
Similar, not cited
Close in wording, no citation either way
- 2026Measuring and Mitigating Toxicity in Large Language Models: A Comprehensive Replication Study
- 2025Detoxifying Large Language Models via Autoregressive Reward Guided Representation Editing
- 2024Large Language Models can be Strong Self-Detoxifiers
- 2026Detoxifying LLMs via Representation Erasure-Based Preference Optimization
- 2026Where Does Toxicity Live? Mechanistic Localization and Targeted Suppression in Language Models
- 2025Adaptive Detoxification: Safeguarding General Capabilities of LLMs through Toxicity-Aware Knowledge Editing
- 2025Detoxification of Large Language Models through Output-layer Fusion with a Calibration Model
- 2024SCAR: Sparse Conditioned Autoencoders for Concept Detection and Steering in LLMs