Accelerating Greedy Coordinate Gradient and General Prompt Optimization via Probe Sampling

Yiran Zhao, Wenyue Zheng, Tianle Cai, Do Xuan Long, Kenji Kawaguchi +2 more
2/3/2026

No official code found. Best implementation: zhaoyiran924/Probe-Sampling (35 stars, MIT, last commit 2024-11-08).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

MIT

[NeurIPS 2024] Accelerating Greedy Coordinate Gradient and General Prompt Optimization via Probe Sampling

355Shell, PythonFeb 29, 20241 years agoMIT

Similar Papers

Cite this paper

@article{zhao2026accelerating,
  title  = {Accelerating Greedy Coordinate Gradient and General Prompt Optimization via Probe Sampling},
  author = {Yiran Zhao and Wenyue Zheng and Tianle Cai and Do Xuan Long and Kenji Kawaguchi and Anirudh Goyal and Michael Shieh},
  year   = {2026},
  eprint = {2403.01251},
  archivePrefix = {arXiv},
  doi    = {10.52202/079017-1701},
  url    = {https://arxiv.org/abs/2403.01251},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2403.01251.svg)](https://codeofpaper.com/paper/2403.01251)

Discussion