[Paper Review] ExpGuard: LLM Content Moderation in Specialized Domains
ExpGuard introduces a domain-aware guardrail and ExpGuardMix dataset for finance, healthcare, and law; it achieves state-of-the-art domain safety and is open-sourced.
With the growing deployment of large language models (LLMs) in real-world applications, establishing robust safety guardrails to moderate their inputs and outputs has become essential to ensure adherence to safety policies. Current guardrail models predominantly address general human-LLM interactions, rendering LLMs vulnerable to harmful and adversarial content within domain-specific contexts, particularly those rich in technical jargon and specialized concepts. To address this limitation, we introduce ExpGuard, a robust and specialized guardrail model designed to protect against harmful prompts and responses across financial, medical, and legal domains. In addition, we present ExpGuardMix, a meticulously curated dataset comprising 58,928 labeled prompts paired with corresponding refusal and compliant responses, from these specific sectors. This dataset is divided into two subsets: ExpGuardTrain, for model training, and ExpGuardTest, a high-quality test set annotated by domain experts to evaluate model robustness against technical and domain-specific content. Comprehensive evaluations conducted on ExpGuardTest and eight established public benchmarks reveal that ExpGuard delivers competitive performance across the board while demonstrating exceptional resilience to domain-specific adversarial attacks, surpassing state-of-the-art models such as WildGuard by up to 8.9% in prompt classification and 15.3% in response classification. To encourage further research and development, we open-source our code, data, and model, enabling adaptation to additional domains and supporting the creation of increasingly robust guardrail models.
Motivation & Objective
- Address safety gaps in generic guardrails for domain-specific jargon and concepts in high-stakes fields (finance, healthcare, law).
- Create a large, domain-focused safety dataset (ExpGuardMix) and an expert-annotated benchmark (ExpGuardTest) to evaluate guardrails.
- Train a specialized guardrail model (ExpGuard) that performs well on domain content and resists domain-specific adversarial attacks.
- Demonstrate ExpGuard’s competitive performance on general safety benchmarks while excelling in domain-specific scenarios.
Proposed method
- Construct ExpGuardMix with 58,928 labeled prompts (Prompts-Response pairs) spanning domain-specific harms in finance, healthcare, and law.
- Mine domain terminology from Wikipedia, filter via Wikidata and GPT-4o, and validate with three annotators (majority vote).
- Generate harmful and benign domain-specific prompts using GPT-4o with context from Wikipedia abstracts; create corresponding refusals with domain-aware safety checks.
- Label data with a 3-model ensemble (Claude 3.7 Sonnet, Gemini 2.0 Flash, Qwen2.5-Max) using step-by-step CoT rationales and require consensus on exact harm category.
- Deduplicate data using Sentence Transformers to ensure diversity; discard samples with label disagreements (≈4.8% removed).
- Train ExpGuard in a multi-task setting to predict safe/unsafe for prompts and prompt-response pairs.

Experimental results
Research questions
- RQ1Can a domain-focused guardrail trained on finance, healthcare, and law outperform general guardrails on domain-specific content and adversarial prompts?
- RQ2Does ExpGuard maintain strong performance on general safety benchmarks while delivering superior domain robustness?
- RQ3How does domain-specific data (vs. in-the-wild or human-written data) contribute to domain-specific and general safety performance?
- RQ4Is ExpGuard robust to domain-specific jailbreak and adversarial attacks, and can domain-adversarial augmentation (ExpGuard+) further improve resilience?
Key findings
- ExpGuard achieves 93.3% F1 on prompt classification and 92.7% F1 on response classification on ExpGuardTest, outperforming WildGuard by up to 8.9% and 15.3% respectively.
- In ExpGuardTest, ExpGuard attains 94.1% (Financial), 91.2% (Medical), and 94.6% (Legal) prompt F1; 96.7% (Financial), 86.2% (Medical), and 92.4% (Legal) response F1.
- ExpGuard matches or exceeds state-of-the-art on eight public safety benchmarks, with an average prompt F1 of 85.7% (5.3 percentage points above prior SOTA) and robust generalization.
- Ablation shows domain-specific data is critical (8.0-point drop in prompt F1 when removed), while in-the-wild and human-written data contribute to generalization.
- ExpGuard+ (domain-specific adversarially augmented version) significantly improves resilience against domain-specific jailbreak prompts across baselines.
- ExpGuard is open-sourced with code, data, and models to enable adaptation to additional domains.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.