ShieldGemma: Generative AI Content Moderation Based on Gemma
About
We present ShieldGemma, a comprehensive suite of LLM-based safety content moderation models built upon Gemma2. These models provide robust, state-of-the-art predictions of safety risks across key harm types (sexually explicit, dangerous content, harassment, hate speech) in both user input and LLM-generated output. By evaluating on both public and internal benchmarks, we demonstrate superior performance compared to existing models, such as Llama Guard (+10.8\% AU-PRC on public benchmarks) and WildCard (+4.3\%). Additionally, we present a novel LLM-based data curation pipeline, adaptable to a variety of safety-related tasks and beyond. We have shown strong generalization performance for model trained mainly on synthetic data. By releasing ShieldGemma, we provide a valuable resource to the research community, advancing LLM safety and enabling the creation of more effective content moderation solutions for developers.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Response Harmfulness Detection | HarmBench | F1 Score67.96 | 100 | |
| Response Harmfulness Detection | XSTEST-RESP | Response Harmfulness F173.86 | 76 | |
| Response Harmfulness Detection | Beavertails | F1 Score63.61 | 59 | |
| Safety Classification | SafeRLHF | F1 Score0.511 | 48 | |
| Harmfulness Detection | WildGuard | Macro F1 Score57.74 | 47 | |
| Text-based safety moderation | Beavertails | F1 Score84.8 | 46 | |
| Harmfulness Detection | OpenAI Moderation | Macro F1 Score78.58 | 45 | |
| Toxicity Detection | ToxicChat | F1 Score0.6792 | 45 | |
| Input Moderation | ToxicChat (test) | F1 Score72.9 | 42 | |
| Prompt Harmfulness Detection | AegisSafety (test) | F1 Score77.63 | 41 |