CLAIAug 14, 2023

LLM Self Defense: By Self Examination, LLMs Know They Are Being Tricked

Georgia Tech
arXiv:2308.07308v4314 citationsh-index: 48Has Code
Originality Incremental advance
AI Analysis

This addresses a critical safety issue for users of LLMs by providing a simple defense against adversarial attacks, though it is incremental as it builds on existing prompting techniques.

The paper tackles the problem of adversarial prompts bypassing safety measures in large language models (LLMs) by proposing LLM Self Defense, a method that screens generated responses for harmfulness without fine-tuning, reducing attack success rates to virtually 0% on GPT 3.5 and Llama 2.

Large language models (LLMs) are popular for high-quality text generation but can produce harmful content, even when aligned with human values through reinforcement learning. Adversarial prompts can bypass their safety measures. We propose LLM Self Defense, a simple approach to defend against these attacks by having an LLM screen the induced responses. Our method does not require any fine-tuning, input preprocessing, or iterative output generation. Instead, we incorporate the generated content into a pre-defined prompt and employ another instance of an LLM to analyze the text and predict whether it is harmful. We test LLM Self Defense on GPT 3.5 and Llama 2, two of the current most prominent LLMs against various types of attacks, such as forcefully inducing affirmative responses to prompts and prompt engineering attacks. Notably, LLM Self Defense succeeds in reducing the attack success rate to virtually 0 using both GPT 3.5 and Llama 2. The code is publicly available at https://github.com/poloclub/llm-self-defense

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes