Abstract
Large Language Models (LLMs) are increasingly deployed behind proprietary APIs, creating a "black-box" environment that complicates safety evaluations. While white-box attacks—which require internal model access—are highly effective, black-box alternatives often struggle with efficiency and cost. This paper introduces PAL (Proxy-Guided Attack on LLMs), an optimization-based attack that leverages open-source proxy models and a novel "logit bias" technique to jailbreak commercial models like GPT-3.5-Turbo. PAL achieves an 84% success rate on GPT-3.5-Turbo at a cost of less than $1 per successful attack, demonstrating that proprietary guardrails are more vulnerable than previously thought.
Introduction
The safety of Large Language Models (LLMs) relies on alignment techniques designed to prevent the generation of harmful content. However, researchers have consistently found vulnerabilities through "jailbreaking"—crafting adversarial prompts that bypass these safeguards. While white-box attacks can exploit model gradients directly, commercial models (e.g., GPT-4, Gemini) are typically restricted to API access. Existing black-box attacks often rely on manual prompt engineering or secondary LLMs for rephrasing, which are frequently inefficient or easily mitigated.
The challenge lies in performing token-level optimization—the most potent form of adversarial attack—without direct access to the target model's internal state. PAL addresses this by bridging the gap between white-box efficiency and black-box constraints.
Methodology: The PAL Framework
PAL (Proxy-Guided Attack on LLMs) utilizes three core strategies to optimize adversarial suffixes against remote APIs:
- Proxy Guidance: Instead of a blind search, PAL uses a local, open-source "proxy" model (e.g., Vicuna-7B). It calculates gradients on this proxy to identify promising adversarial suffixes. These candidates are then filtered based on the proxy's loss before querying the target API, significantly reducing costs.
- The Logit Bias Trick: Most APIs return only the top-5 most likely tokens, making it difficult to calculate the loss for a specific target token (like "Sure") if it falls outside this range. PAL exploits the "logit bias" parameter in APIs to artificially boost the target token's probability, forcing it into the top-5 and allowing for precise log-probability measurement.
- Candidate-Ranking Heuristic: To optimize the query budget, PAL employs a "best-first" search. If a candidate suffix fails to elicit an immediate affirmative prefix (e.g., "Sure, here is"), the attack discards it immediately, avoiding unnecessary expenditure on full response generation.
Experimental Evaluation
The authors evaluated PAL using the ADVBENCH dataset, which consists of 50 harmful behaviors. The target models included GPT-3.5-Turbo (versions 0613 and 1106) and Llama-2-7B-chat, with Vicuna-7B serving as the proxy model. Success was measured by "Attack Success Rate (Harmful)" (ASR_H), determined through manual human labeling to ensure accuracy.
Key Results
- High Success Rates: PAL achieved an 84% ASR_H on GPT-3.5-Turbo-0613, outperforming the previous state-of-the-art attack, TAP (80%).
- Effectiveness on Llama-2: While Llama-2 is notoriously resistant to black-box attacks (previous SOTA was 4%), PAL reached a 48% success rate.
- Cost Efficiency: PAL is approximately twice as cheap as TAP, costing roughly $0.88 per successful jailbreak on GPT-3.5-Turbo.
Discussion and Insights
The study reveals several critical insights into LLM security:
- Transferability of Gradients: Gradients from small open-source models (7B parameters) are surprisingly effective at guiding attacks against much larger, proprietary systems.
- Formatting Vulnerabilities: Minor formatting details can drastically impact safety. For Llama-2, simply adding a leading space to the target string (e.g.,
" Sure"instead of"Sure") increased white-box attack success from 56% to 76%. - Optimization vs. Prompting: Algorithmic token-level optimization proves more robust than human-readable "DAN"-style prompts. PAL often generates gibberish suffixes that systematically trigger affirmative responses from the model.
Conclusion and Future Work
PAL demonstrates that high-resource environments are no longer a prerequisite for sophisticated jailbreaking. The accessibility and low cost of such attacks highlight a significant gap in current black-box safety measures. Future research must address "stateful" defenses—detecting sequences of adversarial queries—and develop alignment techniques that remain robust even when attackers utilize proxy-model guidance. Furthermore, if API providers restrict features like log-probabilities or logit bias, attacks will need to evolve into "hard-label" variants, presenting a new frontier for adversarial research.
Summary updated