arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2308.07308cs.CLcs.AI
收藏

LLM自我防御:通过自我检查,LLM知道自己被欺骗了

LLM Self Defense: By Self Examination, LLMs Know They Are Being Tricked

Georgia Tech(佐治亚理工学院);Intel Labs(英特尔实验室)

Mansi Phute, Alec Helbling, Matthew Hull, ShengYun Peng, Sebastian Szyller, Cory Cornelius, Duen Horng Chau

AI总结:

本文提出LLM Self Defense方法,通过让另一个LLM实例筛查生成内容来防御对抗性提示攻击,无需微调或预处理,在GPT 3.5和Llama 2上将攻击成功率降至接近0。

摘要:

大语言模型(LLMs)因高质量的文本生成而广受欢迎,但即使通过强化学习与人类价值观对齐,也可能产生有害内容。对抗性提示可以绕过其安全措施。我们提出LLM Self Defense,这是一种简单的方法,通过让一个LLM筛查被诱导生成的响应来防御这些攻击。我们的方法不需要任何微调、输入预处理或迭代输出生成。相反,我们将生成的内容纳入一个预定义的提示中,并使用另一个LLM实例来分析文本并预测其是否有害。我们在GPT 3.5和Llama 2这两个当前最突出的LLM上测试了LLM Self Defense,针对各种类型的攻击,例如强制诱导对提示的肯定响应和提示工程攻击。值得注意的是,使用GPT 3.5和Llama 2,LLM Self Defense成功地将攻击成功率降低到几乎为0。代码公开在https://github.com/poloclub/llm-self-defense。

英文摘要:

Large language models (LLMs) are popular for high-quality text generation but can produce harmful content, even when aligned with human values through reinforcement learning. Adversarial prompts can bypass their safety measures. We propose LLM Self Defense, a simple approach to defend against these attacks by having an LLM screen the induced responses. Our method does not require any fine-tuning, input preprocessing, or iterative output generation. Instead, we incorporate the generated content into a pre-defined prompt and employ another instance of an LLM to analyze the text and predict whether it is harmful. We test LLM Self Defense on GPT 3.5 and Llama 2, two of the current most prominent LLMs against various types of attacks, such as forcefully inducing affirmative responses to prompts and prompt engineering attacks. Notably, LLM Self Defense succeeds in reducing the attack success rate to virtually 0 using both GPT 3.5 and Llama 2. The code is publicly available at https://github.com/poloclub/llm-self-defense

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

↑