Adaptive Detoxification: Safeguarding General Capabilities of LLMs through Toxicity-Aware Knowledge Editing
On the map: LLM safety and security → Safety alignment, refusal and guardrails
Abstract (arXiv)
Large language models (LLMs) exhibit impressive language capabilities but remain vulnerable to malicious prompts and jailbreaking attacks. Existing knowledge editing methods for LLM detoxification face two major challenges. First, they often rely on entity-specific localization, making them ineffective against adversarial inputs without explicit entities. Second, these methods suffer from over-editing, where detoxified models reject legitimate queries, compromising overall performance. In this paper, we propose ToxEdit, a toxicity-aware knowledge editing approach that dynamically detects toxic activation patterns during forward propagation. It then routes computations through adaptive inter-layer pathways to mitigate toxicity effectively. This design ensures precise toxicity mitigation while preserving LLMs' general capabilities. To more accurately assess over-editing, we also enhance the SafeEdit benchmark by incorporating instruction-following evaluation tasks. Experimental results on multiple LLMs demonstrate that our ToxEdit outperforms previous state-of-the-art methods in both detoxification performance and safeguarding general capabilities of LLMs.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Placed in Safety alignment, refusal and guardrails, one of 12 directions in LLM safety and security. Builds on 30 of its 48 references that are in the map. First posted on arXiv 28 May 2025.
Builds on
30 of 48 references.
Closest ancestors · 1
Same direction, newest first
Other references · 29
- 2023GPT-4 Technical Reportcited by 18,396
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 8,065
- 2023Mistral 7Bcited by 3,164
- 2017TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehensioncited by 2,955
- 2022Locating and Editing Factual Associations in GPTcited by 2,691
- 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,651
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
- 2018Don't Give Me the Details, Just the Summary! Topic-Aware Convolutional Neural Networks for Extreme Summarizationcited by 1,317
- 2021A General Language Assistant as a Laboratory for Alignmentcited by 1,055
- 2022Mass-Editing Memory in a Transformercited by 1,001
17 more
- 2022Memory-Based Model Editing at Scalecited by 447
- 2024A StrongREJECT for Empty Jailbreakscited by 385
- 2023Editing Large Language Models: Problems, Methods, and Opportunitiescited by 372
- 2023Can We Edit Factual Knowledge by In-Context Learning?cited by 285
- 2023The Unlocking Spell on Base LLMs: Rethinking Alignment via In-Context Learningcited by 257
- 2024AlphaEdit: Null-Space Constrained Knowledge Editing for Language Modelscited by 236
- 2023Transformer-Patcher: One Mistake worth One Neuroncited by 197
- 2024Secrets of RLHF in Large Language Models Part II: Reward Modelingcited by 171
- 2023Defending Large Language Models Against Jailbreaking Attacks Through Goal Prioritizationcited by 170
- 2024How Alignment and Jailbreak Work: Explain LLM Safety through Intermediate Hidden Statescited by 98
- 2024Detoxifying Large Language Models via Knowledge Editingcited by 87
- 2023Using In-Context Learning to Improve Dialogue Safetycited by 42
- 2022Detoxifying Text with MaRCo: Controllable Revision with Experts and Anti-Expertscited by 36
- 2023Separate the Wheat from the Chaff: Model Deficiency Unlearning via Parameter-Efficient Module Operationcited by 33
- 2023A Two-Stage Adaptation of Large Language Models for Text Rankingcited by 18
- 2024Knowledge Fusion By Evolving Weights of Language Modelscited by 16
- 2025Neural Parameter Search for Slimmer Fine-Tuned Models and Better Transfercited by 11
Built on by
Citing papers per year: 2025: 3; 2026: 2.
5 papers.
- 2025Guardians and Offenders: A Survey on Harmful Content Generation and Safety Mitigation of LLMcited by 9
- 2025Unified Defense for Large Language Models against Jailbreak and Fine-Tuning Attacks in Educationcited by 5
- 2025Toxicity in Online Platforms and AI Systems: A Survey of Needs, Challenges, Mitigations, and Future Directionscited by 3
- 2026Where Does Toxicity Live? Mechanistic Localization and Targeted Suppression in Language Modelscited by 0
- 2026The Safeguard Worked. Is the LLM System Safer?cited by 0
- 2026The Safeguard Worked. Is the LLM System Safer?1 Sep 2026
- 2026Where Does Toxicity Live? Mechanistic Localization and Targeted Suppression in Language Models27 May 2026
- 2025Unified Defense for Large Language Models against Jailbreak and Fine-Tuning Attacks in Education18 Nov 2025
- 2025Toxicity in Online Platforms and AI Systems: A Survey of Needs, Challenges, Mitigations, and Future Directions29 Sep 2025
- 2025Guardians and Offenders: A Survey on Harmful Content Generation and Safety Mitigation of LLM7 Aug 2025
Similar, not cited
Close in wording, no citation either way
- 2024Precision Knowledge Editing: Enhancing Safety in Large Language Models
- 2026Detoxifying LLMs via Representation Erasure-Based Preference Optimization
- 2025Breaking Bad Tokens: Detoxification of LLMs Using Sparse Autoencoders
- 2025Detoxifying Large Language Models via Autoregressive Reward Guided Representation Editing
- 2024Model Surgery: Modulating LLM's Behavior Via Simple Parameter Editing
- 2025Swallowing the Poison Pills: Insights from Vulnerability Disparity Among LLMs
- 2026Cleansing the Artificial Mind: A Self-Reflective Detoxification Framework for Large Language Models
- 2026Do Prompts Guarantee Safety? Mitigating Toxicity from LLM Generations through Subspace Intervention