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

加速贪婪坐标梯度与通用提示优化:探针采样方法

Accelerating Greedy Coordinate Gradient and General Prompt Optimization via Probe Sampling

National University of Singapore(新加坡国立大学);Princeton University(普林斯顿大学);Google DeepMind(谷歌DeepMind)

Yiran Zhao, Wenyue Zheng, Tianle Cai, Xuan Long Do, Kenji Kawaguchi, Anirudh Goyal, Michael Shieh

AI总结:

本文提出探针采样算法,利用草稿模型动态过滤提示候选,加速GCG等提示优化方法,在Llama2-7b-chat上实现最高5.6倍加速,同时保持或提升攻击成功率。

摘要:

大型语言模型(LLMs)的安全性因其快速发展而成为关键问题。贪婪坐标梯度(GCG)被证明能有效构造对抗性提示以突破对齐的LLMs,但GCG的优化耗时。为减少GCG的时间成本并促进对LLM安全性的更全面研究,我们研究了一种新算法,称为探针采样(Probe sampling)。该算法的核心是一种动态机制,用于确定较小草稿模型对提示候选的预测与目标模型预测的相似程度。当目标模型与草稿模型相似时,我们主要依赖草稿模型过滤大量潜在提示候选。探针采样在使用Llama2-7b-chat时实现了高达5.6倍的加速,并在AdvBench上实现了同等或更高的攻击成功率(ASR)。此外,探针采样还能加速其他提示优化技术和对抗性方法,对AutoPrompt加速1.8倍,对APE加速2.4倍,对AutoDAN加速2.4倍。

英文摘要:

Safety of Large Language Models (LLMs) has become a critical issue given their rapid progresses. Greedy Coordinate Gradient (GCG) is shown to be effective in constructing adversarial prompts to break the aligned LLMs, but optimization of GCG is time-consuming. To reduce the time cost of GCG and enable more comprehensive studies of LLM safety, in this work, we study a new algorithm called $\texttt{Probe sampling}$. At the core of the algorithm is a mechanism that dynamically determines how similar a smaller draft model's predictions are to the target model's predictions for prompt candidates. When the target model is similar to the draft model, we rely heavily on the draft model to filter out a large number of potential prompt candidates. Probe sampling achieves up to $5.6$ times speedup using Llama2-7b-chat and leads to equal or improved attack success rate (ASR) on the AdvBench. Furthermore, probe sampling is also able to accelerate other prompt optimization techniques and adversarial methods, leading to acceleration of $1.8\times$ for AutoPrompt, $2.4\times$ for APE and $2.4\times$ for AutoDAN.

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

↑