CausalDetox: Causal Head Selection and Intervention for Language Model Detoxification
Paper · 2026 · Yian Wang, Yuen Chen, Agam Goyal et al.
Summary
LLMs often produce toxic output. Existing fixes tend to hurt fluency, depend on expensive human labeling, or change many parameters. CausalDetox addresses this by finding the small group of attention heads that actually cause toxic generation. Each head is scored with the Probability of Necessity and Sufficiency (PNS), a counterfactual measure. A tractable lower bound is used, and confounding between head activations is handled with a VAE-based latent factor. The selected heads are then used in three ways:
- Global inference-time steering: activations are shifted in the style of ITI.
- Local intervention: each input gets its own steering vector, built from activation differences of nearby examples in representation space.
- PNS-guided fine-tuning: toxicity is concentrated in the chosen heads, so it can be removed even without active steering.
The authors also release ParaTox, a set of matched toxic/non-toxic paraphrase pairs that serve as counterfactual references. On ToxiGen, ImplicitHate and ParaDetox, the method cuts toxicity by up to 5.34% more than baselines while keeping fluency. Head selection is about 7× faster than probing. This matters because it offers an interpretable and cheaper path to safer models.
Key points
- ParaTox was built by paraphrasing ToxiGen and ImplicitHate items with Vicuna-13B. Evaluation also uses ParaDetox. Metrics are Detoxify, perplexity and GPT-4-based judging.
- In the global-vs-local comparison, local steering (K=36 heads, Top-k=256 neighbours) reached a toxicity of 0.1728. Global steering reached 0.1829 and the base model 0.2499.
- A human evaluation covered 60 generations from LLaMA-3-8B (K=36, α=5). Compared with the base model, perceived toxicity fell 23.3% under CausalDetox and 15.4% under ITI, with fluency remaining comparable.
- Limitations:
- The local variant adds retrieval latency at inference time.
- ParaTox may inherit biases from Vicuna-13B.
- Experiments cover English only.
- The PNS estimate assumes a VAE can capture the confounders.
Institutions
Fields, topics and concepts
📚 Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 16,667 worksArtificial Intelligence · 16,194 worksArts and Humanities · 16,039 worksLanguage and Linguistics · 15,891 works
🧭 Topics 1Research subjects and languages the work is about.Language models & pretraining · 3,320 works
Cite
Cite as Yian Wang, Yuen Chen, Agam Goyal and Hari Sundaram. 2026. CausalDetox: Causal Head Selection and Intervention for Language Model Detoxification. Findings of the Association for Computational Linguistics: ACL 2026.
@inproceedings{wang2026causaldetox,
title = {{CausalDetox: Causal Head Selection and Intervention for Language Model Detoxification}},
author = {Yian Wang, Yuen Chen, Agam Goyal and Hari Sundaram},
booktitle = {Findings of the Association for Computational Linguistics: ACL 2026},
year = {2026},
doi = {10.18653/v1/2026.findings-acl.577},
url = {https://doi.org/10.18653/v1/2026.findings-acl.577}
}References
- Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Aleman, Diogo Almeida, Janko Altenschmidt, Sam Altman, Shyamal Anadkat, and 1 others. 2023. Gpt-4 technical report. arXiv preprint arXiv:2303.08774.
- AI@Meta. 2024. Llama 3 model card. find
- Jinze Bai, Shuai Bai, Yunfei Chu, Zeyu Cui, Kai Dang, Xiaodong Deng, Yang Fan, Wenbin Ge, Yu Han, Fei Huang, Binyuan Hui, Luo Ji, Mei Li, Junyang Lin, Runji Lin, Dayiheng Liu, Gao Liu, Chengqiang Lu, Keming Lu, and 29 others. 2023. Qwen technical report. arXiv preprint arXiv:2309.16609.
- Yuntao Bai, Andy Jones, Kamal Ndousse, Amanda Askell, Anna Chen, Nova DasSarma, Dawn Drain, Stanislav Fort, Deep Ganguli, Tom Henighan, and 1 others. 2022. Training a helpful and harmless assistant with reinforcement learning from human feedback. arXiv preprint arXiv:2204.05862. find
- Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng, Zhanghao Wu, Hao Zhang, Lianmin Zheng, Siyuan Zhuang, Yonghao Zhuang, Joseph E. Gonzalez, Ion Stoica, and Eric P. Xing. 2023. Vicuna: An open-source chatbot impressing gpt-4 with 90%* chatgpt quality. cjadams, Jeffrey Sorensen, Julia Elliott, Lucas Dix… find
- Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, and 1 others. 2021. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168.
- Sumanth Dathathri, Andrea Madotto, Janice Lan, Jane Hung, Eric Frank, Piero Molino, Jason Yosinski, and Rosanne Liu. 2019. Plug and play language models: A simple approach to controlled text generation. arXiv preprint arXiv:1912.02164.
- Emily Dinan, Samuel Humeau, Bharath Chintagunta, and Jason Weston. 2019. Build it break it fix it for dialogue safety: Robustness from adversarial human attack. arXiv preprint arXiv:1908.06083.
- Mai ElSherief, Caleb Ziems, David Muchlinski, Vaishnavi Anupindi, Jordyn Seybolt, Munmun De Choudhury, and Diyi Yang. 2021a. Latent hatred: A benchmark for understanding implicit hate speech. arXiv preprint arXiv:2109.05322.
- Mai ElSherief, Caleb Ziems, David Muchlinski, Vaishnavi Anupindi, Jordyn Seybolt, Munmun De Choudhury, and Diyi Yang. 2021b. Latent hatred: A benchmark for understanding implicit hate speech. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 345–363, On…
- Samuel Gehman, Suchin Gururangan, Maarten Sap, Yejin Choi, and Noah A Smith. 2020. Realtoxicityprompts: Evaluating neural toxic degeneration in language models. arXiv preprint arXiv:2009.11462.
- Agam Goyal, Vedant Rathi, William Yeh, Yian Wang, Yuen Chen, and Hari Sundaram. 2025. Breaking bad tokens: Detoxification of LLMs using sparse autoencoders. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 12702–12720, Suzhou, China. Association for Co… find
- Aaron Grattafiori, Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Alex Vaughan, and 1 others. 2024. The llama 3 herd of models. arXiv preprint arXiv:2407.21783.
- Skyler Hallinan, Alisa Liu, Yejin Choi, and Maarten Sap. 2022. Detoxifying text with marco: Controllable revision with experts and anti-experts. arXiv preprint arXiv:2212.10543. find
- Chi Han, Jialiang Xu, Manling Li, Yi Fung, Chenkai Sun, Nan Jiang, Tarek Abdelzaher, and Heng Ji. 2024. find
- Word embeddings are steers for language models. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 16410–16430. Laura Hanu and Unitary team. 2020. Detoxify. Github. https://github.com/unitaryai/detoxify. ↗
- Thomas Hartvigsen, Saadia Gabriel, Hamid Palangi, Maarten Sap, Dipankar Ray, and Ece Kamar. 2022. Toxigen: A large-scale machine-generated dataset for adversarial and implicit hate speech detection. arXiv preprint arXiv:2203.09509.
- Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Liang Wang, Weizhu Chen, and 1 others. 2022. Lora: Low-rank adaptation of large language models. Iclr, 1(2):3.
- Fred Jelinek, Robert L Mercer, Lalit R Bahl, and James K Baker. 1977. Perplexity—a measure of the difficulty of speech recognition tasks. The Journal of the Acoustical Society of America, 62(S1):S63–S63. find
- Albert Q. Jiang, Alexandre Sablayrolles, Arthur Mensch, Chris Bamford, Devendra Singh Chaplot, Diego de las Casas, Florian Bressand, Gianna Lengyel, Guillaume Lample, Lucile Saulnier, and 1 others. 2023. Mistral 7b. arXiv preprint arXiv:2310.06825. find
- Diederik P Kingma, Max Welling, and 1 others. 2013. Auto-encoding variational bayes.
- Ching-Yun Ko, Pin-Yu Chen, Payel Das, Youssef Mroueh, Soham Dan, Georgios Kollias, Subhajit Chaudhury, Tejaswini Pedapati, and Luca Daniel. 2024. Large language models can be strong self-detoxifiers. arXiv preprint arXiv:2410.03818. — [arXiv:2410.03818](https://arxiv.org/abs/2410.03818) find
- Ben Krause, Akhilesh Deepak Gotmare, Bryan McCann, Nitish Shirish Keskar, Shafiq Joty, Richard Socher, and Nazneen Fatema Rajani. 2020. Gedi: Generative discriminator guided sequence generation. arXiv preprint arXiv:2009.06367.
- Andrew Lee, Xiaoyan Bai, Itamar Pres, Martin Wattenberg, Jonathan K Kummerfeld, and Rada Mihalcea. 2024. A mechanistic understanding of alignment algorithms: A case study on dpo and toxicity. arXiv preprint arXiv:2401.01967. find
- Kenneth Li, Oam Patel, Fernanda Viégas, Hanspeter Pfister, and Martin Wattenberg. 2023a. Inference-time intervention: Eliciting truthful answers from a language model. Advances in Neural Information Processing Systems, 36:41451–41530.
- Kenneth Li, Oam Patel, Fernanda Viégas, Hanspeter Pfister, and Martin Wattenberg. 2024. Inference-Time Intervention: Eliciting Truthful Answers from a Language Model. arXiv preprint. ArXiv:2306.03341 [cs].
- Xiang Lisa Li, Ari Holtzman, Daniel Fried, Percy Liang, Jason Eisner, Tatsunori B Hashimoto, Luke Zettlemoyer, and Mike Lewis. 2023b. Contrastive decoding: Open-ended text generation as optimization. In Proceedings of the 61st annual meeting of the association for computational linguistics (volume 1…
- Francesco Locatello, Ben Poole, Gunnar Rätsch, Bernhard Schölkopf, Olivier Bachem, and Michael Tschannen. 2020. Weakly-Supervised Disentanglement Without Compromises. arXiv preprint. ArXiv:2002.02886 [cs, stat]. — [arXiv:2002.02886](https://arxiv.org/abs/2002.02886) find
- Varvara Logacheva, Daryna Dementieva, Sergey Ustyantsev, Daniil Moskovskiy, David Dale, Irina Krotova, Nikita Semenov, and Alexander Panchenko. 2022. Paradetox: Detoxification with parallel data. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Lo…
- Rahul Madhavan, Rishabh Garg, Kahini Wadhawan, and Sameep Mehta. 2023. Cfl: Causally fair language models through token-level attribute controlled generation. In Findings of the Association for Computational Linguistics: ACL 2023, pages 11344–11358. find
- Rahul Madhavan and Kahini Wadhawan. 2024. Causal ate mitigates unintended bias in controlled text generation. In Proceedings of the 28th Conference on Computational Natural Language Learning, pages 130–142. find
- Goutham Rajendran, Simon Buchholz, Bryon Aragam, Bernhard Schölkopf, and Pradeep Ravikumar. 2024. From causal to concept-based representation learning. Advances in Neural Information Processing Systems, 37:101250–101296. find
- Pau Rodriguez, Arno Blaas, Michal Klein, Luca Zappella, Nicholas Apostoloff, Marco Cuturi, and Xavier Suau. 2024. Controlling language and diffusion models by transporting activations. arXiv preprint arXiv:2410.23054. — [arXiv:2410.23054](https://arxiv.org/abs/2410.23054) find
- Raanan Y Rohekar, Yaniv Gurwicz, and Shami Nisi-mov. 2024. Causal interpretation of self-attention in pre-trained transformers. Advances in Neural Information Processing Systems, 36. find
- Bernhard Schölkopf, Francesco Locatello, Stefan Bauer, Nan Rosemary Ke, Nal Kalchbrenner, Anirudh Goyal, and Yoshua Bengio. 2021. Toward causal representation learning. Proceedings of the IEEE, 109(5):612–634. find
- Bernhard Schölkopf, Francesco Locatello, Stefan Bauer, Nan Rosemary Ke, Nal Kalchbrenner, Anirudh Goyal, and Yoshua Bengio. 2021. Toward Causal Representation Learning. Proceedings of the IEEE, 109(5):612–634. Conference Name: Proceedings of the IEEE. find
- Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. 2022. Locating and editing factual associations in gpt. Advances in Neural Information Processing Systems, 35:17359–17372. find
- Xavier Suau, Pieter Delobelle, Katherine Metcalf, Armand Joulin, Nicholas Apostoloff, Luca Zappella, and Pau Rodríguez. 2024. Whispering experts: Neural interventions for toxicity mitigation in language models. arXiv preprint arXiv:2407.12824. — [arXiv:2407.12824](https://arxiv.org/abs/2407.12824) find
- Eshaan Nichani, Alex Damian, and Jason D Lee. 2024. How transformers learn causal structure with gradient descent. arXiv preprint arXiv:2402.14735. — [arXiv:2402.14735](https://arxiv.org/abs/2402.14735) find
- Raphael Suter, Ðord̄e Miladinović, Bernhard Schölkopf, and Stefan Bauer. 2019. Robustly disentangled causal mechanisms: Validating deep representations for interventional robustness. Preprint, arXiv:1811.00007. — [arXiv:1811.00007](https://arxiv.org/abs/1811.00007) find
- Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, and 1 others. 2022. Training language models to follow instructions with human feedback. Advances in neural information processing systems, 35:27730–27744.
- Rheeya Uppaal, Apratim Dey, Yiting He, Yiqiao Zhong, and Junjie Hu. 2024. Model editing as a robust and denoised variant of dpo: A case study on toxicity. arXiv preprint arXiv:2405.13967. — [arXiv:2405.13967](https://arxiv.org/abs/2405.13967) find
- Judea Pearl. 2009. Causality: Models, Reasoning and Inference, 2nd edition. Cambridge University Press, USA. find
- Yixin Wang and Michael I Jordan. 2021. Desiderata for representation learning: A causal perspective. arXiv preprint arXiv:2109.03795. — [arXiv:2109.03795](https://arxiv.org/abs/2109.03795) find
- Judea Pearl, Madelyn Glymour, and Nicholas P. Jewell. 2021. Causal inference in statistics: a primer, reprinted with revisions edition. Wiley, Chichester. find
- Yixin Wang and Michael I. Jordan. 2022. Desiderata for Representation Learning: A Causal Perspective. arXiv preprint. ArXiv:2109.03795 [cs, stat]. — [arXiv:2109.03795](https://arxiv.org/abs/2109.03795) find
- Jonas Peters, Peter Bühlmann, and Nicolai Meinshausen. 2015. Causal inference using invariant prediction: identification and confidence intervals. arXiv preprint. ArXiv:1501.01332 [stat]. find
- Johannes Welbl, Amelia Glaese, Jonathan Uesato, Sumanth Dathathri, John Mellor, Lisa Anne Hendricks, Kirsty Anderson, Pushmeet Kohli, Ben Coppin, and Po-Sen Huang. 2021. Challenges in detoxifying language models. arXiv preprint arXiv:2109.07445.
- Rafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D Manning, Stefano Ermon, and Chelsea Finn. 2023. Direct preference optimization: Your language model is secretly a reward model. Advances in Neural Information Processing Systems, 36:53728– 53741.
- Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pier-ric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, and 1 others. 2020. Transformers: State-of-the-art natural language processing. In Proceedings of the 2020 conference on empirical methods in natural lan…
- Albert Xu, Eshaan Pathak, Eric Wallace, Suchin Gururangan, Maarten Sap, and Dan Klein. 2021. Detoxifying language models risks marginalizing minority voices. arXiv preprint arXiv:2104.06390.
- Xuandong Zhao, Xianjun Yang, Tianyu Pang, Chao Du, Lei Li, Yu-Xiang Wang, and William Yang Wang. 2024. Weak-to-strong jailbreaking on large language models. arXiv preprint arXiv:2401.17256. — [arXiv:2401.17256](https://arxiv.org/abs/2401.17256) find
- Zhanhui Zhou, Jie Liu, Jing Shao, Xiangyu Yue, Chao Yang, Wanli Ouyang, and Yu Qiao. 2024. Beyond one-preference-fits-all alignment: Multi-objective direct preference optimization. In Findings of the Association for Computational Linguistics: ACL 2024, pages 10586–10613. find
- Anonymous Zhu and Others. 2023. Vicuna: Open-source chatbot trained by fine-tuning llama on sharegpt conversations. arXiv preprint arXiv:2306.05685.
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/wang-2026-causaldetox-causal-head-selection-intervention/