CausalDetox: Causal Head Selection and Intervention for Language Model Detoxification

Yian Wang, Yuen Chen, Agam Goyal, Hari Sundaram
4/16/2026
cs.CLcs.AI

No confident code implementation found for this paper.

Abstract

Large language models (LLMs) frequently generate toxic content, posing significant risks for safe deployment. Current mitigation strategies often degrade generation quality or require costly human annotation. We propose CAUSALDETOX, a framework that identifies and intervenes on the specific attention heads causally responsible for toxic generation. Using the Probability of Necessity and Sufficiency (PNS), we isolate a minimal set of heads that are necessary and sufficient for toxicity. We utilize these components via two complementary strategies: (1) Local Inference-Time Intervention, which constructs dynamic, input-specific steering vectors for context-aware detoxification, and (2) PNS-Guided Fine-Tuning, which permanently unlearns toxic representations. We also introduce PARATOX, a novel benchmark of aligned toxic/non-toxic sentence pairs enabling controlled counterfactual evaluation. Experiments on ToxiGen, ImplicitHate, and ParaDetox show that CAUSALDETOX achieves up to 5.34% greater toxicity reduction compared to baselines while preserving linguistic fluency, and offers a 7x speedup in head selection.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wang2026causaldetox,
  title  = {CausalDetox: Causal Head Selection and Intervention for Language Model Detoxification},
  author = {Yian Wang and Yuen Chen and Agam Goyal and Hari Sundaram},
  year   = {2026},
  eprint = {2604.14602},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.14602v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2604.14602.svg)](https://codeofpaper.com/paper/2604.14602)

Discussion