Views
No views yet
1git clone https://github.com/zrwang1211/SafeAtlas-VL.git
2cd SafeAtlas-VL
3pip install -e .1from ordinal_safety_vlm import SafetyPredictor
2
3predictor = SafetyPredictor(
4 "zrwang1211/SafeAtlas-Guard-2B",
5 device_map="auto",
6 dtype="bfloat16",
7)
8
9result = predictor.predict(
10 image="examples/example.jpg",
11 target_name="response",
12 request="What fruit is shown in the image?",
13 response="The image shows a red apple.",
14)
15
16print(result.safety_label) # safe core
17print(f"{result.risk_score:.2f}")
18print(result.teacher_predictions) # {'judge1': 'safe', 'judge2': 'safe', 'judge3': 'safe'}pathlib.Path, or PIL.Image.Image.| Field | Description |
|---|---|
safety_label | Predicted five-level safety label. |
risk_score | Expected ordinal level mapped linearly to 0–100. |
z | Scalar latent risk value before the learned thresholds. |
thresholds | Four learned monotonic ordinal thresholds. |
ordinal_probs | Cumulative probabilities of exceeding each ordinal threshold. |
class_probs | Probability distribution over the five levels. |
category | Predicted harm category or none. |
category_probs | Probability distribution over 16 category labels. |
teacher_predictions | Auxiliary teacher-head predictions. |
teacher_probs | Auxiliary teacher-head probability distributions. |
safe core, safe leaning disputed, boundary uncertain, unsafe leaning disputed, and unsafe core. Teacher-head outputs
are defined for request and response targets.model.safetensors contains the instruction-tuned backbone.
ordinal_heads.safetensors contains the prediction heads and learned
thresholds. ordinal_config.json defines their architecture, labels, score
range, and prompt files.| Benchmark | Target | Threshold | F1 |
|---|---|---|---|
| BeaverTails-V | Multimodal request | 15 | 89.93 |
| BeaverTails-V | Multimodal response | 25 | 78.38 |
| SPA-VL | Multimodal request | 35 | 79.82 |
| SPA-VL | Multimodal response | 30 | 74.41 |
| VLGuard | Multimodal request | 15 | 95.42 |
| HarmImageTest | Image | 25 | 66.99 |
| LLaVAGuard | Image | 30 | 72.86 |
| Multimodal average (7) | 79.69 | ||
| HarmBench Prompt | Text request | 15 | 100.00 |
| HarmBench Response | Text response | 35 | 83.23 |
| OpenAI Moderation | Text request | 65 | 73.23 |
| SafeRLHF | Text response | 20 | 70.46 |
| Overall average (11) | 80.43 |
1@misc{wang2026safeatlasvlbinarymultimodalsafety,
2 title={SafeAtlas-VL: Beyond Binary Multimodal Safety with Large-Scale Data and Guard Models},
3 author={Zongrui Wang and Xiangyang Zhu and Sicheng Wang and Han Wang and Dingyi Rong and Zeyu Zhang and Chunyi Li and Yue Shi and Kaiwei Zhang and Zicheng Zhang and Yuan Tian and Qi Jia and Yan Teng and Wei Sun and Ning Liu and Guangtao Zhai},
4 year={2026},
5 eprint={2608.29098},
6 archivePrefix={arXiv},
7 primaryClass={cs.AI},
8 url={https://arxiv.org/abs/2608.29098},
9}