atlas

Research map / Large language models / Language, safety and interpretability

Improved Few-Shot Jailbreaking Can Circumvent Aligned Language Models and Their Defenses

NeurIPS 2024 · Large language models › Language, safety and interpretability · approach: Jailbreak elicitation and risk · 6 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Improves few-shot jailbreaking (FSJ) for limited-context open-source LLMs by injecting target-specific special tokens into demos and applying demo-level random search over a Mistral-generated demo pool, reaching high ASRs on aligned models and defended Llama-2.

Problem

Many-shot jailbreaking needs long context, and vanilla few-shot jailbreaking is ineffective against well-aligned open-source LLMs such as Llama-2-Chat within limited context windows (≤8192), especially under defenses.

Approach

Inject the target model's conversation-template special tokens (e.g., [/INST]) into harmful demonstrations and optimize the choice of demonstrations via a demo-level random search that minimizes the loss of an affirmative first token, using a pool of harmful responses from a weakly aligned model.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Add demo-level random search (ablation)I-FSJ with [/INST] on Llama-2-7B-Chat · AdvBench, 8-shotrule-based ASR: 38% -> 100%Helped
Add demo-level random search (ablation)I-FSJ with [/INST] on Llama-2-7B-Chat · AdvBench, 8-shotLLM-based ASR: 38% -> 96%Helped
Add the correct [/INST] special token (ablation)I-FSJ with demo RS on Llama-2-7B-Chat · AdvBench, 8-shotrule-based ASR: 0% -> 100%Helped
Increase demonstrations from 2-shot to 4-shot (ablation)I-FSJ with special tokens and demo RS on Llama-2-7B-Chat · AdvBenchrule-based ASR: 68% -> 100%Helped
Use [INST] instead of the correct [/INST] token (ablation)I-FSJ with demo RS on Llama-2-7B-Chat · AdvBench, 8-shotrule-based ASR: 100% -> 6%Hurt
Use Qwen1.5 special tokens instead of [/INST] (ablation)I-FSJ with demo RS on Llama-2-7B-Chat · AdvBench, 8-shotrule-based ASR: 100% -> 0%Hurt
Filter similar demonstrations with similarity at least 0.5 (ablation)I-FSJ with demo RS on Llama-2-7B-Chat · AdvBench, 8-shotrule-based ASR: 100% -> 100%No clear effect
Increase decoding length from 100 to 512 tokens (ablation)I-FSJ with demo RS on Llama-2-7B-Chat · AdvBench, 8-shotrule-based ASR: 100% -> 100%No clear effect
Add demo-level random search (ablation)I-FSJ with </text> on GPT-4 · AdvBench, 1-shotrule-based ASR: 70% -> 90%Helped
Use </text> instead of the default newline token (ablation)I-FSJ with demo RS on GPT-4 · AdvBench, 1-shotrule-based ASR: 74% -> 90%Helped
Add demo-level random search (ablation)I-FSJ on Llama-2-7B-Chat · AdvBench, 8-shotrule-based ASR: 0.0±0.0 -> 95.3±1.2Helped
Increase shots from 2 to 4 (ablation)I-FSJ with demo RS on Llama-3-8B-Instruct · AdvBenchrule-based ASR: 24.0±5.3 -> 71.3±6.1Helped

Surprising findings

Limitations

Experimental setup

Datasets: AdvBench HarmBench

Benchmarks: AdvBench HarmBench

Metrics: attack success rate (rule-based) attack success rate (LLM-based, Llama Guard)

Baselines: GCG PAIR AutoDAN PAP PRS ICA vanilla FSJ

Builds on: many-shot jailbreaking random search jailbreak SmoothLLM SafeDecoding

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy