SEAS: Self-Evolving Adversarial Safety Optimization for Large Language Models

Muxi Diao, Rumei Li, Shiyang Liu, Guogang Liao, Jingang Wang, Xunliang Cai, Weiran Xu

Introduction

As Large Language Models (LLMs) advance, ensuring their safety becomes a complex, moving target. Traditional safety alignment often relies on static datasets or manual "red teaming," where humans attempt to elicit harmful responses. However, these methods are frequently slow, lack diversity, and fail to adapt as models evolve. Furthermore, aggressive safety tuning can lead to "over-refusal," where models reject benign prompts that superficially resemble harmful ones.

To address these challenges, researchers from Beijing University of Posts and Telecommunications and Meituan introduced SEAS (Self-Evolving Adversarial Safety). This framework automates the red teaming process through a dynamic "arms race" between two LLMs: a Red Team model designed to find vulnerabilities and a Target model trained to defend against them.

The SEAS Framework

The SEAS framework employs a three-stage iterative pipeline designed to continuously harden the Target model while simultaneously refining the Red Team's attack capabilities.

Overview of the SEAS self-evolving framework, illustrating the iterative cycle between the Red Team (attacker) and the Target (defender).
  1. Initialization Stage: The process begins with base models (e.g., Llama-3-8B). The Red Team ($R_0$) is fine-tuned on safety-related data to learn various attack styles, while the Target ($T_0$) is fine-tuned on general instructions to maintain utility.
  2. Attack Stage: The Red Team generates adversarial prompts targeting the current version of the Target model. A Safe Classifier (such as Meta Llama Guard 2) evaluates the Target's responses, identifying successful breaches and successful defenses.
  3. Adversarial Optimization Stage: Using Direct Preference Optimization (DPO), both models are updated. The Red Team is optimized to prefer prompts that successfully bypass the Target's filters, while the Target is optimized to prefer safe refusals over unsafe compliance for the same adversarial inputs.

By repeating this cycle, the models "self-evolve." The Red Team discovers increasingly subtle vulnerabilities, and the Target model develops robust defenses against these novel strategies.

Dataset and Training Strategy

Central to the framework is the SEAS Dataset, comprising 18,000 entries across 14 categories. This includes five risk categories (e.g., Health Harm, Privacy) and nine distinct attack styles (e.g., Role Play, Adversarial Prefixes).

A critical component of this dataset is the Ambiguous Harmless Dataset. This subset contains benign prompts that mimic the linguistic style of attacks (e.g., "How to kill a process"). By training on these examples, the SEAS framework teaches the model to distinguish between harmful intent and aggressive syntax, significantly reducing the common problem of over-refusal.

Key Results

The iterative optimization process yields significant improvements in both safety and robustness.

Safety performance across iterations, showing the shift in refusal and compliance rates for safe and unsafe prompts.
  • Iterative Safety Gains: As shown in the performance metrics, each iteration ($T_1, T_2, T_3$) demonstrates a marked decrease in the Attack Success Rate (ASR). By the third iteration, the Target model (SEAS-$T_3$) achieves safety levels comparable to state-of-the-art models like GPT-4 on standard benchmarks.
  • Sophisticated Red Teaming: The evolved Red Team (SEAS-$R_3$) became significantly more effective, showing a 50.66% increase in ASR against external models like Llama3-70B-Instruct, proving that it learned generalizable attack strategies rather than just over-fitting to the Target.
  • Balanced Utility: Unlike many safety-tuned models that lose general intelligence, the SEAS Target models maintained or slightly improved their performance on general benchmarks like Arena Hard and MT-Bench. This suggests that adversarial safety training, when balanced with general instruction data, does not necessarily degrade model utility.

Conclusion and Future Directions

SEAS demonstrates that a self-evolving, automated red teaming approach can effectively address the limitations of static safety training. By leveraging DPO in a competitive loop, the framework creates models that are both safer and more resilient to complex attacks without succumbing to excessive over-refusal.

Future work may focus on reducing dependency on external classifiers and incorporating human-in-the-loop feedback to address highly nuanced or high-stakes risks that automated systems might overlook.

Summary updated

BibTeX
@inproceedings{diao2025seas,
  author = {Muxi Diao and Rumei Li and Shiyang Liu and Guogang Liao and Jingang Wang and Xunliang Cai and Weiran Xu},
  title = {{SEAS: Self-Evolving Adversarial Safety Optimization for Large Language Models}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i22.34549},
}
Figure