CausalDetox:语言模型去毒化的因果头部选择与干预
CausalDetox: Causal Head Selection and Intervention for Language Model Detoxification
AI总结:
本文提出CausalDetox框架,通过因果分析识别并干预导致有毒生成的特定注意力头,利用PNS方法隔离必要且充分的头部,结合局部推理干预和PNS引导微调策略,有效提升去毒效果并保持语言流畅性。
摘要:
大型语言模型(LLMs)经常生成有毒内容,对安全部署构成重大风险。当前缓解策略往往降低生成质量或需要昂贵的人工标注。我们提出了CAUSALDETOX框架,该框架识别并干预因果上负责有毒生成的特定注意力头。利用概率必要性和充分性(PNS),我们隔离了一组最小的头部,这些头部对于毒性是必要且充分的。我们通过两种互补策略利用这些组件:(1)局部推理时间干预,构建动态、输入特定的引导向量以实现上下文感知的去毒;(2)PNS引导微调,永久性地消除有毒表示。我们还引入PARATOX,一个新颖的对齐有毒/非有毒句子对基准,使可控的反事实评估成为可能。在ToxiGen、ImplicitHate和ParaDetox上的实验表明,CAUSALDETOX在保持语言流畅性的同时,比基线方法实现高达5.34%的毒性减少,并在头部选择方面提供7倍的速度提升。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。