arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.06623cs.CLcs.CR
收藏

提示是否保证安全?通过子空间干预减轻大语言模型生成中的毒性

Do Prompts Guarantee Safety? Mitigating Toxicity from LLM Generations through Subspace Intervention

Department of Computer Science(计算机科学系);School of Computing, National University of Singapore(新加坡国立大学计算机学院);Department of Electronics and Communications Engineering(电子与通信工程系)

Himanshu Singh, Ziwei Xu, A. V. Subramanyam, Mohan Kankanhalli

AI总结:

本文提出了一种子空间干预策略,通过减少大语言模型生成中的毒性,同时保持生成文本的流畅性。

摘要:

大型语言模型(LLMs)是强大的文本生成器,但即使在给出看似无害的提示时,它们也可能生成有毒或有害的内容。这提出了一个严重的安全挑战,可能造成现实中的伤害。毒性往往微妙且依赖于上下文,使其在token级别或通过粗略的句子级别信号难以检测。此外,努力减轻毒性往往会面临安全性和生成文本的连贯性或流畅性之间的权衡。在本工作中,我们提出了一种针对性子空间干预策略,用于识别并抑制隐藏的有毒模式,同时保持整体生成安全流畅内容的能力。在RealToxicityPrompts上,我们的方法在与现有基线相比时表现出强大的缓解性能,对推理复杂性影响很小。在多个LLM上,我们的方法将最先进的去毒化系统中的毒性减少了8-20%,同时保持了可比的流畅性。通过广泛的定量和定性分析,我们展示了我们的方法在不损害生成性能的情况下实现了有效的毒性减少,一致地优于现有基线。

英文摘要:

Large Language Models (LLMs) are powerful text generators, yet they can produce toxic or harmful content even when given seemingly harmless prompts. This presents a serious safety challenge and can cause real-world harm. Toxicity is often subtle and context-dependent, making it difficult to detect at the token level or through coarse sentence-level signals. Moreover, efforts to mitigate toxicity often face a trade-off between safety and the coherence, or fluency of the generated text. In this work, we present a targeted subspace intervention strategy for identifying and suppressing hidden toxic patterns from underlying model representations, while preserving overall ability to generate safe fluent content. On the RealToxicityPrompts, our method achieves strong mitigation performance compared to existing baselines, with minimal impact on inference complexity. Across multiple LLMs, our approach reduces toxicity of state-of-the-art detoxification systems by 8-20%, while maintaining comparable fluency. Through extensive quantitative and qualitative analyses, we show that our approach achieves effective toxicity reduction without impairing generative performance, consistently outperforming existing baselines.

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

↑