Large language models (LLMs) enhance security through alignment when widely used, but remain susceptible to jailbreak attacks capable of producing inappropriate content. Jailbreak detection methods show promise in mitigating jailbreak attacks through the assistance of other models or multiple model inferences. However, existing methods entail significant computational costs. In this paper, we first present a finding that the difference in output distributions between jailbreak and benign prompts can be employed for detecting jailbreak prompts. Based on this finding, we propose a Free Jailbreak Detection (FJD) which prepends an affirmative instruction to the input and scales the logits by temperature to further distinguish between jailbreak and benign prompts through the confidence of the first token. Furthermore, we enhance the detection performance of FJD through the integration of virtual instruction learning. Extensive experiments on aligned LLMs show that our FJD can effectively detect jailbreak prompts with almost no additional computational costs during LLM inference.


翻译:大型语言模型(LLM)在广泛使用时通过对齐机制增强了安全性,但仍易受越狱攻击的影响,可能生成不当内容。越狱检测方法通过借助其他模型或多重模型推理,在缓解越狱攻击方面展现出潜力。然而,现有方法通常伴随着高昂的计算成本。本文首先提出一项发现:越狱提示与良性提示的输出分布差异可用于检测越狱提示。基于此发现,我们提出了一种零成本越狱检测方法(FJD),该方法通过在输入前添加肯定性指令并利用温度参数缩放对数概率,进一步通过首个令牌的置信度区分越狱提示与良性提示。此外,我们通过集成虚拟指令学习技术提升了FJD的检测性能。在已对齐LLM上的大量实验表明,我们的FJD方法能够在LLM推理过程中几乎不增加额外计算成本的情况下,有效检测越狱提示。

0
下载
关闭预览

相关内容

大语言模型中的提示隐私保护
专知会员服务
24+阅读 · 2024年7月24日
【ICLR2024】能检测到LLM产生的错误信息吗?
专知会员服务
25+阅读 · 2024年1月23日
如何检测LLM内容?UCSB等最新首篇《LLM生成内容检测》综述
万字长文: 检索增强 LLM
专知会员服务
111+阅读 · 2023年9月17日
Xsser 一款自动检测XSS漏洞工具
黑白之道
14+阅读 · 2019年8月26日
放弃 RNN/LSTM 吧,因为真的不好用!望周知~
人工智能头条
19+阅读 · 2018年4月24日
侦测欺诈交易(异常点检测)
GBASE数据工程部数据团队
20+阅读 · 2017年5月10日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 1月31日
VIP会员
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员