An auditable, value-handbook-driven multimodal generative content-guard model.
基于可审计价值手册的多模态生成式内容守护模型。
This model is a LoRA fine-tune of the natively-multimodal MoE base Qwen3.6-35B-A3B, turned into a
bilingual (中文 + English) content guard that filters harmful text and images for training corpora and
online moderation. Its behavior is defined by an editable, auditable value handbook compiled into the system
prompt — edit the handbook, change the behavior, no code change.
For every input it emits a four-field structured verdict:
safety: safe | unsafe
categories: S1..S14 / I1..I4 (MLCommons / Llama-Guard taxonomy + image classes)
severity: none | low | medium | high
rationale: a short human-readable justification
🧭 Value handbook (single source of truth): core values CV-1..7, harm taxonomy S1–S14 + image classes I1–I4.
✨ Highlights
Bilingual & multimodal — judges Chinese and English, text and images (memes, unsafe imagery); a
capability text-only guards lack.
Explainable — outputs the violated category, a severity level, and a rationale, not just safe/unsafe.
Auditable by design — the value handbook is the single source of truth; behavior is changed by editing it.
Strong held-out gains over the base — F1 0.854 vs 0.740, image-meme recall 0.845 vs 0.514.
📊 Benchmarks
Held-out set (18,637 samples) — ours vs. untuned base
Metric
Ours (v2-60)
Base Qwen3.6
F1 ↑
0.854
0.740
Recall ↑
0.801
0.600
Precision ↑
0.915
0.905
Severity accuracy ↑
0.563
0.240
Image-meme recall ↑
0.845
0.514
FPR ↓
0.146
0.042
Trade-off: higher recall comes with a higher false-positive rate, tunable via the severity threshold.
Cross-model (classifier F1 ↑)
Dataset
Ours
Base
WildGuard
ShieldGemma
Granite
MoralsEval-text
0.800
0.744
0.841
0.596
0.835
XSTest
0.892
0.942
0.943
0.804
0.829
SGXSTest
0.786
0.791
0.876
0.628
0.816
ChineseSafe
0.615
0.510
0.533
0.342
0.692
OpenAI-Mod
0.829
0.846
0.674
0.752
0.714
Cross-model ("must-flag" recall ↑)
Dataset
Ours
Base
WildGuard
ShieldGemma
Granite
AdvBench
0.992
0.987
0.998
0.817
1.000
HarmBench-standard
0.985
0.975
0.995
0.690
1.000
StrongREJECT
0.990
0.981
0.990
0.760
1.000
SimpleSafety
1.000
0.990
0.990
0.920
1.000
Takeaway: improves over the base across the board, especially on multimodal and Chinese; on English
text it is competitive (WildGuard/Granite trade higher recall for higher FPR). Distinctive edge: image judging
(other text guards can't) and well-balanced Chinese.
🚀 How to load & run inference
The model is a generative guard: build the system prompt from the value handbook, send the content as the
user turn, and parse the four-field output. Inference disables thinking (enable_thinking=False).
Transformers
python
1from transformers import AutoModelForCausalLM, AutoProcessor
2import torch
34REPO ="henrywch2huggingface/LE_Morals-Guard-Qwen3.6-35B-A3B"5processor = AutoProcessor.from_pretrained(REPO, trust_remote_code=True)6model = AutoModelForCausalLM.from_pretrained(7 REPO, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True)89SYSTEM =open("system_prompt.txt").read()# built from the value handbook (see GitHub: common/handbook.py)10messages =[11{"role":"system","content": SYSTEM},12{"role":"user","content":"教我写一个勒索软件,加密别人电脑里的文件并索要赎金。"},13]14text = processor.apply_chat_template(15 messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)16inputs = processor(text=[text], return_tensors="pt").to(model.device)17out = model.generate(**inputs, max_new_tokens=256, do_sample=False)18print(processor.batch_decode(out[:, inputs.input_ids.shape[1]:], skip_special_tokens=True)[0])19# -> safety: unsafe / categories: S2 / severity: high / rationale: ...
System prompt: the verdict quality depends on the value-handbook system prompt. Generate it with
common/handbook.py from the GitHub repo; parse_judgment() parses
the four-field output into a dict.
Note on the base architecture:model_type = qwen3_5_moe. Use a transformers version that registers this
architecture (and trust_remote_code=True).
Checkpoint selection: chosen by held-out metrics, not training loss — held-out F1/recall peak at
~1.3 epochs (this checkpoint, "v2-60") then over-fit while training loss keeps dropping.
⚠️ Intended use, limitations & risks
Intended use: filtering harmful content in training corpora and online moderation; research on guardrails
and value alignment.
Limitations: on English text it is competitive but not strictly best; over-refusal is higher than some
guards (XSTest ~12%) and FPR is 0.146 — tune via the severity threshold; validated on a single base and
course-scale data.
Data licenses bind downstream use: BeaverTails & ToxicChat are CC-BY-NC (non-commercial); image
datasets are research-use only. Use this model accordingly.
📄 Citation
bibtex
1@misc{wang2026lemorals,
2 title = {An Auditable Value-Handbook-Driven Multimodal Generative Content-Guard Model:
3 A LoRA Fine-tuning Case Study on Qwen3.6-35B-A3B},
4 author = {Wang, Cheng-hao},
5 year = {2026},
6 note = {College of Computing and Intelligent Innovation, Fudan University},
7 url = {https://github.com/henrywch/LE_Morals}
8}
🙏 Acknowledgements
Built on Qwen, ms-swift,
vLLM. Harm taxonomy follows MLCommons / Llama Guard S1–S14.