TL;DR
Current automated jailbreaks—such as token-suffix search or verbose template injection—are easily caught by localized, sliding-window perplexity detectors. LatentBreak (LatB) evades these defenses by performing word-level synonym substitutions guided by latent-space feedback, steering the victim model’s internal hidden states toward the centroid of harmless requests. The resulting prompts are concise, natural, and maintain high attack success rates against both perplexity filters and advanced defenses like Circuit Breakers.
What Problem Does This Paper Address?
Automated white-box jailbreaks like GCG and GBDA append unnatural, optimized token suffixes to force target models into compliance. While effective, these suffixes produce gibberish token sequences with high perplexity. Although methods like AutoDAN use genetic algorithms to generate more natural templates, their low perplexity is an artifact of prompt-wide averaging; local perplexity spikes still exist.
The authors demonstrate that a sliding-window perplexity filter—measuring the maximum perplexity across a small window of tokens—trivially detects nearly all major white-box and black-box jailbreaks. The central challenge is therefore generating short, semantically faithful, and low-perplexity adversarial prompts that subvert safety alignment without triggering anomaly detectors.
Methods
LatentBreak is a white-box attack that iteratively rewrites harmful prompts using latent representation guidance rather than output logit optimization:
- Latent Target Centroid: The attacker extracts activations at an optimal intermediate/final decoder layer $l$ across harmless instructions (e.g., from Alpaca) and computes their mean latent centroid $\mu$.
- Contextual Word Substitution: For each word in the prompt, a substitution model (either a masked language model like ModernBERT or an LLM like GPT-4o-mini) proposes $K$ semantically plausible candidate replacements.
- Latent-Space Minimization: LatB accepts a word substitution only if:
- It reduces the Euclidean distance $\|z^{(l)}(p') - \mu\|_2$ between the prompt’s internal representation and the harmless centroid.
- An LLM intent evaluator ($J_{\text{intent}}$) confirms the prompt preserves its original harmful objective.
- Early Termination: The process iterates over prompt tokens (up to 30 iterations) and terminates as soon as a response evaluator ($J_{\text{jb}}$) confirms a successful jailbreak.
- Sliding-Window Perplexity Defense ($\text{MaxPPL}_W$): To benchmark detection, the authors formalize an upstream sliding-window detector (window size $W=10$) tuned at a 0.5% False Positive Rate (FPR), identifying localized perplexity anomalies.
Datasets
The authors evaluate attacks across established benchmarks rather than introducing a new dataset:
- Harmful Benchmarks: 159 standard malicious behavior prompts from HarmBench (primary evaluation) and a 50-behavior subset of AdvBench (for ablations and mechanistic analyses).
- Harmless Baselines / Latent Centroid: Harmless prompts sampled from Stanford Alpaca, UltraChat 200k, and OpenOrca to compute the benign centroid $\mu$ and calibrate detector thresholds at 0.5% FPR.
Key Insights and Ideas
- Latent Steering Outperforms Output Logits: Replacing the latent distance loss with a standard next-token logit maximization loss (termed LogitBreak) degrades attack performance significantly (e.g., dropping from 54% to 8% ASR on Gemma-7B). Latent representation space provides a smoother, more effective guidance landscape for discrete substitutions.
- Deepest Layers Are Most Vulnerable to Latent Shifts: Contrary to prior activation-steering work suggesting middle layers govern refusal, the optimal layer for guiding LatB substitutions resides predominantly in the final decoder layers (e.g., layer 32 of 32 in Mistral-7B and Llama-3-8B).
- Conciseness Defeats Detection: While suffix attacks expand prompts by over 100% and template attacks (SAA, AutoDAN) inflate prompts by up to 7,500%, LatB alters prompt length by only +6% to +33%. This brevity avoids the local perplexity spikes that trip sliding-window filters.
- Subtle Internal Representation Shifts: Mechanistic PCA reveals that standard jailbreaks shove prompt representations into tight clusters far from the base prompt. LatB induces only tiny shifts in representation, slipping past refusal boundaries while preserving natural text structure.
Key Results
- Resilience Against Perplexity Filtering: When evaluated on HarmBench against an upstream $\text{MaxPPL}_{10}$ detector at 0.5% FPR:
- White-box baselines (GCG, GBDA, AutoDAN) collapse from 30–90% Attack Success Rate (ASR) to near 0.0%.
- SAA drops from >80% down to under 3% ASR across most models.
- LatB retains strong ASR post-filtering, achieving 71.1% on Mistral-7B, 83.7% on Qwen-7B, 66.7% on Vicuna-13B, and 57.9% on Phi-3-mini.
- Bypassing Model-Level Hardening: Against adversarially trained R2D2, LatB achieves 20.8% post-filter ASR (where GCG, SAA, and AutoDAN achieve 0.0%). On Circuit Breakers (Mistral-7B-RR), LatB maintains 18.2% post-filter ASR.
- Optimization Speed: LatB generates an adversarial prompt in an average of 2.57 minutes, compared to 36.2 minutes for standard GCG on Vicuna-13B.
- Black-Box Transferability: Prompts generated by an ensemble of open-source models transferred to commercial models, obtaining a 9.0% ASR on Claude 3.7 Sonnet and 29.7% on Gemini-1.5-Pro.
Limitations and Future Work
- White-Box Access Requirement: LatB requires forward passes through the victim model to access intermediate decoder layer hidden states, limiting direct application against closed-source APIs (despite modest transferability).
- No Explicit Perplexity Regularization: LatB does not explicitly penalize perplexity during search; incorporating a perplexity term into the loss function could further reduce detectability.
- Substitution Model Dependency: Search quality is bounded by the candidate generation capability of the substitution model ($S_M$). GPT-4o-mini consistently outperformed ModernBERT, indicating that smaller local mask-fillers may limit attack strength.
- Jailbreak Judge Consistency: The authors note ongoing methodological challenges regarding whether automated LLM judges reliably assess subtle, real-world harms.
Summary updated