Skip to main content
QUICK REVIEW

[论文解读] Exploring Vulnerabilities and Protections in Large Language Models: A Survey

Frank Weizhen Liu, Chenhui Hu|arXiv (Cornell University)|Jun 1, 2024
Privacy-Preserving Technologies in DataComputer Science被引用 3
一句话总结

本综述系统分析了大型语言模型(LLMs)中的安全漏洞,重点关注提示词劫持(包括提示词注入和越狱攻击)以及对抗性攻击(数据 poisoning 和后门攻击)。它评估了异常检测、数据清洗、基于扰动的方法以及掩码-差异提示等防御策略,强调了在现实世界部署中应对不断演变的威胁,亟需开发强大且自适应的防御机制以保障 LLMs 的安全。

ABSTRACT

As Large Language Models (LLMs) increasingly become key components in various AI applications, understanding their security vulnerabilities and the effectiveness of defense mechanisms is crucial. This survey examines the security challenges of LLMs, focusing on two main areas: Prompt Hacking and Adversarial Attacks, each with specific types of threats. Under Prompt Hacking, we explore Prompt Injection and Jailbreaking Attacks, discussing how they work, their potential impacts, and ways to mitigate them. Similarly, we analyze Adversarial Attacks, breaking them down into Data Poisoning Attacks and Backdoor Attacks. This structured examination helps us understand the relationships between these vulnerabilities and the defense strategies that can be implemented. The survey highlights these security challenges and discusses robust defensive frameworks to protect LLMs against these threats. By detailing these security issues, the survey contributes to the broader discussion on creating resilient AI systems that can resist sophisticated attacks.

研究动机与目标

  • 识别并分类大型语言模型中的关键安全漏洞,特别是由输入操纵和训练数据污染引发的漏洞。
  • 分析提示词劫持(包括提示词注入和越狱攻击)在开源与专有 LLM 中的作用机制及其影响。
  • 研究对抗性攻击(如数据污染和后门攻击),重点关注其在现实环境中的隐蔽性与持久性。
  • 评估现有防御机制,并突出当前方法在黑盒和少样本学习场景下的不足之处。
  • 通过整合 LLM 部署中攻击与防御模式的分析,推动构建更具韧性的 AI 系统。

提出的方法

  • 根据攻击面和交互层,将 LLM 安全威胁划分为两大类:提示词劫持与对抗性攻击。
  • 通过组合式指令攻击(CIA)分析提示词注入,包括 Talking-CIA 和 Writing-CIA,这些方法将恶意指令嵌入看似无害的对话或叙述性提示中。
  • 通过基于触发器的污染方法评估后门攻击,并采用鲁棒性感知扰动(RAP)和困惑度检测(ONION)等方法识别被污染的样本。
  • 应用掩码-差异提示(MDP)通过测量输入序列中随机标记掩码对模型输出的敏感性,来检测后门。
  • 调查异常检测(使用 BERT 嵌入)、数据集清洗(以去除触发器和有效载荷)以及基于聚类的污染数据检测等防御技术。
  • 整合开源与专有模型的研究发现,以评估防御机制的泛化能力与有效性。
Figure 1: Attack and Defense Mechanisms in Large Language Models. This diagram outlines the various types of attacks on LLMs, including Prompt Hacking and Adversarial Attacks, as well as the corresponding defense mechanisms.
Figure 1: Attack and Defense Mechanisms in Large Language Models. This diagram outlines the various types of attacks on LLMs, including Prompt Hacking and Adversarial Attacks, as well as the corresponding defense mechanisms.

实验结果

研究问题

  • RQ1提示词注入与越狱攻击如何利用 LLM 的输入-输出接口绕过安全控制?
  • RQ2在黑盒环境中,数据污染与后门攻击在结构与行为上存在哪些差异?它们如何表现?
  • RQ3现有防御机制(如异常检测与数据清洗)在不降低模型性能的前提下,能在多大程度上缓解污染攻击?
  • RQ4在无法访问模型内部结构的有限条件下,基于扰动与困惑度的检测方法在识别 LLM 中后门的有效性如何?
  • RQ5在现实应用中,针对不断演变的 LLM 攻击,开发通用且自适应防御机制面临哪些关键挑战?

主要发现

  • 提示词注入攻击(如组合式指令攻击,CIA)可通过将恶意指令嵌入看似无害的对话或叙述性提示中,成功绕过安全过滤机制。
  • 越狱技术利用模型对齐机制与指令遵循行为,诱导产生有害输出,包括数据泄露与恶意内容生成。
  • 即使仅使用少量污染数据,LLM 中的后门攻击也具有高度有效性,且可通过鲁棒性感知扰动(RAP)与困惑度检测(ONION)等方法识别。
  • 掩码-差异提示(MDP)在少样本后门检测中表现出色,其原理在于被污染样本对随机标记掩码的敏感性显著增强。
  • 基于 BERT 嵌入的异常检测与数据集清洗在识别异常值和清除触发器方面有效,但常导致模型实用性与准确率下降。
  • 尽管已有防御措施,由于现有过滤与容量缩减策略保护能力有限,数据污染仍是关键威胁,凸显了对更强大、高实用性解决方案的迫切需求。
Figure 2: Jailbreak GPT-4o OpenAI ( 2024 ) using role-play strategy, which is inspired by Learn Prompting ( 2024 ) .
Figure 2: Jailbreak GPT-4o OpenAI ( 2024 ) using role-play strategy, which is inspired by Learn Prompting ( 2024 ) .

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。