Detoxifying Large Language Models via Localized Feature Editing with Sparse Autoencoders
Proceedings of the Thirty-Fifth International Joint Conference on Artificial Intelligence. Main Track. Pages 735-743.
https://doi.org/10.24963/ijcai.2026/83
Keywords
- AI Ethics, Trust, Fairnes: Explainability and interpretability
- Natural Language Processing: Language models
- Natural Language Processing: Language generation
- AI Ethics, Trust, Fairnes: Safety and robustness
- Natural Language Processing: Interpretability and analysis of models for NLP
Abstract
Large Language Models (LLMs) powerful generative capabilities also pose significant risks, underscoring the need for effective detoxification methods to ensure safer deployment. Due to the polysemantic nature of LLM neurons, recent neuron intervention methods inevitably entangle unrelated concepts, compromising generation quality and interpretability. Sparse Autoencoders (SAEs) have opened new horizons for decomposing model activations into monosemantic features, offering interpretability and targeted feature-level steering. Empirical findings reveal that, despite capturing interpretable features, indiscriminate interventions on toxicity-related features expose the fragility of LLMs, achieving toxicity mitigation at the cost of degraded fluency. Building upon this finding, we propose DeLFE, a lightweight controlled detoxification approach that identifies specific toxic features across model layers and performs targeted interventions on them. DeLFE learns toxicity subspaces from label-guided SAE feature subsets to characterize toxic v.s. non-toxic activation patterns. When auto-completing a response token-by-token, DeLFE tracks the toxicity-triggering risks and steers toxic features away from the subspace via a flow-matching feature transformation. We further design three feature-level strategies that adjust intervention timing and strength to reconstruct the target model’s original activations. Extensive experiments demonstrate that our method achieves strong detoxification effectiveness while maintaining high generation quality across models of varying sizes and diverse base LLMs.
@inproceedings{ijcai2026p83,
title = {Detoxifying Large Language Models via Localized Feature Editing with Sparse Autoencoders},
author = {Shang, Yuhu and Cheng, Xiang and Wang, Dianyun and Ren, Yimeng and Luo, Xuexiong and Yang, Hang and Wu, Huijia and He, Zhaofeng},
booktitle = {Proceedings of the Thirty-Fifth International Joint Conference on
Artificial Intelligence, {IJCAI-26}},
publisher = {International Joint Conferences on Artificial Intelligence Organization},
editor = {Diego Calvanese},
pages = {735--743},
year = {2026},
month = {8},
note = {Main Track},
doi = {10.24963/ijcai.2026/83},
url = {https://doi.org/10.24963/ijcai.2026/83},
}
TY - CPAPER TI - Detoxifying Large Language Models via Localized Feature Editing with Sparse Autoencoders AU - Shang, Yuhu AU - Cheng, Xiang AU - Wang, Dianyun AU - Ren, Yimeng AU - Luo, Xuexiong AU - Yang, Hang AU - Wu, Huijia AU - He, Zhaofeng T2 - Proceedings of the Thirty-Fifth International Joint Conference on Artificial Intelligence, IJCAI-26 PB - International Joint Conferences on Artificial Intelligence Organization PY - 2026 SP - 735 EP - 743 DO - 10.24963/ijcai.2026/83 UR - https://doi.org/10.24963/ijcai.2026/83 ER -Copied
Machine-readable versions of this paper, for tools and AI agents: