Learning diverse attacks on large language models for robust red-teaming and safety tuning
cs.CL, cs.CR, cs.LG
Submitted: 2024-05-28
Updated: 2026-08-31
Comments: ICLR 2025; code: https://github.com/GFNOrg/red-teaming
Code: https://github.com/GFNOrg/red-teaming
License: http://creativecommons.org/licenses/by/4.0/
The gist: Red-teaming, or identifying prompts that elicit harmful responses, is a critical step in ensuring the safe and responsible deployment of large language models (LLMs).
Terminology
Abstract
Red-teaming, or identifying prompts that elicit harmful responses, is a critical step in ensuring the safe and responsible deployment of large language models (LLMs). Developing effective protection against many modes of attack prompts requires discovering diverse attacks. Automated red-teaming typically uses reinforcement learning to fine-tune an attacker language model to generate prompts that elicit undesirable responses from a target LLM, as measured, for example, by an auxiliary toxicity classifier. We show that even with explicit regularization to favor novelty and diversity, existing approaches suffer from mode collapse or fail to generate effective attacks. As a flexible and probabilistically principled alternative, we propose to use GFlowNet fine-tuning, followed by a secondary smoothing phase, to train the attacker model to generate diverse and effective attack prompts. We find that the attacks generated by our method are effective against a wide range of target LLMs, both with and without safety tuning, and transfer well between target LLMs. Finally, we demonstrate that models safety-tuned using a dataset of red-teaming prompts generated by our method are robust to attacks from other RL-based red-teaming approaches.
Sources
- Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedback
- Constitutional AI: Harmlessness from AI Feedback
- Jailbreaking Black Box Large Language Models in Twenty Queries
- Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challenge
- Training Verifiers to Solve Math Word Problems
- The Llama 3 Herd of Models
- Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversations
- Baseline Defenses for Adversarial Attacks Against Aligned Language Models
- Mistral 7B
- QGFN: Controllable Greediness with Action Values
- The Unlocking Spell on Base LLMs: Rethinking Alignment via In-Context Learning
- HarmBench: A Standardized Evaluation Framework for Automated Red Teaming and Robust Refusal
- Investigating Adversarial Trigger Transfer in Large Language Models
- Gemma: Open Models Based on Gemini Research and Technology
- Rainbow Teaming: Open-Ended Generation of Diverse Adversarial Prompts
- Equivalence Between Policy Gradients and Soft Q-Learning
- Proximal Policy Optimization Algorithms
- Llama 2: Open Foundation and Fine-Tuned Chat Models
- Ethical and social risks of harm from Language Models
- Accelerating Greedy Coordinate Gradient and General Prompt Optimization via Probe Sampling
Related papers
- Exploring Solution Divergence and Its Effect on Large Language Model Problem Solving
- Ishigaki-IDS-Bench: A Benchmark for Generating Information Delivery Specification from BIM Information Requirements
- Subliminal Steering: Stronger Encoding of Hidden Signals
- MedStruct-S: A Benchmark for Key Discovery, Key-Conditioned QA and Semi-Structured Extraction from OCR Clinical Reports
- The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures
- Untangling the Mechanisms of Misleading Context in Medical Question Answering