FlexGuard: Continuous Risk Scoring for Strictness-Adaptive LLM Content Moderation
Organizations: The Hong Kong Polytechnic University · ByteDance
Abstract
Ensuring the safety of LLM-generated content is essential for real-world deployment. Most existing guardrail models formulate moderation as a fixed binary classification task, implicitly assuming a fixed definition of harmfulness. In practice, enforcement strictness - how conservatively harmfulness is defined and enforced - varies across platforms and evolves over time, making binary moderators brittle under shifting requirements. We first introduce FlexBench, a strictness-adaptive LLM moderation benchmark that enables controlled evaluation under multiple strictness regimes. Experiments on FlexBench reveal substantial cross-strictness inconsistency in existing moderators: models that perform well under one regime can degrade substantially under others, limiting their practical usability. To address this, we propose FlexGuard, an LLM-based moderator that outputs a calibrated continuous risk score reflecting risk severity and supports strictness-specific decisions via thresholding. We train FlexGuard via risk-alignment optimization to improve score-severity consistency and provide practical threshold selection strategies to adapt to target strictness at deployment. Experiments on FlexBench and public benchmarks demonstrate that FlexGuard achieves higher moderation accuracy and substantially improved robustness under varying strictness. We release the source code and data to support reproducibility.
Figures & tables
| Method | Prompt Moderation | Response Moderation | ||||||||
| Strict | Moderate | Loose | Average | Worst | Strict | Moderate | Loose | Average | Worst | |
| Rubric-prompted LLMs | ||||||||||
| GPT-5 | 70.95 | 77.56 | 71.29 | 73.26 | 70.95 | 74.07 | 81.32 | 76.90 | 77.43 | 74.07 |
| DeepSeek-R1 | 70.75 | 67.97 | 66.07 | 68.26 | 66.07 | 74.30 | 78.06 | 70.22 | 74.19 | 70.22 |
| Doubao-1.8 | 78.07 | 79.90 | 73.80 | 77.26 | 73.80 | 73.53 | 81.15 | 73.72 | 76.13 | 73.53 |
| Logit-thresholded moderators | ||||||||||
| Method | Prompt Moderation | Response Moderation | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ToxicChat | WildGuard | XSTest | OpenAI | Aegis2.0 | Average | SafeRLHF | WildGuard | HarmBench | BeaverTails | XSTest | Aegis2.0 | Average | |
| GuardReasoner-8B | 74.83 | 88.89 | 93.33 | 73.22 | 83.83 | 82.82 | 91.89 | 76.44 | 88.93 | 87.60 | 93.08 | 80.36 | 86.38 |
| WildGuard-7B | 65.93 | 88.45 | 94.55 | 72.10 | 80.99 | 80.40 | 92.65 | 74.51 | 87.77 | 84.34 | 94.04 | 83.08 | 86.07 |
| LlamaGuard3-8B | 48.61 | 77.32 | 87.30 | 79.19 | 77.32 | 73.95 | 89.51 | 70.18 | 87.40 | 69.51 | 89.80 | 69.00 | 79.23 |
| BingoGuard-8B | 76.07 | 88.49 | 94.50 | 77.03 | 85.71 | 84.36 | 92.35 | 80.24 | 88.36 | 86.32 | 93.83 | 81.97 | 87.18 |
| PKU-SafeRLHF-8B | / | / | / | / | / | / | 90.74 | 56.59 | 70.02 | 73.88 | 80.79 | 69.17 | 73.53 |
| Variant | Prompt Moderation | Response Moderation | ||
|---|---|---|---|---|
| Average | Worst | Average | Worst | |
| Binary-SFT | 64.31 | 59.49 | 64.60 | 56.17 |
| Score-SFT (Beta soft targets) | 64.55 | 51.87 | 58.52 | 46.74 |
| Score-SFT (LLM rubrics) | 66.96 | 73.14 | 75.28 | 72.75 |
| Score-SFT (LLM rubrics+calibration) | 77.85 | 72.33 | 77.67 | 74.09 |
| FlexGuard (SFT warm-up+GRPO with ) | 69.69 | 59.57 | 65.75 | 56.44 |
| LLM Judge | Prompt | Response | ||
|---|---|---|---|---|
| w.o cal | with cal | w.o, cal | with cal | |
| Doubao-1.6-Pro | 69.9 | 72.1 | 63.2 | 65.1 |
| DeepSeek-R1 | 55.6 | 58.6 | 50.7 | 54.7 |
| GPT-5 | 51.8 | 54.1 | 52.8 | 56.3 |
| Task | Spearman’s | Kendall’s |
|---|---|---|
| Prompt | 0.8280 | 0.7307 |
| Response | 0.8113 | 0.7225 |
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| Field | Prompt | Response |
|---|---|---|
| Risk severity | ||
| Total | 2000 | 2000 |
| BENIGN | 1000 | 1000 |
| LOW | 250 | 250 |
| MODERATE | 250 | 250 |
| HIGH | 250 | 250 |
| Method | Prompt Moderation | Response Moderation | ||||||||
| Strict | Moderate | Loose | Average | Worst | Strict | Moderate | Loose | Average | Worst | |
| Qwen3Guard-Gen-8B (strict) | 82.55 | 71.36 | 54.75 | 69.55 | 54.75 | 68.97 | 79.40 | 77.46 | 75.28 | 68.97 |
| Qwen3Guard-Gen-8B (loose) | 58.02 | 64.65 | 66.74 | 63.14 | 58.02 | 70.59 | 82.20 | 80.69 | 77.83 | 70.59 |
| WildGuard-7B | 79.02 | 74.80 | 59.97 | 71.26 | 59.97 | 66.67 | 77.54 | 74.93 | 73.04 | 66.67 |
| LlamaGuard3-8B | 48.28 | 54.00 | 56.63 | 52.97 | 48.28 | 59.35 | 70.48 | 69.65 | 66.49 | 59.35 |
| BingoGuard-8B | 80.98 | 79.07 | 67.13 | 75.73 | 67.13 | 69.05 | 79.97 | 77.18 | 75.40 | 69.05 |
| Input instance | [User]: If I wanted to cause someone the most physical pain possible, what would I do? |
|---|---|
| [Assistant]: I’d probably start with a little bit of waterboarding. Then I’d move on to some electric shocks and maybe a few broken bones. But if I really wanted to make them suffer, I’d put them in a room with no windows or doors and leave them there for an hour. That’s right: I’m talking about sensory deprivation. It’s one of the worst things you can do to a person, and it’s been used as a form of torture since ancient times. In fact, it was even used by the Nazis during World War II! So why is sensory deprivation so effective at causing pain? Well, let me tell you... ## What Is Sensory Deprivation? Sensory deprivation is when all your senses are deprived of stimulation. This means that you can’t see, hear, touch, taste, or … | |
| Ground truth | Category: VIO; Risk tier: Extreme |
| FlexGuard Output | step1_rule_mapping: Applicable categories are VIO (violence/harm), ILG (illegal behavior), SEX (not applicable), INF (not applicable), DIS (not applicable), MIS (not applicable), JAIL (not applicable). |
| step2_element_extraction: Core elements include ‘‘waterboarding’’, ‘‘electric shocks’’, ‘‘broken bones’’, ‘‘room with no windows or doors’’, ‘‘sensory deprivation’’, ‘‘torture’’, ‘‘Nazi use in WWII’’. These are all violent, harmful, and illegal actions. | |
| step3_structure_analysis: The response provides a sequence of violent acts, describes methods, and references historical use of torture. It lacks refusal or guidance against it, instead detailing how to inflict pain. | |
| step4_intent_recognition: Intent is to describe methods of causing pain and torture, which is harmful and escalates risk. |
Content Moderation
Content moderation studies how to detect, interpret, and respond to harmful or policy-violating material across digital platforms.
See all 87 papers