mlsanityData to 14 Oct 2026

Breaking Bad Tokens: Detoxification of LLMs Using Sparse Autoencoders

arXiv 2505.14536 ↗First posted 20 May 2025cs.CLcited by 9

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

  1. 2020Language Models are Few-Shot Learnerscited by 32,419
  2. 2017Proximal Policy Optimization Algorithmscited by 15,215
  3. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 8,065
  4. 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,899
  5. 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,886
  6. 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,100
  7. 2019BoolQ: Exploring the Surprising Difficulty of Natural Yes/No Questionscited by 2,183
  8. 2018Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book Question Answeringcited by 2,164
  9. 2019Fine-Tuning Language Models from Human Preferencescited by 2,150
  10. 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,565
  11. 2023Sparse Autoencoders Find Highly Interpretable Features in Language Modelscited by 1,420
  12. 2016Man is to Computer Programmer as Woman is to Homemaker? Debiasing Word Embeddingscited by 1,312
36 more
  1. 2020RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Modelscited by 1,255
  2. 2019Energy and Policy Considerations for Deep Learning in NLPcited by 1,254
  3. 2019Plug and Play Language Models: A Simple Approach to Controlled Text Generationcited by 799
  4. 2019CTRL: A Conditional Transformer Language Model for Controllable Generationcited by 762
  5. 2019The Woman Worked as a Babysitter: On Biases in Language Generationcited by 541
  6. 2021DExperts: Decoding-Time Controlled Text Generation with Experts and Anti-Expertscited by 441
  7. 2024Sparse Feature Circuits: Discovering and Editing Interpretable Causal Graphs in Language Modelscited by 435
  8. 2024Gemma Scope: Open Sparse Autoencoders Everywhere All At Once on Gemma 2cited by 394
  9. 2020GeDi: Generative Discriminator Guided Sequence Generationcited by 378
  10. 2023Toxicity in ChatGPT: Analyzing Persona-assigned Language Modelscited by 360
  11. 2023Emergent Linear Representations in World Models of Self-Supervised Sequence Modelscited by 319
  12. 2024Jumping Ahead: Improving Reconstruction Fidelity with JumpReLU Sparse Autoencoderscited by 300
  13. 2024LLM Agents Grounded in Self-Reports Enable General-Purpose Simulation of Individualscited by 249
  14. 2024Assessing the Brittleness of Safety Alignment via Pruning and Low-Rank Modificationscited by 231
  15. 2025AxBench: Steering LLMs? Even Simple Baselines Outperform Sparse Autoencoderscited by 218
  16. 2024A Mechanistic Understanding of Alignment Algorithms: A Case Study on DPO and Toxicitycited by 185
  17. 2025Emergent Misalignment: Narrow finetuning can produce broadly misaligned LLMscited by 172
  18. 2024A is for Absorption: Studying Feature Splitting and Absorption in Sparse Autoencoderscited by 160
  19. 2023Simulating Opinion Dynamics with Networks of LLM-based Agentscited by 154
  20. 2024An Adversarial Perspective on Machine Unlearning for AI Safetycited by 123
  21. 2021Detoxifying Language Models Risks Marginalizing Minority Voicescited by 107
  22. 2025LLM Social Simulations Are a Promising Research Methodcited by 99
  23. 2025Sparse Autoencoders Do Not Find Canonical Units of Analysiscited by 88
  24. 2021Desiderata for Representation Learning: A Causal Perspectivecited by 76
  25. 2024A Complete Survey on LLM-based AI Chatbotscited by 71
  26. 2023Word Embeddings Are Steers for Language Modelscited by 70
  27. 2022Exploring the Limits of Domain-Adaptive Training for Detoxifying Large-Scale Language Modelscited by 68
  28. 2023Self-Detoxifying Language Models via Toxification Reversalcited by 46
  29. 2024Beyond Demographics: Aligning Role-playing LLM-based Agents Using Human Belief Networkscited by 39
  30. 2024Model Editing as a Robust and Denoised variant of DPO: A Case Study on Toxicitycited by 35
  31. 2023LLM-as-a-tutor in EFL Writing Education: Focusing on Evaluation of Student-LLM Interactioncited by 29
  32. 2024SLM-Mod: Small Language Models Surpass LLMs at Content Moderationcited by 27
  33. 2024Can LLMs Recognize Toxicity? A Structured Investigation Framework and Toxicity Metriccited by 23
  34. 2025Compromising Honesty and Harmlessness in Language Models via Deception Attackscited by 17
  35. 2025Position: Editing Large Language Models Poses Serious Safety Riskscited by 15
  36. 2024Zero-shot Persuasive Chatbots with LLM-Generated Strategies and Information Retrievalcited by 14

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 8.

9 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Measuring and Mitigating Toxicity in Large Language Models: A Comprehensive Replication Study
  2. 2025Detoxifying Large Language Models via Autoregressive Reward Guided Representation Editing
  3. 2024Large Language Models can be Strong Self-Detoxifiers
  4. 2026Detoxifying LLMs via Representation Erasure-Based Preference Optimization
  5. 2026Where Does Toxicity Live? Mechanistic Localization and Targeted Suppression in Language Models
  6. 2025Adaptive Detoxification: Safeguarding General Capabilities of LLMs through Toxicity-Aware Knowledge Editing
  7. 2025Detoxification of Large Language Models through Output-layer Fusion with a Calibration Model
  8. 2024SCAR: Sparse Conditioned Autoencoders for Concept Detection and Steering in LLMs