测试大模型毒性防御方法,发现现有技术对隐性仇恨言论效果有限。
Measuring and Mitigating Toxicity in Large Language Models: A Comprehensive Replication Study

- 采用推理时专家机制动态调整生成内容
- 显性毒性消除率达100%,隐性仇恨言论降至98.5%
- 速度慢10倍,适合离线安全审查而非实时应用
大规模语言模型在海量网络数据上训练,会吸收其中的有害模式,导致即使面对中性提示也可能生成有害内容,带来真实部署风险。为此,本文开展全面复现研究,评估一种无需重训练的推理阶段缓解技术DExperts。研究分三步:首先在标准GPT-2模型上使用RealToxicityPrompts建立毒性基准;其次实施并评估DExperts对显性毒性的缓解效果;最后通过对抗性数据集ToxiGen测试其对隐性仇恨言论的鲁棒性。结果表明,DExperts在显性毒性检测中达到100%安全率,但在隐性仇恨言论测试中安全率下降至98.5%。同时,该方法引入10倍延迟(从0.2秒增至2.0秒/次生成),不利于实时场景。研究揭示了当前技术在显性与隐性毒性之间存在的鲁棒性差距,强调需开发更普适、低开销的新型安全机制。
原文摘要 · Abstract (English)
Large Language Models (LLMs) trained on web-scale corpora inherently absorb toxic patterns from their training data. This leads to toxic degeneration where even innocuous prompts can trigger harmful outputs. This phenomenon poses significant risks for real-world deployments. Thus, necessitating effective mitigation strategies that should maintain model utility while ensuring safety. In this comprehensive replication study, we evaluate the efficacy of DExperts (Decoding-time Experts), which is an inference-time mitigation technique that steers generation without requiring model retraining. We structured our research into three systematic phases: (1) establishing baseline toxicity measurements using RealToxicityPrompts on standard GPT-2 models; then (2) implementing and evaluating DExperts to mitigate explicit toxicity; and finally (3) stress-testing the method against implicit hate speech using the adversarial ToxiGen dataset. Our empirical results confirm that while DExperts achieves near-perfect safety rates (100%) on explicit toxicity benchmarks, it exhibits brittleness against adversarial, implicit hate speech, with safety rates dropping to 98.5%. Furthermore, we quantify a critical trade-off. The method introduces a 10x latency penalty (from 0.2s to 2.0s per generation), posing challenges for real-time deployment scenarios. This study contributes to the growing body of work on AI safety by highlighting the robustness gap between explicit and implicit toxicity mitigation. We emphasize the need for more sophisticated approaches that generalize across diverse hate-speech patterns without incurring prohibitive computational costs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。