Abstract
Adversarial Preference Learning (APL) is an iterative framework designed to automate the "cat-and-mouse" game of Large Language Model (LLM) red-teaming. By co-evolving a generative attacker and a defender model through Direct Preference Optimization (DPO), APL significantly hardens models against jailbreaks and adversarial prompts. This approach eliminates the need for expensive human annotation or biased external reward models, providing a scalable path toward robust safety alignment.
Introduction
Even highly aligned Large Language Models (LLMs) remain surprisingly fragile. Despite Reinforcement Learning from Human Feedback (RLHF), they are often vulnerable to "jailbreaks"—carefully crafted prompts, such as the "DAN" persona, designed to bypass safety filters. Current methods to address these vulnerabilities face three major hurdles: the high cost of human red-teaming, the limited scope of static adversarial datasets, and the risk of "reward hacking" when using external reward models that may introduce their own biases.
To overcome these challenges, we introduce Adversarial Preference Learning (APL), a framework that transforms safety alignment into a self-improving, automated loop between an attacking agent and a defending model.
Methodology
The APL framework consists of two main agents: an Attacker and a Defender, which interact in a continuous improvement cycle.
Key innovations in this framework include:
- Intrinsic Harmfulness Metric: Rather than relying on an external "judge" model, APL evaluates attack effectiveness by analyzing the Defender's own internal probability of generating a harmful versus a safe response. This removes dependency on potentially biased external classifiers.
- Generative Attacker: The Attacker is an LLM trained to synthesize diverse, input-specific adversarial variations. It learns to employ sophisticated tactics such as irony, presupposition, and complex framing to bypass the Defender's safeguards.
- Iterative Co-evolution: In each iteration, the Attacker identifies new vulnerabilities, and the Defender is updated via DPO to "patch" those specific holes, creating a robust defense-in-depth.
Experimental Setup
The models were trained and evaluated using several standard benchmarks to ensure a comprehensive assessment of safety and utility:
- HH-RLHF (Harmlessness subset): Primary training data for the preference learning loop.
- HarmBench: Used to evaluate robustness against four distinct attack types: Direct Request (DR), Zero-Shot (ZS), Few-Shot (FS), and Greedy Coordinate Gradient (GCG).
- MT-Bench & AlpacaEval: Used to ensure the model's general utility and helpfulness remained intact during safety hardening.
- XS-Test: Used to monitor for "over-refusal," where a model might become excessively restrictive.
Results and Discussion
Evaluations on Mistral-7B-Instruct-v0.3 demonstrated the effectiveness of the APL approach. The model achieved an 83.33% harmlessness win rate over the base model (as judged by GPT-4o), and harmful outputs dropped from 5.88% to a mere 0.43% as measured by LLaMA-Guard.
As shown in the performance metrics, the Attack Success Rate (ASR) on HarmBench plummeted by up to 65% compared to standard DPO training. Crucially, this safety boost did not come at the cost of general intelligence; the model maintained an MT-Bench score of 6.59, very close to the baseline of 6.78.
Key Insights
- The Power of Intrinsic Rewards: Using the model's own preference as a signal creates a tight, accurate feedback loop. If a model is more likely to give a harmful answer to prompt A than prompt B, prompt A is objectively a more effective attack for that specific model state.
- Sophistication over Brute Force: The generative attacker recontextualizes prompts (e.g., turning a request for harmful instructions into a creative writing prompt), testing the model's ability to distinguish between benign creative contexts and actual harmful intent.
- Hyperparameter Sensitivity: The "arms race" requires careful balance. Lower "beta" values for the defender—controlling how much the model deviates from its base state—were found to be crucial for achieving the optimal safety-utility trade-off.
Limitations and Future Work
While APL represents a significant advancement, several challenges remain. The attacker faces a "cold start" problem, where initial lack of training can slow the discovery of diverse attacks. Additionally, like many safety-focused methods, APL can lead to a slight increase in "false refusals" for benign prompts that resemble adversarial structures. Future research will explore hybrid attack strategies, combining gradient-based optimization with generative prompting, to create even more rigorous stress tests for LLM alignment.
Summary updated