Skip to main content
QUICK REVIEW

[论文解读] PAL: Proxy-Guided Black-Box Attack on Large Language Models

Chawin Sitawarin, Norman Mu|arXiv (Cornell University)|Feb 15, 2024
Adversarial Robustness in Machine Learning被引用 4
一句话总结

本文提出 PAL(Proxy-Guided Attack on Large Language Models),这是首个针对真实世界 LLM API 的基于优化的黑盒越狱攻击。它利用一个替代的开源模型来指导基于梯度的逐 token 优化,并采用一种专为真实 API 行为设计的新损失函数,在 GPT-3.5-Turbo 上实现 84% 的攻击成功率,在 Llama-2-7B 上实现 48% 的成功率,显著优于先前最先进方法。

ABSTRACT

Large Language Models (LLMs) have surged in popularity in recent months, but they have demonstrated concerning capabilities to generate harmful content when manipulated. While techniques like safety fine-tuning aim to minimize harmful use, recent works have shown that LLMs remain vulnerable to attacks that elicit toxic responses. In this work, we introduce the Proxy-Guided Attack on LLMs (PAL), the first optimization-based attack on LLMs in a black-box query-only setting. In particular, it relies on a surrogate model to guide the optimization and a sophisticated loss designed for real-world LLM APIs. Our attack achieves 84% attack success rate (ASR) on GPT-3.5-Turbo and 48% on Llama-2-7B, compared to 4% for the current state of the art. We also propose GCG++, an improvement to the GCG attack that reaches 94% ASR on white-box Llama-2-7B, and the Random-Search Attack on LLMs (RAL), a strong but simple baseline for query-based attacks. We believe the techniques proposed in this work will enable more comprehensive safety testing of LLMs and, in the long term, the development of better security guardrails. The code can be found at https://github.com/chawins/pal.

研究动机与目标

  • 为仅通过黑盒 API 暴露的专有 LLM 提供实用且高效的安全部署评估。
  • 克服现有基于查询的攻击方法依赖随机搜索或遗传算法所带来的低效与低效问题。
  • 开发一种可扩展、低成本的方法以绕过安全微调的 LLM,实现全面的红队测试并改进安全护栏的开发。
  • 通过引入 GCG++ 改进 GCG 白盒攻击,在鲁棒性更强的模型(如 Llama-2-7B)上提升成功率。
  • 通过提出 RAL(基于随机搜索的 LLM 攻击),建立一个强大基线,证明其在极低成本下出人意料的有效性。

提出的方法

  • 利用公开可用的开源代理模型(如 Llama-2)生成梯度,以指导对抗性提示的优化。
  • 应用基于梯度的、逐 token 的优化方法,迭代优化可绕过安全对齐机制的提示后缀。
  • 采用一种专为真实世界 LLM API 设计的新损失函数,考虑不可微分输出和模型拒绝行为。
  • 使用查询高效策略:由代理模型引导搜索,最大限度减少对目标 LLM API 的昂贵调用次数。
  • 提出 GCG++ 作为 Greedy Coordinate Gradient(GCG)攻击的增强版本,引入改进的优化启发式方法和损失设计。
  • 提出 RAL(基于随机搜索的 LLM 攻击)作为简单但有效的基线,用随机搜索替代梯度引导机制,对提示 token 进行搜索。
Figure 1 : Our Proxy-Guided Attack on LLMs ( PAL ) is a query-based jailbreaking algorithm against black-box LLM APIs. It uses token-level optimization guided by an open-source proxy model. It outperforms the state-of-the-art red-teaming LLMs with a lower cost.
Figure 1 : Our Proxy-Guided Attack on LLMs ( PAL ) is a query-based jailbreaking algorithm against black-box LLM APIs. It uses token-level optimization guided by an open-source proxy model. It outperforms the state-of-the-art red-teaming LLMs with a lower cost.

实验结果

研究问题

  • RQ1在目标 LLM 不提供梯度的真实黑盒环境中,代理引导的基于优化的攻击能否实现高成功率?
  • RQ2在无法直接访问目标模型梯度的情况下,替代模型在引导对抗性提示搜索方面有多有效?
  • RQ3在与可能返回拒绝消息或非确定性输出的真实 LLM API 交互时,何种损失函数设计能最大化攻击成功率?
  • RQ4所提方法在专有模型和开源权重 LLM 上,能否在成功率和成本效率方面显著优于现有基于查询的攻击?
  • RQ5在黑盒 LLM 越狱攻击中,简单的随机搜索在多大程度上能匹配甚至超越更复杂的优化方法的性能?

主要发现

  • PAL 在 GPT-3.5-Turbo-1106 上实现了 84% 的攻击成功率,较先前最先进方法(58%)提升 28%,且成本减半。
  • 在 Llama-2-7B 上,PAL 达到 48% 的攻击成功率——远超先前最先进方法仅 4% 的水平。
  • 在 GPT-3.5-Turbo 上,平均仅需 0.88 美元即可找到一次成功的越狱,展现出极高的成本效率。
  • RAL(随机搜索变体)在 25,000 次查询内于 Llama-2-7B 上实现 26% 的攻击成功率,为未来研究建立了强大基线。
  • GCG++ 将原始 GCG 白盒攻击在 Llama-2-7B 上的成功率从 56% 提升至 80%,证明了优化技术精细化的价值。
  • 本研究证明,即使对目标模型访问有限,代理引导的优化仍能有效绕过现代 LLM 中的安全对齐机制。
Figure 2 : Illustration of our candidate-ranking heuristic. In this example, we compare four candidates with the target string of “ Sure, here is ”. Logprobs are shown as numbers above each generated token. We use the cross-entropy (aka negative log-likelihood, NLL) loss that sums the negative logpr
Figure 2 : Illustration of our candidate-ranking heuristic. In this example, we compare four candidates with the target string of “ Sure, here is ”. Logprobs are shown as numbers above each generated token. We use the cross-entropy (aka negative log-likelihood, NLL) loss that sums the negative logpr

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。