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

PrimeGuard:通过免调优路由实现安全且有用的LLMs

PrimeGuard: Safe and Helpful LLMs through Tuning-Free Routing

Dynamo AI

Blazej Manczak, Eliott Zemour, Eric Lin, Vaikkunth Mugunthan

AI总结:

提出PrimeGuard,一种利用结构化控制流的免调优推理时护栏方法,通过路由请求到LM的不同自我实例化,在无需微调的情况下克服安全性与有用性之间的权衡,显著提升安全响应比例并降低攻击成功率。

摘要:

部署语言模型(LMs)需要输出既高质量又符合安全准则。尽管推理时护栏(ITG)提供了将模型输出分布转向合规性的解决方案,但我们发现当前方法在平衡安全性与有用性方面存在困难。安全处理不合规查询的ITG方法表现出较低的有用性,而优先考虑有用性的方法则在安全性上妥协。我们将这种权衡称为“护栏税”,类似于“对齐税”。为解决此问题,我们提出PrimeGuard,一种利用结构化控制流的新型ITG方法。PrimeGuard将请求路由到LM的不同自我实例化(带有不同指令),利用其固有的指令遵循能力和上下文学习。我们的免调优方法为每个查询动态编译系统设计者准则。我们构建并发布了safe-eval,一个多样化的红队安全基准。广泛评估表明,PrimeGuard无需微调,通过(1)显著增强对迭代越狱攻击的抵抗力,(2)在安全护栏方面取得最先进结果,同时(3)匹配对齐调优模型的有用性分数,从而克服护栏税。广泛评估表明,PrimeGuard无需微调,优于所有竞争基线,通过将最大模型上安全响应比例从61%提升至97%,平均有用性分数从4.17提升至4.29,同时将攻击成功率从100%降至8%,从而克服护栏税。PrimeGuard实现可在https://github.com/dynamofl/PrimeGuard获取,safe-eval数据集可在https://huggingface.co/datasets/dynamoai/safe_eval获取。

英文摘要:

Deploying language models (LMs) necessitates outputs to be both high-quality and compliant with safety guidelines. Although Inference-Time Guardrails (ITG) offer solutions that shift model output distributions towards compliance, we find that current methods struggle in balancing safety with helpfulness. ITG Methods that safely address non-compliant queries exhibit lower helpfulness while those that prioritize helpfulness compromise on safety. We refer to this trade-off as the guardrail tax, analogous to the alignment tax. To address this, we propose PrimeGuard, a novel ITG method that utilizes structured control flow. PrimeGuard routes requests to different self-instantiations of the LM with varying instructions, leveraging its inherent instruction-following capabilities and in-context learning. Our tuning-free approach dynamically compiles system-designer guidelines for each query. We construct and release safe-eval, a diverse red-team safety benchmark. Extensive evaluations demonstrate that PrimeGuard, without fine-tuning, overcomes the guardrail tax by (1) significantly increasing resistance to iterative jailbreak attacks and (2) achieving state-of-the-art results in safety guardrailing while (3) matching helpfulness scores of alignment-tuned models. Extensive evaluations demonstrate that PrimeGuard, without fine-tuning, outperforms all competing baselines and overcomes the guardrail tax by improving the fraction of safe responses from 61% to 97% and increasing average helpfulness scores from 4.17 to 4.29 on the largest models, while reducing attack success rate from 100% to 8%. PrimeGuard implementation is available at https://github.com/dynamofl/PrimeGuard and safe-eval dataset is available at https://huggingface.co/datasets/dynamoai/safe_eval.

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

↑