arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.27997cs.CLcs.AIcs.LG
收藏

毒性存在于何处?语言模型中的机制定位与定向抑制

Where Does Toxicity Live? Mechanistic Localization and Targeted Suppression in Language Models

Indian Institute of Technology Gandhinagar(印度理工学院冈德辛加尔)

Himanshu Beniwal, Mayank Singh

AI总结:

通过分析毒性与中性提示的激活差异,定位特定层和神经元中的毒性,并利用推理时缩放或最小秩一权重编辑进行抑制,无需梯度下降,实现毒性降低同时保持语言质量。

摘要:

大型语言模型频繁生成有毒、仇恨或有害内容,然而现有的缓解方法依赖于昂贵的重新训练或输出级过滤,且缺乏对毒性内部起源的机制性理解。我们提出了Meow2X和TRNE,两种互补的无需重新训练的框架,通过分析毒性与中性提示之间的激活差异,将毒性定位到特定层和神经元,然后通过推理时缩放或最小秩一权重编辑进行抑制——无需任何梯度下降。在五个语言模型、两个基准测试和90种配置上的评估,使用双重安全评估器,一致地证明了毒性降低,同时保持了语言建模质量。我们的分析揭示,毒性不成比例地编码在早期MLP层中,在不同架构间有所变化,并且被单一评估器设置系统性地低估——强调了多评估器安全评估的必要性。通过连接机制可解释性与实际去毒化,我们的框架为更安全、更透明的语言模型提供了一条原则性路径。

英文摘要:

Large language models frequently generate toxic, hateful, or harmful content, yet existing mitigation methods rely on costly retraining or output-level filtering with no mechanistic insight into where toxicity originates internally. We introduce Meow2X and TRNE, two complementary retraining-free frameworks that localize toxicity to specific layers and neurons by analyzing activation differentials between toxic and neutral prompts, then suppress them via inference-time scaling or minimal rank-one weight edits -- without any gradient descent. Evaluations across five LMs, two benchmarks, and 90 configurations using dual safety evaluators demonstrate consistent toxicity reduction while preserving language modeling quality. Our analysis reveals that toxicity is disproportionately encoded in early MLP layers, varies across architectures, and is systematically underestimated by single-evaluator setups -- underscoring the need for multi-evaluator safety assessment. By bridging mechanistic interpretability with practical detoxification, our framework offers a principled path toward safer, more transparent language models.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑