Dynamic Guardian Models: Realtime Content Moderation With User-Defined Policies

Monte Hoover, Vatsal Baherwani, Neel Jain, Khalid Saifullah, Joseph James Vincent, Chirag Jain, Melissa Kazemi Rad, C. Bayan Bruss, Ashwinee Panda, Tom GoldsteinTTODLer-FM @ ICML 2025

TL;DR

This paper introduces "dynamic guardian models" that can enforce custom, user-defined policies for LLM content moderation, moving beyond static, pre-defined harm categories. Their approach, exemplified by the DynaGuard model, achieves state-of-the-art performance on flexible policy compliance tasks with significantly lower latency and cost than existing methods.

What Problem Does This Paper Address?

Large Language Models (LLMs) often exhibit safety and reliability issues, particularly in critical user-facing applications. Existing "guardian models" typically rely on static, pre-defined categories of harm (e.g., violence, self-harm). However, real-world scenarios often require nuanced, context-specific rules that go beyond these static categories. For instance, a chatbot might need to avoid offering refunds in one context but be permitted to do so in another, a distinction not captured by generic harm categories. This inflexibility can lead to significant financial or reputational damage, as illustrated by a case where Air Canada was held liable for chatbot-issued refunds. The paper addresses the need for LLM guardian models that are adaptable to arbitrary, user-defined policies at runtime, ensuring alignment with specific stakeholder expectations and regulatory standards across diverse applications.

Methods

The core contribution is the development of dynamic guardian models that can interpret and enforce arbitrary policies defined by users. This is achieved through a novel approach that includes:

  • User-Defined Policies: Instead of static categories, the models accept policies written by users, which can comprise multiple rules.
  • Chain-of-Thought (CoT) Reasoning: The models utilize CoT reasoning to better understand rule violations and generate natural language explanations for failures. This allows LLM agents to recover from policy violations.
  • Participatory Pipeline: The authors introduce a pipeline for creating synthetic datasets that include user-agent dialogues designed to test compliance with various policies. This pipeline involves LLM-generated conversations and human-crafted rules.
  • DynaGuard Model: This is their proposed dynamic guardian model, built upon the Qwen3 instruct model. It is fine-tuned on their custom dataset and is capable of both fast inference (pass/fail) and providing detailed reasoning.
  • Thresholding for Fast Inference: For scenarios where explanations are not needed, the model can operate in a fast-inference mode. By calibrating thresholds on the model's output probabilities, they demonstrate significant improvements in F1 scores.

Datasets

The paper introduces a new benchmark called Compliance, comprising 60,000 labeled multi-turn user-agent dialogues. This dataset is designed to test compliance with a wide range of policies, extending beyond traditional safety domains. The rules are hand-crafted and then expanded through LLM sessions, resulting in approximately 5,000 unique rules.

In addition to Compliance, they also adapt four existing safety datasets into a policy compliance format:

  • BeaverTails
  • WildGuard
  • ToxicChat
  • Aegis2.0

These datasets were adapted by inferring policies from their existing labels and annotations.

Key Insights and Ideas

  • The limitations of static harm categories: The paper strongly emphasizes that static categories are insufficient for real-world LLM safety and compliance, highlighting the need for dynamic, context-aware solutions.
  • The power of user-defined policies: Allowing users to define their own rules is crucial for tailoring LLM behavior to specific business needs and regulatory environments.
  • Interpretability as a recovery mechanism: Providing natural language explanations for policy violations is not just for human understanding but can be directly used by other LLM agents to self-correct and improve their responses.
  • Balancing speed and interpretability: The DynaGuard model successfully demonstrates the ability to operate in both a detailed reasoning mode and a fast-inference mode, offering flexibility for different application requirements.
  • The difficulty of custom policy compliance: The paper shows that even advanced models struggle with arbitrary policy compliance, with their custom dataset proving challenging for existing benchmarks.

Key Results

  • State-of-the-art performance on Compliance: The DynaGuard-4B SFT model achieved an F1 score of 0.869 ± 0.022 on the Compliance benchmark, significantly outperforming baselines like GPT-40 (0.600 ± 0.035).
  • Strong performance on WildGuard: DynaGuard-4B also achieved a competitive F1 score of 0.769 ± 0.013 on the WildGuard benchmark.
  • Improved Fast Inference: Thresholding the output probabilities in fast-inference mode increased the F1 score for DynaGuard-1.7B by 0.08 and for DynaGuard-4B by 0.13 on the Compliance dataset.
  • Reduced Latency and Cost: The DynaGuard models offer an order of magnitude lower cost and latency compared to models like GPT-40 when performing policy compliance tasks.
  • Outperforming Frontier Models: The 4B DynaGuard model outperformed GPT-40 on the Compliance evaluation set (86.9% vs 60%) with significantly lower cost and latency.

Limitations and Future Work

  • Accuracy Limits: The authors acknowledge that DynaGuard models do not achieve perfect accuracy, and practitioners must account for these limitations.
  • Integration of Explanations: Further research is needed to understand how these interpretable explanations can be best integrated into multi-agent recovery strategies and how they affect human trust and usability.
  • Adaptability to New Use Cases: The model will likely need to be updated as new use cases for LLMs emerge.
  • Broader Adoption of Agentic Paradigms: The authors hope their work will lead to wider adoption of agentic paradigms for model safety.

Summary updated

BibTeX
@inproceedings{hoover2025dynamic,
  author = {Monte Hoover and Vatsal Baherwani and Neel Jain and Khalid Saifullah and Joseph James Vincent and Chirag Jain and Melissa Kazemi Rad and C. Bayan Bruss and Ashwinee Panda and Tom Goldstein},
  title = {{Dynamic Guardian Models: Realtime Content Moderation With User-Defined Policies}},
  booktitle = {TTODLer-FM @ ICML},
  year = {2025},
  url = {https://openreview.net/forum?id=TJxuQ2HST7},
}
Figure