In-Context LLM Jailbreak
Large Language Models (LLMs) are vulnerable to In-Context Attacks (ICA) and susceptible to mitigation via In-Context Defense (ICD). ICA leverages a small number of harmful demonstration examples within a prompt to elicit harmful responses from the LLM, even if it is otherwise safety-aligned. ICD counteracts ICA by prepending safe demonstration examples to the prompt, effectively reducing the likelihood of harmful output. The effectiveness of both ICA and ICD is demonstrated across multiple LLMs.
Evaluated models: GPT-4 0613, Llama 2 7B Chat, Mistral-7B-v2+4 more
- GPT-4 0613
- Llama 2 7B Chat
- Mistral-7B-v2
- Mixtral 8x7B
- Qwen-7B-v2
- Vicuna 13B v1.5
- Vicuna 7B v1.5