Skip to main content
Back

Researchers Prove Prompt Rewriting Beats Gradient Attacks at Jailbreaking AI

New research puts four jailbreak attack families on a shared FLOPs axis, showing prompt rewriting beats gradient suffix search by wide margins.

Pro

Paper, Full Access
  • New scaling-law framework puts jailbreak attacks on a shared FLOPs axis for the first time.
  • Prompt-rewriting PAIR reaches a red-team ceiling of 9.80 versus GCG's 5.16 on Llama-3.1-8B.
  • Same-state analysis shows PAIR is a stronger prompt-space optimizer, even at large step sizes.
  • PAIR occupies the high-success, high-stealth corner; raw GCG suffixes are highly detectable.
  • Misinformation goals are consistently the easiest category to elicit across models.
  • Model family, not size, sets the ceiling: Llama-3.2-3B plateaus far below Gemma-3-4B and Qwen3-4B.

A new study borrows the compute-versus-performance framing that shaped modern language modeling and applies it to a very different question: how does jailbreak success scale with attacker effort? The authors treat every attack as a compute-bounded optimizer, plot success against total floating-point operations, and fit the resulting trajectories with a simple saturating curve. The result is the first apples-to-apples comparison of jailbreak paradigms that were previously incomparable because each one defined a step differently.

The paper, Systematic Scaling Analysis of Jailbreak Attacks in Large Language Models, argues that jailbreak risk is not well captured by single-budget attack success rate snapshots, and that scaling curves should be the reporting standard for red-teaming.

Why raw iteration counts lie

Existing jailbreak papers report success rates at fixed budgets, but budgets mean different things across methods. All these methods are iterative, but each defines a step differently, a gradient update, an LLM rewriting round, a population generation, or a random sample, making raw iteration counts incomparable. A single GCG gradient step chews through far more FLOPs than one BoN random sample, so ranking attacks by iterations is meaningless.

The fix is to normalize everything to the same compute axis. Total FLOPs for an attack run includes forward passes through the victim model, backward passes when gradients are needed, and forward passes through an optional auxiliary attacker model such as the rewriting LLM in PAIR. Every attack now lives on a common x-axis measured in TFLOPs.

The four contenders

The authors benchmark four representative attack styles against Llama-3.1-8B-Instruct, Qwen3 at 1.7B, 4B, and 8B, plus Gemma-3-4B and Llama-3.2-3B:

  • GCG: gradient-based discrete suffix optimization (white-box).
  • PAIR: an attacker LLM iteratively rewrites the prompt using feedback.
  • BoN: best-of-n sampling with surface-level augmentations like capitalization and character shuffling.
  • AutoDAN: a genetic algorithm that mutates prompts across generations.

Evaluation uses 200 goals drawn equally from AdvBench, HarmBench, and ClearHarm, scored by a GPT-5 judge on a 1 to 10 red-team rubric plus a separate relevance score that measures whether the output actually addresses the malicious intent.

Everything saturates, but not equally

Across every attack family, the FLOPs-versus-success curves show fast early gains followed by a plateau. The authors fit them with:

ASR(B) = a + b * (1 - exp(-c * B))

Here a is the starting score, a+b is the ceiling, and c controls how quickly the curve approaches it. Derived stats like B_50 and B_95 report the compute needed to reach 50 percent and 95 percent of achievable improvement.

On Llama-3.1-8B, the gap between paradigms is stark. PAIR achieves the strongest starting point and the highest red-team ceiling, while also saturating quickly. BoN exhibits steep early gains from a lower starting point and reaches a comparable ceiling under similar compute-to-95-percent. AutoDAN improves more gradually, and GCG is both lower-ceiling and slower-growing on the shared FLOPs axis. PAIR hits a ceiling of 9.80 versus GCG at 5.16, and reaches half-saturation in roughly 1,391 TFLOPs compared to GCG's 3,221.

The relevance metric reshuffles things. BoN overtakes PAIR in ceiling, 5.38 versus 3.86, while GCG's ceiling drops to 1.46, confirming that gradient-optimized suffixes trigger surface-level violations without producing targeted content. GCG can force a policy break, but the output often does not actually answer the attacker's question.

Why prompt rewriting wins

The most interesting section reframes PAIR as an optimizer and compares it to GCG step-by-step from identical prompt states. The authors first rule out objective mismatch by forcing PAIR to target the exact string GCG optimizes for. Even in this goal-matched setting, PAIR still reaches an asymptotic ceiling of 8.60, compared to 5.16 for GCG.

Then they measure realized loss changes per unit embedding step. When GCG's step is scaled to a practically meaningful magnitude by editing 30 tokens per step, its optimization signal fails to reliably indicate a descent direction from the same state. Cosine similarities between PAIR and GCG update directions hover near zero. The takeaway: PAIR is not merely a different attack, it is a better prompt-space optimizer that stays directionally useful at large step sizes where gradient signals collapse.

Stealth is a separate axis

Success does not imply stealth. The authors score prompt fluency with GPT-2 perplexity and plot each attack's operating point. PAIR sits in the upper-right corner with both high success and high stealthiness. AutoDAN also occupies a high-stealthiness regime but with a lower success level, while BoN attains high success at noticeably lower stealthiness. Raw GCG suffixes are essentially unreadable token soup; wrapping them in a natural-language template borrowed from Andriushchenko et al. is what makes them appear stealthy at all.

Some harms are cheaper than others

The 200-goal set is tagged into four categories: harmful instructions, malicious creation, misinformation, and offensive content. Misinformation is often easiest to elicit, with a higher starting point, consistent with the possibility that common safety training hardens overtly harmful instruction-following more than subtle falsification and deceptive misinformation. Category effects show up in both the starting point and the marginal returns to extra compute.

Where the framework transfers, and where it does not

Within a model family, size mostly changes how fast the curve saturates, not how high it climbs. Across families, the picture is different. Gemma-3-4B and Qwen3-4B both plateau near 9.9 on the red-team score, but Llama-3.2-3B-Instruct plateaus well below them at 7.26 and requires roughly six times more compute to reach half-saturation. Family choice, in other words, can put a hard ceiling on how effective a fixed attack becomes, regardless of budget.

What this changes for red-teamers

The framework is a research contribution, not a released tool, and no code repository is announced in the paper. Its practical value shows up in three places:

  1. Budget-normalized reporting: a jailbreak that hits 90 percent ASR at one million TFLOPs is not comparable to one that hits 70 percent at ten thousand, and the fitted parameters make the tradeoff explicit.
  2. Defense prioritization: knowing that prompt-rewriting attacks dominate both the efficiency and stealth frontiers suggests that fluency-based detectors and perplexity filters are increasingly weak signals.
  3. Category-aware safety training: misinformation resistance is measurably weaker than instruction-refusal resistance, which is actionable feedback for alignment teams.

The limitations are honest. FLOPs accounting depends on token counts and model constants and ignores rate limits, latency, and defender monitoring costs. LLM judges have their own biases. The 200-goal, English, single-turn, prompt-only setting excludes multi-turn attacks, tool use, and multilingual prompts. Extending the fit to ASR(B; model, attack, task, language, protocol) is called out as the natural next step, potentially with hierarchical models that pool information across settings.