[Image blocked: SingGuard icon]
SingGuard: A Policy-Adaptive Multimodal LLM Guardrail with Dynamic Reasoning
π€ HuggingFace Β | Β
π€ ModelScope Β | Β
π Paper
Introduction
[Image blocked: SingGuard benchmark radar]
[Image blocked: SingGuard benchmark overview]
SingGuard is a policy-adaptive multimodal guardrail model family for safety assessment across text, image, image-text, multilingual, query-side, and response-side scenarios. It treats the active safety policy as a runtime input rather than a fixed training-time taxonomy, allowing deployment teams to evaluate content against default categories or custom natural-language rules without retraining the model.
SingGuard is designed for practical moderation settings where risks may arise from a user query, an image, a model response, or their cross-modal composition. It performs policy-grounded rule matching and outputs both an overall safe / unsafe judgment and the matched risk category in an <answer>...</answer> tag.
Across six major benchmark categories spanning multimodal safety, image-only safety, text query safety, text response safety, multilingual query safety, and multilingual response safety, SingGuard achieves state-of-the-art average performance and shows strong adaptation to runtime-supplied policies.
Key Features
- π‘οΈ Unified Multimodal Moderation: Supports text, image, image-text, multilingual, query-side, and response-side safety assessment.
- π― Strong Benchmark Performance: Delivers broad improvements across multimodal safety, image-only safety, text query safety, text response safety, multilingual query safety, and multilingual response safety benchmarks.
- β‘ Dynamic Reasoning Flow: Supports fast first-token routing for an immediate safety signal, then continues generation when deeper reasoning is needed for a more precise final judgment.
- π§© Runtime Policy Adaptation: Accepts active safety rules through the
policy argument and judges only against those rules.
- π Native Inference Compatibility: Supports standard Transformers and vLLM chat-style message inputs without manual prompt rewriting.
Quick Start
The examples below use HuggingFace Transformers. SingGuard system prompts are stored in each model directory through tokenizer configuration and chat templates. Pass optional policy directly to processor.apply_chat_template for runtime policy adaptation.
Installation
If your Transformers version does not expose AutoModelForImageTextToText, upgrade Transformers to a version that supports Qwen3-VL.
For Transformers versions that require explicit template variables, pass custom options with chat_template_kwargs, for example chat_template_kwargs={"thinking_type": "fast"} or chat_template_kwargs={"policy": policy}.
Moderating User Query: Fast-Slow mode
Evaluate whether the user query matches any risk rule. The default chat template uses the fast-slow mode, which returns a more detailed assessment process before the final <answer>...</answer>.
Example output:
Moderating User Query: Fast mode
Use thinking_type="fast" when you want compact output with only the binary judgment and final category.
Example output:
Moderating Query + Response
Evaluate whether the model response provides unsafe assistance in the context of the query. Refusals and safe redirections can be classified as safe.
Example output:
Moderating Multimodal Content
For multimodal inference, processor.apply_chat_template renders the prompt and loads the image into the model inputs.
Example output:
Dynamic Policy Inference
policy replaces the default ## Risk Categories section. Once provided, the model judges only against the active policy, and <answer>...</answer> should return a rule title from the current policy or Safe.
Example output:
The first line is the binary judgment, and <answer> contains the final risk category from the default taxonomy or the active dynamic policy.
Notes
policy replaces the default risk rules. When dynamic policy is enabled, make sure <answer> returns a rule title from the active policy or Safe.
- Production systems should handle malformed outputs, such as an unparsable first line, missing
<answer>, or a category outside the active policy.
- For multimodal inputs, make sure image paths are accessible to the local inference environment.
Risk Categories
The default full policy contains the following risk categories. When a dynamic policy is provided, the model judges only against the active policy instead of forcing every case into the default categories.
A. Sexual Content Risk
- Content involving explicit sexual material, exploitation, or coercive sexual acts.
B. Real-World Crimes & Public Safety
- Content involving violent crime, weapons, other crimes, or public-safety threats.
C. Unethical Behavior
- Content involving hate, harassment, manipulation, self-harm, disturbing imagery, or harmful misinformation.
D. Cybersecurity & Information Manipulation
- Content involving data leaks, hacking, surveillance abuse, platform abuse, or copyright abuse.
E. Agent Safety
- Content attempting to expose system prompts, internal policies, or other model safeguards.
F. Politically Sensitive Content
- Content involving political advocacy, rumors, unrest, historical distortion, or attacks on political figures.
G. Animal Abuse
- Content involving cruelty to animals or the spread of animal abuse.
Safe
- Content that does not match any active risk category.
Citation
π License
This project is licensed under the Apache-2.0 License.