大型语言模型哨兵:用于对抗性净化的LLM智能体
Large Language Model Sentinel: LLM Agent for Adversarial Purification
AI总结:
本文提出LLAMOS,一种利用智能体指令和防御指导在输入前净化对抗文本的防御方法,实验证明其能有效增强LLM的对抗鲁棒性。
摘要:
在过去两年中,大型语言模型(LLMs)的使用发展迅速。虽然这些LLM提供了相当大的便利,但它们也引发了安全问题,因为LLM容易受到一些精心设计的文本扰动所进行的对抗性攻击。在本文中,我们介绍了一种名为大型语言模型哨兵(LLAMOS)的新型防御技术,旨在通过在将对抗性文本示例输入目标LLM之前对其进行净化来增强LLM的对抗鲁棒性。我们的方法包含两个主要组成部分:a) 智能体指令,它可以模拟一个新的智能体用于对抗性防御,修改最少的字符以保持句子的原始含义,同时抵御攻击;b) 防御指导,它提供了修改干净或对抗性示例的策略,以确保有效防御和目标LLM的准确输出。值得注意的是,即使没有从对抗性示例中学习,防御智能体也表现出强大的防御能力。此外,我们进行了一项有趣的对抗性实验,我们开发了两个智能体,一个用于防御,一个用于攻击,并让它们进行相互对抗。在对抗性交互过程中,没有一个智能体完全击败另一个。在开源和闭源LLM上的大量实验表明,我们的方法有效防御了对抗性攻击,从而增强了对抗鲁棒性。
英文摘要:
Over the past two years, the use of large language models (LLMs) has advanced rapidly. While these LLMs offer considerable convenience, they also raise security concerns, as LLMs are vulnerable to adversarial attacks by some well-designed textual perturbations. In this paper, we introduce a novel defense technique named Large LAnguage MOdel Sentinel (LLAMOS), which is designed to enhance the adversarial robustness of LLMs by purifying the adversarial textual examples before feeding them into the target LLM. Our method comprises two main components: a) Agent instruction, which can simulate a new agent for adversarial defense, altering minimal characters to maintain the original meaning of the sentence while defending against attacks; b) Defense guidance, which provides strategies for modifying clean or adversarial examples to ensure effective defense and accurate outputs from the target LLMs. Remarkably, the defense agent demonstrates robust defensive capabilities even without learning from adversarial examples. Additionally, we conduct an intriguing adversarial experiment where we develop two agents, one for defense and one for attack, and engage them in mutual confrontation. During the adversarial interactions, neither agent completely beat the other. Extensive experiments on both open-source and closed-source LLMs demonstrate that our method effectively defends against adversarial attacks, thereby enhancing adversarial robustness.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。