arXiv:2604.14602cs.CLcs.AI2026-04ACL被引 2

通过因果分析精准定位并干预导致模型生成毒性的注意力头。

CausalDetox: Causal Head Selection and Intervention for Language Model Detoxification

  • 用因果指标筛选出产生毒性的最小必要注意力头
  • 实现比基线高5.34%的毒性降低且保持语言流畅性
  • 适合需要高效、可解释的AI安全优化的研究者

大语言模型常生成有毒内容,威胁其安全部署。现有缓解方法往往损害生成质量或需昂贵的人工标注。本文提出CAUSALDETOX框架,利用必要性与充分性概率(PNS)识别出对毒性生成必要且充分的最小注意力头集合。通过两种互补策略:(1) 局部推理时干预,在输入相关情境下构建动态引导向量实现上下文感知净化;(2) PNS引导微调,永久消除毒性表征。同时引入新基准PARATOX,包含对齐的有毒/无毒句子对,支持可控反事实评估。在ToxiGen、ImplicitHate和ParaDetox数据集上的实验表明,该方法相比基线提升最多5.34%的毒性减少率,同时保持语言流畅性,并实现7倍于传统方法的头选择速度。

原文摘要 · Abstract (English)

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.

模型安全因果干预注意力头毒性净化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。