Source-linked AI summary
Catastrophic Jailbreak of Open-source LLMs via Exploiting Generation
Yangsibo Huang, Samyak Gupta, Mengzhou Xia, Kai Li, Danqi Chen
TL;DR
Open-source LLM alignment evaluations often rely on fixed generation settings, leaving potential vulnerabilities under alternative decoding configurations. The paper introduces generation exploitation attacks and generation-aware alignment, finding misalignment rates above 95% across 11 open-source models while reducing this rate from 95% to 69% with the proposed alignment strategy.
Problem
Open-source LLMs remain vulnerable to jailbreaks, while safety evaluations commonly use fixed generation configurations that may miss deterioration under alternative strategies.
Method
The paper varies decoding hyper-parameters, sampling methods, and system prompts to perform generation exploitation attacks, then aligns models using outputs generated under diverse configurations.
Results
> 95% misalignment was achieved for 9 of 11 models, and combining strategies exceeded 95% for all 11 models; generation-aware alignment reduced misalignment from 95% to 69%.
Takeaways & Limitations
Safety evaluation and alignment for open-source LLMs should account for diverse generation strategies and use generation-aware alignment before release.
Takeaways & Limitations
Future work includes testing transferability to more models, improving harmfulness metrics, and increasing generation-aware alignment sample efficiency.
Abstract
from arXiv · showhide
The rapid progress in open-source large language models (LLMs) is significantly advancing AI development. Extensive efforts have been made before model release to align their behavior with human values, with the primary goal of ensuring their helpfulness and harmlessness. However, even carefully aligned models can be manipulated maliciously, leading to unintended behaviors, known as "jailbreaks". These jailbreaks are typically triggered by specific text inputs, often referred to as adversarial prompts. In this work, we propose the generation exploitation attack, an extremely simple approach that disrupts model alignment by only manipulating variations of decoding methods. By exploiting different generation strategies, including varying decoding hyper-parameters and sampling methods, we increase the misalignment rate from 0% to more than 95% across 11 language models including LLaMA2, Vicuna, Falcon, and MPT families, outperforming state-of-the-art attacks with $30\times$ lower computational cost. Finally, we propose an effective alignment method that explores diverse generation strategies, which can reasonably reduce the misalignment rate under our attack. Altogether, our study underscores a major failure in current safety evaluation and alignment procedures for open-source LLMs, strongly advocating for more comprehensive red teaming and better alignment before releasing such models. Our code is available at https://github.com/Princeton-SysML/Jailbreak_LLM.
1 INTRODUCTION
Open-source LLMs remain vulnerable to jailbreaks despite alignment techniques. This paper exploits generation configurations to expose that weakness, evaluates the attack broadly, proposes generation-aware alignment, and compares open-source with proprietary models.
- Open-source LLMs remain vulnerable to adversarial inputs despite alignment techniques, including automatically discovered adversarial prompts.
- The generation exploitation attack manipulates decoding configurations, including system prompts, hyper-parameters, and sampling methods, rather than optimizing adversarial prompts.The authors hypothesize that alignment procedures and evaluations often rely on default decoding settings.
- The evaluation covers 11 open-source LLMs from four families using AdvBench and the broader MaliciousInstruct benchmark.
- > 95% misalignment was reached for 9 of 11 models, with approximately 30× less compute than the state-of-the-art attack; combining strategies exceeded 95% for all 11 models.Human evaluation found that at least half of misaligned responses contained harmful instructions.
- Generation-aware alignment reduces the attack-induced misalignment rate from 95% to 69% by aligning models against outputs from varied generation configurations.
- On ChatGPT, the attack was much less effective at 7% than on open-source LLMs at 95%, indicating a disparity in observed vulnerability.
- The authors advocate comprehensive red-teaming across generation strategies and generation-aware alignment before model release.
2 BACKGROUND
Language models generate tokens from conditional next-token distributions, while decoding strategies determine token selection. The paper argues that fixed default generation settings can leave alignment evaluations vulnerable to deterioration under alternative configurations.
- 2.1 LANGUAGE MODELING: Language modeling predicts the next token from preceding context by computing a conditional probability distribution.
- 2.1 LANGUAGE MODELING: Temperature τ controls the sharpness of the next-token distribution, and generation recursively samples tokens until an end-of-sequence token appears.
- 2.2 GENERATION CONFIGURATIONS: System prompts steer generations toward human-aligned outputs and can be distilled through fine-tuning on safer responses generated with those prompts.
- 2.2 GENERATION CONFIGURATIONS: Sampling-based decoding randomly selects tokens, while greedy decoding selects the most probable token and is the τ = 0 special case.
- 2.3 FIXED GENERATION CONFIGURATION FOR SAFETY EVALUATION: Alignment evaluations commonly use fixed defaults such as top-p p = 0.9, τ = 0.1, and a prepended system prompt, potentially missing deterioration under other strategies.
- 2.3 FIXED GENERATION CONFIGURATION FOR SAFETY EVALUATION: This risk motivates generation exploitation attacks that vary generation strategies instead of relying only on the fixed evaluation configuration.
3 EVALUATION BENCHMARKS AND MEASURING MISALIGNMENT
The paper evaluates jailbreaks on two harmful-instruction benchmarks and measures both alignment failure and harmfulness. It uses a classifier-based misalignment metric alongside human evaluation to address limitations of substring matching.
- 3.1 EVALUATION BENCHMARKS: The evaluation uses AdvBench and the curated MaliciousInstruct benchmark, which broadens scenario diversity across ten malicious intentions.
- 3.1 EVALUATION BENCHMARKS: The 11 evaluated models include VICUNA, MPT, FALCON, and LLAMA2 families, with explicit safety alignment noted only for LLAMA2-7B-CHAT and LLAMA2-13B-CHAT.
- 3.2 EVALUATION METRICS: Attack performance is assessed by whether alignment breaks and whether the resulting output provides helpful instructions for the malicious prompt.
- 3.2 EVALUATION METRICS: Attack Success Rate (ASR) is the percentage of malicious instructions receiving misaligned outputs that fail to abstain.
- 3.2 EVALUATION METRICS: A trained classifier estimates output risk and labels attacks successful when the risk score exceeds 0.5, improving evaluation beyond rejection-phrase substring matching.
- 3.2 EVALUATION METRICS: Human evaluation reports Harmfulness Percentage (HP), counting outputs as harmful when they provide concrete and helpful suggestions for malicious instructions.
4 JAILBREAK VIA EXPLOITING GENERATION STRATEGIES
The evaluation tests whether removing system prompts and varying decoding configurations can break alignment across 11 open-source models. Diverse generation strategies substantially increase attack success, including on safety-aligned LLAMA2-CHAT models, while multiple sampling and decoding constraints strengthen the attack further.
- 4.2 Systematic evaluation: 9 of 11 models reach ASR ≥95% under exploited generation on MaliciousInstruct.The evaluation covers 11 open-source models and compares default with exploited generation.
- 4.2 Systematic evaluation: Removing the system prompt often increases ASR by >10%, and by over 50% for some models without safety tuning.ASR also increases for explicitly safety-aligned LLAMA2 chat models.
- 4.2 Systematic evaluation: All models except LLAMA2-CHAT exceed 90% ASR when diverse decoding strategies are applied after removing the system prompt.The authors characterize this contrast as a catastrophic alignment failure in the evaluated models.
- 4.2 Systematic evaluation: Different models and malicious instructions are vulnerable to different decoding configurations, so fixed-strategy evaluation can underestimate risk.For LLAMA-CHAT models, diverse configurations raise ASR from typically <30% with a fixed configuration to over 80%.
- 4.2 Systematic evaluation: 50% of 100 misaligned LLAMA2-13B-CHAT outputs were judged harmful by humans, while LLAMA2-7B-CHAT reached up to 80% harmful percentage.The automatic heuristic had 93% agreement with human annotations.
- 4.3 Boosting attack performance: 95% ASR is reached by sampling each decoding configuration 5 times for LLAMA2-7B-CHAT and 4 times for LLAMA2-13B-CHAT.Multiple sampling runs significantly improve ASR for the safety-aligned LLAMA2-CHAT models.
- 4.3 Boosting attack performance: Length penalties raise LLAMA2-7B-CHAT ASR from 83% to 92%, and additional bad-word and required-word constraints increase it to 100%.These constraints modify decoding to suppress refusal-related words and mandate selected terms.
- 4.4 Comparison with previous attacks: The attack consistently outperforms GCG across two models, two benchmarks, and two metrics while running 30× faster.On LLAMA2-7B-CHAT with one prompt and one A100, the attack takes about 3 minutes versus approximately 1.5 hours for GCG.
5 AN EFFECTIVE GENERATION-AWARE ALIGNMENT APPROACH
Generation-aware alignment proactively trains models on outputs produced under diverse decoding configurations, reducing vulnerability to generation exploitation. In experiments, it lowered attack success more than fixed-decoding alignment.
- 5.1 METHOD: Generation-aware alignment collects model responses from diverse decoding strategies and uses them during alignment.For each prompt, outputs are sampled under multiple configurations and grouped into aligned and misaligned responses.
- 5.1 METHOD: The procedure groups sampled responses into aligned and misaligned sets for alignment training.The objective distinguishes aligned answers from misaligned answers using separate response groups and markers.
- 5.2 EXPERIMENTS: The evaluation samples about 2,000 toxic prompts and compares varied-decoding alignment against fixed decoding at τ = 1.0.The prompt set is disjoint from classifier-training examples, and both approaches use 10,000 training tuples for comparison.
- 5.2 EXPERIMENTS: 95% to 69%: generation-aware alignment reduces LLAMA2-7B-CHAT’s attack success rate on MaliciousInstruct.Fixed-decoding alignment leaves a much higher final ASR of 88%.
- 5.2 EXPERIMENTS: Varied decoding sampling provides the greatest robustness advantage against the attacker’s temperature exploitation.The comparison covers three decoding strategies exploited by the attacker.
6 OPEN-SOURCE VS. PROPRIETARY LLMS
The paper tests whether generation exploitation transfers to proprietary models through API-exposed decoding controls. The attack is substantially less effective on gpt-3.5-turbo than on open-source models.
- 6.1 EXPERIMENTAL SETUP: The proprietary-model experiment uses OpenAI’s gpt-3.5-turbo chat-completion API and varies temperature, top-p, presence penalty, and frequency penalty.Attack success rate is reported on MaliciousInstruct under default and varied decoding configurations.
- 6.2 RESULTS: 7% versus more than 95%: attack success is substantially lower for proprietary models than for open-source models.The paper attributes the discrepancy partly to proprietary content filters and more extensive safety alignment processes.
- 6.2 RESULTS: The comparison highlights a disparity in vulnerability between open-source and proprietary LLMs under varied decoding configurations.Open-source models expose more avenues for exploitation, whereas proprietary models are typically accessed through APIs.
7 CONCLUSION AND FUTURE WORK
The paper concludes that generation exploitation exposes weaknesses in open-source LLM safety alignment while offering a simple alternative to adversarial-prompt optimization. It recommends broader evaluation across decoding strategies and identifies transferability, harmfulness metrics, and sample efficiency as future directions.
- 7 CONCLUSION: The generation exploitation attack jailbreaks open-source LLMs by manipulating generation strategies instead of optimizing adversarial prompts.The approach varies decoding configurations and sampling methods.
- 7 CONCLUSION: Up to 95% misalignment across 11 models is achieved with 30× less compute than the current state-of-the-art attack.The reported evaluation spans multiple open-source model families.
- 7 CONCLUSION: The study identifies current open-source LLM safety evaluation and alignment procedures as substantially deficient.The conclusion connects this deficiency to the observed jailbreak vulnerability.
- 7 FUTURE WORK: Future work will test transferability across more models, including multimodal models, and develop an improved automatic harmfulness metric.The authors also plan more advanced generation-aware alignment strategies focused on sample efficiency.
B EXPERIMENTAL DETAILS
The appendix documents evaluated models, system prompts, classifier and benchmark construction, attack scoring, decoding ranges, and alignment fine-tuning settings. These details specify how the attack and refined-alignment experiments were instantiated.
- B.1 IMPLEMENTATION: Tables 7 and 8 list the evaluated models and their system prompts.FALCON models lack a system prompt, so the study uses the LLAMA2 system prompt for them.
- B.2 CLASSIFIER: The classifier uses 5,000 HH-RLHF instructions with chosen and rejected responses, producing 10,000 labeled instruction-response pairs.Rejected responses receive label 1 and chosen responses label 0.
- B.2 CLASSIFIER: Human evaluation compares classifier judgments with five graduate-student annotators on aligned and misaligned outputs from MaliciousInstruct and LLAMA2.The study samples 100 aligned instruction-output pairs and adds classifier-identified misaligned outputs.
- B.3 DATASETS: MaliciousInstruct is curated from ChatGPT-generated prompts and responses spanning ten malicious-intent categories, followed by manual review.The curation aims to preserve category alignment and response diversity.
- B.4 ATTACK: The attack scorer selects the most misaligned output among responses generated under different strategies and assumes knowledge of the underlying misalignment distribution.Classifier and scorer training datasets are kept disjoint.
- B.5 PROPRIETARY MODEL: The proprietary-model attack varies temperature and top-p from 0.05 to 1, and both penalties from −2 to 2.Temperature and top-p use 0.05 steps; presence and frequency penalties use 0.1 steps.
- B.6 REFINED ALIGNMENT: Refined alignment samples temperature, top-p, and top-K strategies, then fine-tunes with learning rate 2 × 10^-5, batch size 16, and three epochs.Temperature and top-p range from 0 to 1 in 0.1 steps, while top-K uses nine specified values.
C.1 LLMS ARE SURPRISINGLY SUSCEPTIBLE TO DECODING VARIATIONS
A simple example illustrates how varied generation strategies can break alignment in LLAMA2-7B-CHAT, while accompanying tables compare attack success under decoding and system-prompt conditions.
- A simple example demonstrates breaking LLAMA2-7B-CHAT alignment by exploiting various generation strategies.
- A malicious financial-fraud prompt is declined by the model under greedy decoding with a system prompt.
- Table 9 reports LLAMA2 attack success rates under greedy and varied decoding, with and without the system prompt.
- Results for LLAMA2-CHAT under default decoding are similar to those under greedy decoding.
- Table 10 reports LLAMA2-CHAT attack success rates under greedy and default decoding, with and without the system prompt.
C.4 RISK HEATMAP FOR DIFFERENT MODELS
Risk heatmaps show per-instruction, per-decoding configuration risk across LLAMA2 variants. The non-chat LLAMA2-7B and LLAMA2-13B models exhibit higher risk than the aligned LLAMA2-13B-CHAT model.
- C.4 RISK HEATMAP FOR DIFFERENT MODELS: LLAMA2-7B and LLAMA2-13B exhibit higher risk than the aligned LLAMA2-13B-CHAT model.
- C.4 RISK HEATMAP FOR DIFFERENT MODELS: Figure 4 shows per-instruction, per-decoding configuration risk for LLAMA2-7B-CHAT on MaliciousInstruct.
- C.4 RISK HEATMAP FOR DIFFERENT MODELS: Figure 5 shows per-instruction, per-decoding configuration risk for LLAMA2-13B-CHAT.
- C.4 RISK HEATMAP FOR DIFFERENT MODELS: Figure 6 shows per-instruction, per-decoding configuration risk for LLAMA2-7B.
- C.4 RISK HEATMAP FOR DIFFERENT MODELS: Figure 7 shows per-instruction, per-decoding configuration risk for LLAMA2-13B.