arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2501.02018cs.CLcs.AIcs.CRcs.LG
收藏

通过可调的安全-性能权衡实时保护大型语言模型

Safeguarding Large Language Models in Real-time with Tunable Safety-Performance Trade-offs

New York University(纽约大学)

Joao Fonseca, Andrew Bell, Julia Stoyanovich

AI总结:

针对LLM越狱防护中安全与性能难以兼顾的问题,提出SafeNudge,在生成时通过受控文本干预实时引导安全输出,降低30%越狱成功率且几乎不影响延迟与流畅性,并支持可调权衡。

摘要:

大型语言模型(LLM)已被证明容易受到越狱攻击,即被用于诱使模型产生高风险行为的对抗性攻击。越狱已被网络犯罪分子和黑帽攻击者利用,造成重大危害,凸显出保护广泛部署模型的迫切需求。现有的防护方法包括微调模型或让LLM“自我反思”,可能延长模型推理时间、带来计算开销、降低输出的语义流畅度,并限制模型的“正常”行为。重要的是,这些安全-性能权衡(SPT)仍是研究不足的领域。本文提出一种名为SafeNudge的新型防护机制,将受控文本生成与“助推”(即利用文本干预改变模型行为)相结合。SafeNudge在越狱攻击实施期间于文本生成过程中触发,通过引导LLM生成安全响应,可将成功越狱尝试减少30%。它对推理增加的延迟极小,对输出语义流畅度的影响可忽略不计。此外,该方法支持可调的SPT。SafeNudge已开源,可通过https://pypi.org/获取,并兼容使用Hugging Face“transformers”库加载的模型。

英文摘要:

Large Language Models (LLMs) have been shown to be susceptible to jailbreak attacks, or adversarial attacks used to illicit high risk behavior from a model. Jailbreaks have been exploited by cybercriminals and blackhat actors to cause significant harm, highlighting the critical need to safeguard widely-deployed models. Safeguarding approaches, which include fine-tuning models or having LLMs "self-reflect", may lengthen the inference time of a model, incur a computational penalty, reduce the semantic fluency of an output, and restrict ``normal'' model behavior. Importantly, these Safety-Performance Trade-offs (SPTs) remain an understudied area. In this work, we introduce a novel safeguard, called SafeNudge, that combines Controlled Text Generation with "nudging", or using text interventions to change the behavior of a model. SafeNudge triggers during text-generation while a jailbreak attack is being executed, and can reduce successful jailbreak attempts by 30% by guiding the LLM towards a safe responses. It adds minimal latency to inference and has a negligible impact on the semantic fluency of outputs. Further, we allow for tunable SPTs. SafeNudge is open-source and available through https://pypi.org/, and is compatible with models loaded with the Hugging Face "transformers" library.

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

↑