Run this model with HF Jobs

Run cswbyu/CHILLGuard-8B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/cswbyu/CHILLGuard-8B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/cswbyu/CHILLGuard-8B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/cswbyu/CHILLGuard-8B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/cswbyu/CHILLGuard-8B. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

CHILLGuard-8B

CHILLGuard: Towards Fine-Grained Chinese LLM Safety Guardrail with Scalable Data Construction and Model-aware Preference Alignment (Findings of EMNLP 2026)

CHILLGuard-8B is a fine-grained Chinese LLM content-safety guardrail classifier fine-tuned from Qwen3-8B. It judges whether a Chinese prompt is safe or unsafe, with a 5-macro / 31-micro harm taxonomy aligned with Chinese regulations and linguistic characteristics.

Usage

Transformers

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "cswbyu/CHILLGuard-8B"
model = AutoModelForCausalLM.from_pretrained(model_id, dtype="bfloat16", device_map="auto", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)

messages = [
    {"role": "system", "content": "ไฝ ๆ˜ฏไธ€ไธชๅฎ‰ๅ…จๅฎกๆ ธๅŠฉๆ‰‹ใ€‚่ฏทๅช่พ“ๅ‡บ'ๅฎ‰ๅ…จ'ๆˆ–'ไธๅฎ‰ๅ…จ'ใ€‚"},
    {"role": "user", "content": "่ฏทๅˆคๆ–ญไปฅไธ‹ๆ–‡ๆœฌๆ˜ฏๅฆๅฎ‰ๅ…จ๏ผš\n<ๅพ…ๆฃ€ๆต‹ๆ–‡ๆœฌ>"},
]
inputs = tokenizer.apply_chat_template(
    messages, add_generation_prompt=True, return_tensors="pt",
    return_dict=True, enable_thinking=False
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=10, do_sample=False)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
# -> "ๅฎ‰ๅ…จ" or "ไธๅฎ‰ๅ…จ"

vLLM

vllm serve cswbyu/CHILLGuard-8B --max-model-len 2048

> When calling the OpenAI-compatible server, pass `"chat_template_kwargs": {"enable_thinking": false}` in the request (required for 1.7B / 8B; no effect on 4B), and use the same system / user prompt as above.

Requires transformers >= 5.3 (the config uses the new dtype field).

Training

The model is trained with the generatorโ€“classifier collaborative training framework (paper Sec. 4.3) via Model-aware Direct Preference Optimization (MDPO): three iterations, in which the classifier is fine-tuned from the Qwen3 base model in every iteration, while the uncensored Dolphin3.0-Llama3.1-8B rewriting generator produces adversarial prompts in iterations 1 and 2.

Intended Use & Limitations

  • Intended for Chinese prompt-level content safety moderation in research and non-commercial guardrail settings.
  • Optimized for Chinese content; generalization to other languages and emerging adaptive adversarial attacks is limited (see the paper's Limitations section).
  • As with any moderation system, over-censorship and false positives are possible; human review is recommended for borderline cases.

Ethical Considerations

This model is trained on datasets containing examples of harmful content for the purpose of detecting and mitigating such content. It must not be used to generate harmful content. The datasets were screened to remove personally identifiable information.

Citation

@inproceedings{yu-etal-2026-chillguard,
  title     = "{CHILLG}uard: Towards Fine-Grained {C}hinese {LLM} Safety Guardrail with Scalable Data Construction and Model-aware Preference Alignment",
  author    = "Yu, Wenbo  and
             Wang, Bohua  and
             Fang, Hao  and
             Gao, Kuofeng  and
             Zeng, Jingru  and
             Yang, Xiaochen  and
             Zhang, Tianyi  and
             Ma, Xiaoxiao  and
             Kong, Jiawei  and
             Wu, Hao  and
             Chen, Bin  and
             Xia, Shu-Tao  and
             Zhang, Min",
  editor    = "Lee, Hung-Yi  and
             Dev, Sunipa  and
             Li, Jessy  and
             Elliott, Desmond",
  booktitle = "Findings of the {A}ssociation for {C}omputational {L}inguistics: {EMNLP} 2026",
  month     = oct,
  year      = "2026",
  address   = "Budapest, Hungary",
  publisher = "Association for Computational Linguistics",
  url       = "https://aclanthology.org/2026.findings-emnlp.1721/",
  doi       = "10.18653/2026.findings-emnlp.1721",
  pages     = "36802--36827",
  ISBN      = "979-8-89176-462-0",
  abstract  = "Malicious content generated from large language models (LLMs) could pose severe safety risks and ethical concerns. While existing LLM safety guardrails excel in English or multilingual settings, they lack adaptation to Chinese-specific regulatory policies, cultural context, and linguistic nuances, failing to support fine-grained risk classification for diverse deployment needs. In this paper, we introduce a 5-macro, 31-micro category fine-grained risk taxonomy for Chinese scenarios, and build $\textbf{CHILLGuard}$: a dedicated $\textbf{Chi}$nese $\textbf{LL}$M content safety $\textbf{guard}$rail. To address the critical scarcity of high-quality annotated Chinese safety data, we propose a scalable multi-stage data construction pipeline: we expand multi-source corpus via retrieval-augmented generation, generate implicit harmful samples through prompt engineering rewriting, and refine high-quality data via multi-model voting-based label calibration. Based on this, we build $\textbf{CHILLGuardTrain}$, a large-scale training set with 405,007 samples, and $\textbf{CHILLGuardTest}$, a rigorously curated annotated test set with 51,745 samples. We then train CHILLGuard on CHILLGuardTrain under a generator-classifier collaborative framework via Model-aware Direct Preference Optimization. Extensive experiments under multiple settings demonstrate the state-of-the-art performance of CHILLGuard, e.g., a 15.92{\%} relative improvement of F1 score over Qwen3Guard-8B-Strict on our benchmark. We release our resources at https://github.com/cswbyu/CHILLGuard."
}
Downloads last month
537
Safetensors
Model size
8B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for cswbyu/CHILLGuard-8B

Finetuned
Qwen/Qwen3-8B
Finetuned
(2,462)
this model
Quantizations
1 model

Collection including cswbyu/CHILLGuard-8B

Paper for cswbyu/CHILLGuard-8B