Agentic AI
New Method Uses GFlowNets to Generate Diverse Attacks for Safer AI Models
Researchers propose a probabilistically grounded approach to red-teaming that overcomes mode collapse and produces varied adversarial prompts to strengthen LLM safety.
A key challenge in deploying large language models safely is finding the many different ways attackers might trick them into generating harmful content. Researchers have now proposed a novel training approach that addresses limitations in existing automated red-teaming methods.
The Problem with Current Approaches#
Traditional automated red-teaming relies on reinforcement learning to train an attacker model to craft prompts that produce undesirable responses from target systems. However, even when these methods include explicit constraints to encourage diversity, they tend to suffer from mode collapse—repeatedly generating the same types of attacks rather than exploring a rich variety of harmful prompts.
A New Solution: GFlowNet Fine-Tuning#
Instead of standard reinforcement learning, the research team proposes using GFlowNet fine-tuning followed by a secondary smoothing phase. This probabilistically principled approach trains an attacker model to generate both effective and diverse attack prompts. The method treats the problem as a flow network, which naturally encourages exploration across many different attack strategies rather than converging on a narrow set.
Effectiveness and Transferability#
The attacks generated by this approach prove effective against a broad spectrum of language models, whether or not they have undergone safety training. Notably, the adversarial prompts transfer well across different target models, suggesting they capture fundamental vulnerabilities rather than quirks of individual systems.
When models are safety-tuned using datasets of red-teaming prompts created by this method, they show increased robustness to attacks from other RL-based red-teaming approaches—indicating that exposure to diverse attack patterns strengthens defenses more effectively than traditional single-strategy red-teaming.
Why It Matters#
This work suggests that generating diverse attacks is essential for building truly robust AI systems. By moving beyond mode collapse, researchers can better prepare language models to resist a wider range of adversarial inputs before deployment.

