TL;DR
IBM Research has released Granite Guardian, a suite of open-source 2B and 8B safeguard models designed to detect risks in both user prompts and LLM responses. It is the first unified family to move beyond traditional safety (like bias and violence) to also address RAG-specific hallucination risks, such as groundedness and context relevance, achieving state-of-the-art performance on major benchmarks.
What Problem Does This Paper Address?
As Large Language Models (LLMs) move into production, "safety" has become a multi-dimensional headache. Developers currently have to stitch together multiple tools: one for toxicity, another for jailbreak detection, and yet another to ensure Retrieval-Augmented Generation (RAG) systems aren't hallucinating.
Existing guardrails often suffer from two main issues:
- Narrow Scope: They focus on "harmful" content but ignore the subtle ways a RAG system can fail (e.g., providing a factually correct answer that has nothing to do with the retrieved context).
- Over-refusal: Many models are too sensitive, flagging benign prompts that look like they might be harmful (e.g., "How do I smash a ball in tennis?").
Granite Guardian aims to provide a single, robust, and open-source "plug-and-play" solution that handles this entire spectrum of risk.
Methods
The authors built Granite Guardian by fine-tuning the Granite 3.0 Instruct models (2B and 8B). The core of their approach involves:
- Supervised Fine-Tuning (SFT): They used a specialized "safety instruction template" that defines the specific risk category and the content to be evaluated. This allows the model to be flexible; it can act as a general harm detector or a specialized RAG evaluator depending on the prompt.
- Improved Risk Scoring: Instead of a simple binary "Yes/No" output, the authors propose a method to compute a "probability of risk" by aggregating the log-likelihoods of all tokens containing "Yes" or "No." This allows developers to set custom thresholds based on their specific tolerance for false positives.
- Synthetic Data Generation: To combat over-refusal, they generated "contrastive benign" samples—prompts that use aggressive language (like "smash" or "kill") in harmless contexts. They also used automated red-teaming to create sophisticated "adversarially harmful" prompts to train the model against complex jailbreaks.
Datasets
The models were trained on a massive, diverse collection of data:
- Human Annotations: High-quality labels were sourced via DataForce, focusing on the HH-RLHF dataset. The authors used an "uncertainty-informed" approach, prioritizing human labeling for samples where the model was most unsure.
- Synthetic Safety Data: Thousands of samples covering 24 different adversarial revision strategies (like "payload splitting").
- RAG Hallucination Data: Synthetic samples derived from HotPotQA and SquadV2 to teach the model to recognize when a response is ungrounded or irrelevant to the context.
The models were evaluated against a battery of public benchmarks, including ToxicChat, OpenAI Moderation, BeaverTails, and the TRUE benchmark for groundedness.
Key Insights and Ideas
- Unified Taxonomy: The paper demonstrates that safety and factual consistency (groundedness) can be effectively handled by the same model architecture.
- The "Instruct" Advantage: The authors found that fine-tuning the instruct version of Granite 3.0 yielded better results than the base version. They hypothesize that instruct models have already "learned" to distinguish between desirable and undesirable outcomes during their initial training.
- Risk Coverage: Granite Guardian provides explicit detection for a wide array of risks across both prompts and responses.
- High Inter-Annotator Agreement: The quality of the training data is bolstered by strong agreement among human labelers, particularly in categories like Bias and Unethical Behavior.
Key Results
- Harm Detection: The 8B model achieved an AUC of 0.871 on aggregated harm benchmarks, outperforming Llama Guard 3-8B (0.826) and ShieldGemma-9B (0.753).
- Jailbreak Resilience: On the ToxicChat jailbreak subset, the model achieved a recall of 1.0, meaning it caught every single jailbreak attempt in that specific test set.
- RAG Performance: On the TRUE benchmark for groundedness, the 8B model reached an average AUC of 0.854, making it the best-performing fully open-source model in the space.
- Efficiency: The 2B variant remains highly competitive, offering a low-latency option for real-time applications while still outperforming many larger baselines.
Limitations and Future Work
- Contextual Nuance: The authors acknowledge that "harm" is often subjective and context-dependent. Current models struggle with content that might be harmful in one social scenario but benign in another.
- Language Support: The current release is optimized for English; expanding to multilingual support is a clear next step.
- Standardization: The field still lacks standardized definitions for many risk categories, making evaluation across different model families difficult. The authors hope Granite Guardian's open-source release will help drive community consensus on these definitions.
Summary updated