Rapid Response: Mitigating LLM jailbreaks with a few examplesRapid Response: Mitigating LLM Jailbreaks with a Few Examples
The authors propose jailbreak rapid response; Guard Fine-tuning reduces in-distribution ASR by an average of 99.6% with 1 example per strategy.
The victim system is an input-guarded LLM. The attacker uses six black-box strategies implemented with EasyJailbreak, and can iteratively rewrite to bypass updated defenses. The defender only observes a small number of successful instances. The paper assumes harmful outputs can be judged after being sent to the user, but cannot be detected during generation. The goal is to reduce in-distribution and out-of-distribution ASR, and to measure WildChat refusal rate.
- Static defenses that completely block jailbreaks are still not achievable, and new defenses can also be quickly broken. The authors instead address misuse with rapid response: after detecting a small number of new jailbreaks, adapt as soon as possible to block the entire class of attacks.
- Builds RapidResponseBench: given a small number of successful examples for six black-box strategies, use a language model to proliferate similar jailbreaks, then update the input-side defense. Among the five methods, the authors call fine-tuning the input classifier the strongest.
- Averaged over three models, Guard Fine-tuning with only 1 example per strategy reduces in-distribution ASR by an average of 99.6% and out-of-distribution by 93.6%. Without proliferation, the combined ASR is 12%, and after 1000 proliferations it is about 1.3%.
- The authors state that when a single output can cause significant harm, rapid response alone may not be enough; future attacks may also be harder to mitigate. The conclusion also calls for research on threat modeling, real-time detection, and improved responses. The experiments include 3 generation models and 6 black-box strategies; the paper does not report the number of repetitions or agreement between reviewers and humans.
- Evaluated models
- GPT-4oLlama-3-Instruct-8BMistral-7B-Instruct-v0.2Llama-Guard-2-8B
- Benchmarks
- RapidResponseBenchAdvBenchWildChat
- Metrics
- ASRrefusal rate
The paper proposes a rapid-response defense approach for large language models: after observing a small number of examples of each jailbreak strategy, it automatically generates similar jailbreak samples and trains a defense on them to block the entire class of jailbreaks. To this end, the authors build the RapidResponseBench benchmark and evaluate five methods that all rely on such jailbreak proliferation. The strongest method fine-tunes an input classifier to intercept proliferated jailbreaks, reducing the attack success rate by more than 240x on in-distribution and more than 15x on out-of-distribution in this benchmark, while observing only one example per jailbreak strategy. The study also shows that the quality of the proliferation model and the number of proliferated examples play a key role in defense effectiveness.
Related events and news
0 events · 1 news mentions
News that mentions this paper
- AI Frontierscites the paper's id or linkMATS 与 FAR.AI 作者提出修复 AI 越狱披露机制的两层方案
the claim that these fixes require long-term effort, as some methods enable defenders to block a whole class of jailbreaks with a few examples.) We tried out these mechanisms.
Paper analysis
What problem does this paper attempt to solve?
The authors propose rapid response: block an entire attack class after observing only a small number of jailbreaks, rather than pursuing static full robustness.
When complete immunity to jailbreaks is impossible, how can a whole class of jailbreaks be blocked with only a few observed attacks, thereby limiting LLM misuse.
- Scenario: The authors state that increased model capabilities raise misuse risk, and some labs have publicly committed to reducing catastrophic misuse. Jailbreaks are techniques to extract harmful information from models trained to be helpful, harmless, and honest.
- Difficulty of existing paths: The authors state that adversarial robustness remains unsolved; even representation rerouting and similar methods are publicly broken within hours of release. The authors cite Carlini (2024) on "limited progress" over a decade in computer vision and worry that LLM defenses may face a similar situation.
- This work's shift: Instead of pursuing a static system that resists all jailbreaks, it emphasizes monitoring for new jailbreaks and quickly changing defenses after observation.
- Proposal: Proposes Jailbreak Rapid Response and uses RapidResponseBench to compare rapid response techniques. All five methods rely on jailbreak proliferation, which automatically generates similar samples from a small number of observed jailbreaks.
- Threat model:
- Goal: Reduce the ASR of new attempts of observed strategies (in-distribution) and their unseen variants (out-of-distribution), while also looking at the benign query refusal rate.
- Knowledge: Six strategies are implemented by EasyJailbreak, which the paper calls black-box jailbreak strategies.
- Capabilities: Attackers can propose new algorithms or iteratively modify existing jailbreaks to bypass updated defenses; defenders can only use a small number of successful instances.
- Victim system: input-guarded LLM. The authors assume harmful outputs can be judged after being sent to the user, but cannot be detected during generation.
What related research exists?
The paper distinguishes rapid response from static adversarial defenses, and proliferation generates variants similar to observed attacks rather than new attacks.
Related work is organized according to the groupings in Section 5 of the paper and in the introduction.
Adversarial defenses
- Feedback training: Ouyang et al. (2022), Bai et al. (2022a), Team et al. (2023), Dubey et al. (2024) use human feedback; Bai et al. (2022b) use AI feedback. The paper states that advanced models trained this way can still be broken by jailbreaks (Wei et al., 2023a; Mazeika et al., 2024).
- Other defenses: refusal examples (Wei et al., 2023b), averaging answers over perturbed inputs (Robey et al., 2023), checking refusal after randomly dropping tokens (Cao et al., 2023), representation re-routing (Zou et al., 2024). The paper states that many methods are publicly broken within hours of release, and contrasts with this work: rapid response emphasizes monitoring and adaptation, not stronger static defenses.
Red teaming, adversarial training, and data augmentation
- Automated red teaming: Perez et al. (2022), Yu et al. (2023), Hong et al. (2024), Samvelyan et al. (2024) find new attacks. The paper distinguishes: proliferation only generates variants similar to already observed attacks; this work uses few-shot prompting.
- Training and augmentation: adversarial training (Liu et al., 2020; Yoo and Qi, 2021) is mostly done before deployment; the paper states that rapid response adapts to vulnerabilities discovered during deployment. The paper also views proliferation as data augmentation (Wei and Zou, 2019; Shorten and Khoshgoftaar, 2019).
Jailbreak attacks
- Search and low perplexity: GCG (Zou et al., 2023) uses gradients to find universal jailbreaks, which the paper states are often high-perplexity. Low-perplexity work includes persuasion (Zeng et al., 2024), gradient search (Zhu et al., 2023), genetic algorithms (Liu et al., 2023), reverse language models (Pfau et al., 2023), and PAIR (Chao et al., 2023); the paper states these can bypass perplexity filters (Jain et al., 2023).
- Black-box and obfuscation: TAP (Mehrotra et al., 2023) can find system-level jailbreaks that bypass input-output guards. There are also uncommon inputs (Huang et al., 2024), low-resource languages (Deng et al., 2023), substitution ciphers (Yuan et al., 2024; Handa et al., 2024), and many-shot (Anil et al., 2024). The paper states that if an attacker knows the specific rapid response technique, they might design new strategies against it, and this requires further research.
Baselines and data
- Baselines: Regex, Guard Fine-tuning, Embedding, Guard Few-shot, Defense Prompt, all used for input-guarded systems and using proliferated samples.
- Data: RapidResponseBench; harmful behaviors taken from AdvBench; benign refusals use WildChat. Strategies are implemented by EasyJailbreak.
The authors position this work as rapid adaptation during deployment, not static robustness before deployment, nor automated red teaming aimed at discovering new attacks.
How does the paper address this problem?
A small number of successful jailbreaks are proliferated and then used to update the input guard; among the five methods, the authors call fine-tuning the input classifier the strongest.
The overall approach is Jailbreak Rapid Response: for models with input guards, after seeing a small number of successful jailbreaks, use jailbreak proliferation to generate similar variants, then update the input-side defense. The evaluation vehicle is RapidResponseBench.
Setup and judgment
- Three metrics: in-distribution ASR (new attempts of the same strategy), out-of-distribution ASR (unseen variants of that strategy), and benign refusal rate on WildChat.
- Adaptation method: the defense is allowed to observe a small number of successful instances, and measurements are repeated as the observation count increases, to simulate updating after discovering new jailbreaks in deployment.
- Judgment: Chao et al. (2024)'s Llama-3-Instruct-70B jailbreak classifier serves as the ground truth for whether an input elicits a harmful response. The authors assume this judgment can be done post hoc, but not during output generation.
- Systems: generation models are GPT-4o, Llama-3-Instruct-8B, and Mistral-7B-Instruct-v0.2; the input guard is Llama-Guard-2-8B. Main results are averaged across models. A strategy with ASR 0 on a target is ignored; the paper states that only MSJ is like this for GPT-4o.
Strategies and data
- Scale: six black-box strategies are implemented with EasyJailbreak. In-distribution training, in-distribution testing, and out-of-distribution testing each generate 100 behaviors randomly drawn from AdvBench, with the three sets of behaviors mutually disjoint.
- Rewriting, nesting, and multi-turn: PAIR is iteratively rewritten by an attack LLM; out-of-distribution adds translation, random character insertion, and misspelling of sensitive words; the paper does not give the name of this attack LLM. ReNeLLM embeds the request in a scenario and applies transformations; in-distribution completes a latex table or Python script, out-of-distribution completes a paragraph. Crescendo uses an attack LLM over multiple turns to steer the conversation toward a restricted topic; out-of-distribution encodes the user prompt in leetspeak or base64.
- Competing goals, few-shot, and encoding: Skeleton Key requires the model to change behavior and use warnings instead of direct refusals, introducing a goal competing with the harmless goal; out-of-distribution adds a competing goal requiring responses to start with an affirmative. MSJ places multiple harmful behavior examples in context; out-of-distribution increases the number of shots and adds instructions in each shot that make the guard judge it safe (Appendix B). Cipher uses Caesar or ASCII in-distribution and Morse out-of-distribution.
- Benign queries: refusal rate uses WildChat, i.e., queries submitted to ChatGPT and filtered for inappropriate content by the OpenAI moderation API and Detoxify.
Proliferation
- Role: expands a small number of observed jailbreaks into similar attacks, given to the defense along with benign queries. The paper distinguishes this from automated red teaming that seeks new attacks, and calls it data augmentation.
- Main setting: 1000 per strategy, evenly distributed across different harmful behaviors. The model is Llama-3.1-70B-Instruct. It first summarizes the strategy used in the examples, then generates new prompts, and pre-fills the assistant response to encourage the model to comply with the request.
- Constraints: Appendix C assumes the defense cannot distinguish attack categories, so only one example jailbreak is provided at a time. Multi-turn examples require multi-turn output; when context is exceeded, turns are truncated from the front of the conversation. Appendix C gives the full prompts.
- Examples: Appendix D gives proliferation examples, including results close to the original attack and target behavior, as well as results that fail to faithfully reproduce them.
Five updates
- Regex: Claude-3.5-Sonnet generates regexes for examples and proliferations, with up to 5 iterations, aiming to match the attack and reduce false positives on static benign prompts. At inference, any regex hit is treated as a jailbreak. Appendix E gives the prompts.
- Guard Fine-tuning: fine-tunes Llama-Guard-2-8B with example jailbreaks, proliferations, and an equal number of benign prompts. LoRA rank 8, alpha 32, no dropout; batch size 32, learning rate 1e-4, 8-bit AdamW, linear learning rate, warmup 10% of total steps, 1 epoch. The harmful side has about 5000 (GPT-4o) or about 6000 (other targets). The classification threshold is calibrated on the training set so the refusal rate matches the original system.
- Embedding: trains logistic regression on prompt embeddings from all-MiniLM-L6-v2. The benign set has 6000 items, with sample weights 5 times for jailbreaks and proliferations; the harmful side has about 5000 (GPT-4o) or about 6000 (other targets).
- Few-shot and suffix: Guard Few-shot puts the 5 jailbreaks or proliferations with the highest embedding cosine similarity into Llama-Guard-2-8B's context. Defense Prompt uses Claude-3.5-Sonnet to generate a suffix appended to the user prompt, with up to 5 iterations, to make the attack fail while similar non-attack prompts remain answerable; at inference, it is selected by similarity. Appendix E gives the prompts. The guard context limit is 8192 tokens; when exceeded, the middle is truncated, keeping the template's beginning and end.
What experiments did the paper conduct?
Guard Fine-tuning with 1 example per strategy reduces in-distribution ASR by an average of 99.6% and out-of-distribution by 93.6%.
Experimental setup
- Models: Generation models are GPT-4o, Llama-3-Instruct-8B, Mistral-7B-Instruct-v0.2; input guard is Llama-Guard-2-8B. Fig. 2 averages over these three models and six strategies (Appendix A).
- Data: Six black-box strategies; 100 AdvBench behaviors each for in-distribution training, in-distribution testing, and out-of-distribution testing, with disjoint sets. MSJ has an ASR of 0 on GPT-4o, so that combination is excluded. Benign refusals use WildChat; the paper does not specify the number of queries in this evaluation.
- Defenses and tools: Regex, Guard Fine-tuning, Embedding, Guard Few-shot, Defense Prompt. The main proliferation model is Llama-3.1-70B-Instruct, with 1000 per strategy. Regular expressions and suffixes are generated by Claude-3.5-Sonnet; embeddings use all-MiniLM-L6-v2.
- Metrics and review: ASR, and WildChat refusal rate. Harmfulness is determined by a Llama-3-Instruct-70B jailbreak classifier. The paper does not report the number of repetitions, number of attack queries, or statistical tests.
- Proliferation analysis protocol: §3.3 observes only 1 successful jailbreak per strategy. Proliferation models range from 8B to 405B, with capability represented by HELM MMLU; the paper does not name the models. Counts range from 0 to 1000; when fewer than 1000, data is repeated to match the scale of 1000, and for 0, observed jailbreaks are repeated.
Main results
Per-model numbers for the three generation models are not listed in the main text; see Fig. 4. The table below only includes summaries stated in the main text. The first two rows both refer to fine-tuning the input classifier with 1 example per category; the paper does not provide the process for converting relative reductions into fold changes. The third row lists two methods together, with a method scope different from the second row.
Swipe horizontally to read the table
Method and condition In-distribution Out-of-distribution Source Guard Fine-tuning, 1 example per category, across models, relative ASR reduction 99.6% 93.6% Introduction Strongest method in abstract, 1 example per category, reduction factor >240x >15x Abstract Guard Fine-tuning and Regex, 1 example per category, average over three models >15x Not reported Fig. 2a, §3.2 Embedding, Guard Few-shot, Defense Prompt Not reported Not reported Fig. 2 - The authors state that ASR decreases as the number of observed examples per category increases, and sample efficiency varies by method; the figure caption states that Guard Fine-tuning and Regex have high sample efficiency (Fig. 2a).
- The authors state that all methods have lower out-of-distribution ASR than the original model, with more observations leading to lower ASR, but out-of-distribution generally lags behind in-distribution. Regex and Embedding have greater out-of-distribution degradation than Guard Few-shot and Guard Fine-tuning; Defense Prompt is sometimes better out-of-distribution. The authors state that for a given number of observations, Guard Fine-tuning achieves the largest out-of-distribution reduction and has less out-of-distribution degradation than Regex (Fig. 2b).
- The authors state that all methods increase the WildChat refusal rate, with acceptable increases relative to baseline; Guard Fine-tuning has the smallest increase. The authors state this is because the guard learns to better distinguish jailbreaks, not just shift the classification boundary, and that Llama-Guard-2 was likely not trained on WildChat, so the phenomenon partly comes from fine-tuning making the guard more aligned with WildChat (Fig. 2c). Per-strategy curves are in Fig. 5; the main text has no readings.
Proliferation model capability and count
- Setup: Only 1 successful jailbreak is observed per strategy; the metric is the average ASR combining in-distribution and out-of-distribution (Fig. 3). The abstract states that proliferation model quality and proliferation quantity play a key role in this defense.
- Model scale: From weakest to strongest, Guard Fine-tuning's ASR drops by about 40%, but not strictly monotonically; other defenses gain little from stronger models. The authors believe this is related to whether the attack generation model and the proliferation model are similar, whether proliferation is diverse, and the difficulty of bypassing the proliferation model's safety training, none of which are captured by HELM MMLU. The paper's ~40% here is not written as a relative reduction or percentage points.
- Count: Guard Fine-tuning drops from 12% with no proliferation to about 1.3% with maximum proliferation. The authors state that Regex and Embedding roughly halve ASR. With no proliferation, Defense Prompt initially outperforms Guard Fine-tuning and Regex, but improves little with more proliferation, and ends with higher ASR. The authors state that Guard Fine-tuning best utilizes proliferation data.
Other ablations and analyses
- Fig. 2's x-axis is the number of examples per strategy; the main text only explicitly states the lower bound of the factor at 1 example, not all ticks.
- Fig. 6 compares Guard Fine-tuning at 1, 5, and 25 examples per strategy, with ASR calibrated at different refusal rates; the main text has no readings. Thresholds are calibrated on the training set to match the refusal rate of the original system (Appendix E.2).
- MSJ has an ASR of 0 on GPT-4o, so the main experiment ignores that combination (§3.1).
- When naive MSJ directly embeds harmful content, the input classifier gives an ASR of 0; Appendix B changes to adding a safety evaluation instruction to each shot to bypass Llama-Guard-2-8B. The authors state this change does not affect the core conclusions.
- Appendix D has examples where proliferation fails to faithfully reproduce the original attack; the main text does not report the failure rate.
- The guard context limit is 8192 tokens; for longer inputs, the middle of the prompt is truncated, preserving the template's beginning and end (Appendix E.1).
What are some points that can be further explored?
The authors state that rapid response alone may not be enough for high-stakes single outputs, and that research is needed on detection, threat modeling, and attacks that are aware of the defense.
Limitations and future directions noted by the authors
- Single high-impact harm: if a single malicious output can cause significant harm, the authors state that rapid response alone may not be enough (Section 4).
- Applicability conditions: the authors state that effectiveness depends on the threat model, including whether failures are low-stakes, whether long continuous interaction is needed, and whether the model can first be jailbroken on lower-harm requests (Section 4).
- Detection and updates: the authors state that timely identification of jailbreaks and a process for quickly testing and deploying updates are also needed; the evaluated strategies can be handled, but future attack techniques may be harder to mitigate (Section 4).
- Attacks aware of the defense: the authors state that if attackers know the specific rapid response technique, they may design new strategies exploiting its characteristics, requiring further research (Section 5).
- Future work: the conclusion states that threat modeling, real-time jailbreak detection, and improving rapid response methods still need study. Section 5 states that combining with stronger automated red teaming and proliferation methods may better handle out-of-distribution variants.
Experimental coverage
- Generation models are GPT-4o, Llama-3-Instruct-8B, and Mistral-7B-Instruct-v0.2; the input guard is Llama-Guard-2-8B; main results are averaged over these three models (§3.1, Appendix A).
- The five defenses are Regex, Guard Fine-tuning, Embedding, Guard Few-shot, and Defense Prompt. Attacks are six black-box strategies from EasyJailbreak; three disjoint sets each of 100 AdvBench behaviors, and refusal rate data from WildChat (§2.2).
- Fig. 4 breaks down Fig. 2 by target model, Fig. 5 by attack strategy; the main text does not give numerical values for these two figures. MSJ has ASR 0 on GPT-4o, and that combination is excluded from main results (§3.1).
- Harmfulness judgment uses the Llama-3-Instruct-70B jailbreak classifier. The paper does not report its agreement with human judgment, the number of experimental repetitions, or statistical tests, nor the number of WildChat refusal rate evaluation items.
- The main proliferation model is Llama-3.1-70B-Instruct, 1000 per strategy. §3.3 compares proliferation models from 8B to 405B (unnamed) and 0 to 1000 proliferations under 1 example per strategy. PAIR and Crescendo use an attack LLM, whose name is not stated.
Summarize the main content of the paper
Rapid response uses a small number of jailbreak examples plus proliferation to update the input guard; the authors state that Guard Fine-tuning can reduce both in-distribution and out-of-distribution ASR.
Jailbreak Rapid Response shifts defense from pursuing static immunity before deployment to updating the system as soon as a small number of new jailbreaks are discovered.
- Problem: Attackers can use new or modified jailbreaks to elicit harmful outputs from input-guarded LLMs. The authors believe that no single static defense can block all attacks, so the goal is to block the same and similar attacks after a few successful examples, while controlling benign refusals.
- Approach: RapidResponseBench includes six black-box strategies. After the defense sees a few successful examples, Llama-3.1-70B-Instruct generates similar jailbreaks, and then the input side is updated. The guarded generation models are GPT-4o, Llama-3-Instruct-8B, and Mistral-7B-Instruct-v0.2, with Llama-Guard-2-8B as the guard. Harmfulness is determined by a Llama-3-Instruct-70B classifier.
- Main results: The authors report that when fine-tuning the input classifier with proliferation data, using only 1 example per category, across models, the in-distribution ASR relatively decreases by 99.6% and out-of-distribution by 93.6%. The abstract writes the same setting as greater than 240x and greater than 15x. §3.2 also states that this method and Regex both exceed 15x in-distribution. ASR continues to decrease with more observed examples; all methods increase the WildChat refusal rate, and the authors state that fine-tuning the classifier has the smallest increase.
- Proliferation: With only 1 example per category, the average ASR on the combined test set is 12% without proliferation and about 1.3% with maximum proliferation. From the weakest to the strongest proliferation model, this method's ASR drops by about 40%, with a non-monotonic trend.
- Authors' judgment: The authors believe rapid response has the potential to limit misuse, but it depends on timely detection and updates, whether the response method generalizes, and the stakes of a single failure. When a single output can cause significant harm, the authors state that this paradigm alone may not be enough. The benchmark is open-sourced, and the authors hope others will improve the baseline results.