YuFeng-XGuard: A Reasoning-Centric, Interpretable, and Flexible Guardrail Model for Large Language Models
Paper • 2601.15588 • Published
此模型是使用llmexport从YuFeng-XGuard-Reason-0.6B导出的4bit量化版本的MNN模型。
YuFeng-XGuard-Reason 是一系列专为内容安全设计的护栏模型,旨在精准识别用户请求、模型响应及通用文本中的安全风险,并提供可配置的风险归因信息。
模型基于 Qwen3 架构构建,针对线上实时交互场景进行了深度优化,兼顾推理时延、识别精度与策略扩展能力。为了在保证可解释性的同时最大限度降低生成开销,模型采用了“先判定、后归因”的两阶段输出范式:优先输出结构化的风险结论,随后按需提供详细的风险解释。目前模型在多语言风险识别、攻击指令防御及安全补全等多个内容安全基准测试中均达到SOTA水平。
在多个内容安全基准测试中,YuFeng-XGuard-Reason 与主流护栏模型进行了性能对比。更多详实数据请参阅技术报告。
# install huggingface
pip install huggingface
# shell download
huggingface download --model 'taobao-mnn/YuFeng-XGuard-Reason-8B-MNN' --local_dir 'path/to/dir'
# SDK download
from huggingface_hub import snapshot_download
model_dir = snapshot_download('taobao-mnn/YuFeng-XGuard-Reason-8B-MNN')
# git clone
git clone https://www.modelscope.cn/taobao-mnn/YuFeng-XGuard-Reason-8B-MNN
# clone MNN source
git clone https://github.com/alibaba/MNN.git
# compile
cd MNN
mkdir build && cd build
cmake .. -DMNN_LOW_MEMORY=true -DMNN_CPU_WEIGHT_DEQUANT_GEMM=true -DMNN_BUILD_LLM=true -DMNN_SUPPORT_TRANSFORMER_FUSE=true
make -j
# run
./llm_demo /path/to/YuFeng-XGuard-Reason-8B-MNN/config.json prompt.txt
Base model
Qwen/Qwen3-8B-Base