TL;DR
GRAF (Globally Refining and Adaptively Fabricating) is an automated multi-turn jailbreaking framework that bypasses LLM safeguards by globally updating its remaining attack plan at every dialogue turn and actively sanitizing the conversation history. By stripping model-generated safety disclaimers and re-planning future queries on the fly, GRAF achieves an average 82.1% Attack Success Rate (ASR) across six frontier models, substantially outperforming existing single-turn and multi-turn jailbreaking baselines.
What Problem Does This Paper Address?
Direct, single-turn jailbreaks (e.g., adversarial suffixes or obfuscated phrasing) are increasingly intercepted by safety alignment and input classifiers. To bypass these defenses, researchers turned to multi-turn jailbreaking, where an attacker model gradually steers a conversation from an innocuous topic to a harmful objective.
However, existing multi-turn attacks suffer from two major flaws:
- Local, greedy refinement: When adapting to the dialogue, existing methods only tweak the immediate next query. This incremental adjustment frequently causes the attack to drift off-topic or exhaust its turn budget without reaching the malicious goal.
- Context contamination: Target models often append preachy safety disclaimers (e.g., "I want to be clear and responsible...") or outright refusals. Prior methods naively append these outputs to the conversation history, priming the model’s safety safeguards and causing subsequent queries to be rejected.
Methods
GRAF operates via an attacker model (e.g., GPT-4o / GPT-4o-mini) targeting an aligned LLM through three primary phases:
- Trajectory Initialization: The attacker model requests background information relevant to the malicious goal (e.g., asking about historical figures or technical concepts related to the target topic) and plans an initial chain of five conversational queries $Q = \{q_1, \dots, q_5\}$. The final query's predicted answer is constrained to fulfill the target task explicitly.
- Global Refinement: At step $i$, if query $q_i$ is answered, GRAF does not just plan $q_{i+1}$—it globally rewrites all remaining future queries $Q_{>i}$ based on the updated dialogue history. If $q_i$ is rejected, it refines $q_i$ using referential phrasing (e.g., referring back to "that in your previous response"); if retries fail, it globally redirects the remaining trajectory $Q_{\ge i}$ to find an alternate route.
- Active Fabrication: Exploiting API-level control over conversational state:
- Refusal Pruning: If a query is persistently rejected, the entire turn $(q_i, a_i)$ is discarded from history, preventing refusal tokens from conditioning future turns.
- Warning Removal: When the target LLM provides a compliant response that includes moralizing or safety disclaimers, the attacker model rewires the response by stripping the warnings and rephrasing the core content with smooth, confident framing before passing it back into context.
[Attacker LLM] ──(Initialize Q)──> [Trajectory Q1...QN]
│ │
(Active Fabrication: ▼
Strip warnings / drop refusals) [Target LLM Turn i]
│ │
└──────(Global Refinement of Q>i)────┘
Datasets
The authors evaluated GRAF using HarmBench, a standard benchmark covering harmful behaviors across various categories (e.g., biological threats, harassment, cyberattacks). Experiments evaluated attacks across six frontier LLMs: GPT-4o, GPT-4o-mini, Claude-3.5-Haiku, Claude-3.5-Sonnet, Llama-3.1-8B-Instruct, and Llama-3.1-70B-Instruct, as well as two reasoning models (DeepSeek-R1 and o4-mini).
Key Insights and Ideas
- Safety Disclaimers Act as Self-Reinforcing Anchors: The authors observe that when an LLM prefixes an answer with hesitation or ethical warnings, its internal attention heads and KV cache are primed toward safety, drastically increasing the refusal rate of subsequent turns. Sanitizing intermediate assistant messages in the chat history removes this behavioral anchor.
- Internal Representation Shift: Using 2D PCA on the hidden states of Llama-3 models, the authors show that while harmful and harmless queries are cleanly separable in the model's latent space, multi-turn dialogue histories progressively shift the hidden representation of harmful queries closer to the cluster of harmless queries, effectively masking malicious intent from the model's internal representations.
- Global Over Local Planning: Ablations show that global refinement contributes massive performance leaps (e.g., raising baseline multi-turn trajectories from 34% to 74% on Llama-3.1-8B), as dynamic re-planning prevents the attacker from wandering down unproductive conversational cul-de-sacs.
Key Results
- State-of-the-Art Attack Success: Evaluated using strict GPT-Judge scoring (score = 5/5), GRAF achieved an 82.1% average ASR, outperforming existing multi-turn methods like Derail (66.3%), CoA (10.3%), Crescendo (8.9%), and top single-turn attacks like ReNeLLM (40.1%).
- Performance Across Tough Targets: On highly aligned models like Claude-3.5-Sonnet, GRAF achieved 39.5% ASR (baseline Crescendo achieved 0.0%, and Derail achieved 28.0%). On GPT-4o, GRAF achieved 95.0% ASR.
- Reasoning Models Vulnerability: Without modifying their reasoning tokens directly, GRAF compromised DeepSeek-R1 (77.5% ASR) and o4-mini (59.5% ASR).
- Defeating Safeguards: Against external input-defense layers on GPT-4o-mini, GRAF maintained a 74.0% ASR against the OpenAI Moderation Endpoint and 68.0% against RA-LLM (Random Token Dropping).
- Token Efficiency: GRAF achieved these results while consuming fewer tokens than multi-turn alternatives like Derail and CoA due to its early-stopping mechanism.
Limitations and Future Work
- Requires API-Level History Control: The active fabrication mechanism assumes the attacker can arbitrarily edit past turns in the dialogue payload. It cannot be deployed out-of-the-box against web chat interfaces that enforce append-only server-side state tracking.
- Partial Resilience from Top Models: Claude-3.5-Sonnet still resisted the majority of attacks (yielding only 39.5% ASR), indicating that advanced refusal training can still present a significant barrier.
- Defense Implications: The findings demonstrate that defenses cannot rely solely on the content of the current prompt or string matching; future defenses must monitor multi-turn semantic trajectories and audit external history manipulation.
Summary updated