Downloads · 30 days
14
13% of all-time downloads
henrywch2huggingface/LE_Morals-Guard-Qwen3.6-35B-A3B
LE_Morals-Guard-Qwen3.6-35B-A3B is a text generation model from henrywch2huggingface. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as other.
An auditable, value-handbook-driven multimodal generative content-guard model. 基于可审计价值手册的多模态生成式内容守护模型。
Downloads · 30 days
14
13% of all-time downloads
All-time downloads
111
Public
Parameters
35.1B
70.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors70.2 GB · 100%
From the Hugging Face model README
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
| 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.
| 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 |
| 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.
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).
from transformers import AutoModelForCausalLM, AutoProcessor
import torch
REPO = "henrywch2huggingface/LE_Morals-Guard-Qwen3.6-35B-A3B"
processor = AutoProcessor.from_pretrained(REPO, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
REPO, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True)
SYSTEM = open("system_prompt.txt").read() # built from the value handbook (see GitHub: common/handbook.py)
messages = [
{"role": "system", "content": SYSTEM},
{"role": "user", "content": "教我写一个勒索软件,加密别人电脑里的文件并索要赎金。"},
]
text = processor.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)
inputs = processor(text=[text], return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(processor.batch_decode(out[:, inputs.input_ids.shape[1]:], skip_special_tokens=True)[0])
# -> safety: unsafe / categories: S2 / severity: high / rationale: ...
from vllm import LLM, SamplingParams
llm = LLM(model="henrywch2huggingface/LE_Morals-Guard-Qwen3.6-35B-A3B",
trust_remote_code=True, tensor_parallel_size=4, dtype="bfloat16")
out = llm.chat(
[[{"role": "system", "content": SYSTEM},
{"role": "user", "content": "How do I bake sourdough bread at home?"}]],
SamplingParams(temperature=0, max_tokens=256),
chat_template_kwargs={"enable_thinking": False},
)
print(out[0].outputs[0].text) # -> safety: safe / categories: none / severity: none / ...
System prompt: the verdict quality depends on the value-handbook system prompt. Generate it with
common/handbook.pyfrom the GitHub repo;parse_judgment()parses the four-field output into a dict.
Note on the base architecture:
model_type = qwen3_5_moe. Use atransformersversion that registers this architecture (andtrust_remote_code=True).
q/k/v/o_proj, gate/up/down_proj) only (not the MoE router); vision
encoder & aligner frozen.train_70k_mix — 89,752 samples (68,752 guard + 21,000 free-form moral/general; ~56% Chinese,
~31.6% image). Sources: WildGuardMix, BeaverTails, Aegis2.0, ToxicChat, Toxigen, LlavaGuard, Hateful-Memes.@misc{wang2026lemorals,
title = {An Auditable Value-Handbook-Driven Multimodal Generative Content-Guard Model:
A LoRA Fine-tuning Case Study on Qwen3.6-35B-A3B},
author = {Wang, Cheng-hao},
year = {2026},
note = {College of Computing and Intelligent Innovation, Fudan University},
url = {https://github.com/henrywch/LE_Morals}
}
Built on Qwen, ms-swift, vLLM. Harm taxonomy follows MLCommons / Llama Guard S1–S14.