
[NeurIPS 2025] 논문 "GuardReasoner-VL: Safeguarding VLMs via Reinforced Reasoning"의 공식 소스 코드
Yue Liu, Shengfang Zhai, Mingzhe Du
Yulin Chen, Tri Cao, Hongcheng Gao, Cheng Wang
Xinfeng Li, Kun Wang, Junfeng Fang, Jiaheng Zhang, Bryan Hooi
1National University of Singapore, 2Nanyang Technological University
VLM의 안전성을 강화하기 위해, 본 논문은 GuardReasoner-VL이라는 새로운 추론 기반 VLM 가드 모델을 소개한다. 핵심 아이디어는 온라인 RL을 통해 가드 모델이 중재 결정을 내리기 전에 숙고하여 추론하도록 유도하는 것이다. 먼저, 텍스트, 이미지, 텍스트-이미지 입력을 포괄하는 123K 샘플과 631K 추론 단계를 포함하는 추론 코퍼스 GuardReasoner-VLTrain을 구축한다. 그런 다음, 이를 기반으로 SFT를 통해 모델의 추론 능력을 콜드 스타트(cold-start)한다. 또한, 온라인 RL을 통해 중재와 관련된 추론을 더욱 강화한다. 구체적으로, 샘플의 다양성과 난이도를 향상시키기 위해, 제안된 안전 인식 데이터 연결(safety-aware data concatenation)을 통한 데이터 증강과 함께 거부 샘플링(rejection sampling)을 수행한다. 또한, 초기 단계에서는 탐색(exploration)을, 후기 단계에서는 활용(exploitation)을 장려하기 위해 동적 클리핑 파라미터를 사용한다. 성능과 토큰 효율성의 균형을 맞추기 위해, 정확도, 형식, 토큰 비용을 통합한 길이 인식 안전 보상(length-aware safety reward)을 설계한다. 광범위한 실험을 통해 우리 모델의 우수성을 입증한다. 놀랍게도, 평균 F1 점수에서 2위 모델을 19.27% 능가한다.
그림 1: GuardReasoner-VL 개요.
GuardReasoner-VL을 평가하려면 다음 코드를 실행하세요.
python ./evaluate.py
결과는 result.csv 파일에 저장됩니다.
Performance of GuardReasoner-VL (GuardReasoner-VL-7B):
ToxicChat ,HarmBenchPrompt ,OpenAIModeration ,AegisSafetyTest ,SimpleSafetyTests ,WildGuardTest ,Average (Text) ,HarmImageTest ,SPA-VL-Eval ,Average (All)
76.51 ,98.30 ,70.98 ,90.13 ,98.99 ,88.35 ,79.88 ,70.84 ,85.60 ,79.07
HarmBenchResponse ,SafeRLHF ,BeaverTails ,XSTestReponseHarmful,WildGuardTest ,Average (Text) ,SPA-VL-Eval ,Average (All)
87.22 ,66.37 ,84.76 ,92.72 ,79.04 ,79.42 ,73.22 ,77.58
Performance of GuardReasoner-VL (GuardReasoner-VL-Eco-7B):
ToxicChat ,HarmBenchPrompt ,OpenAIModeration ,AegisSafetyTest ,SimpleSafetyTests ,WildGuardTest ,Average (Text) ,HarmImageTest ,SPA-VL-Eval ,Average (All)
76.26 ,98.73 ,70.82 ,90.34 ,99.50 ,88.54 ,79.82 ,64.84 ,85.26 ,77.49
HarmBenchResponse ,SafeRLHF ,BeaverTails ,XSTestReponseHarmful,WildGuardTest ,Average (Text) ,SPA-VL-Eval ,Average (All)
86.22 ,66.15 ,85.51 ,93.33 ,78.60 ,79.51 ,70.81 ,76.94
Performance of GuardReasoner-VL (GuardReasoner-VL-3B):
ToxicChat ,HarmBenchPrompt ,OpenAIModeration ,AegisSafetyTest ,SimpleSafetyTests ,WildGuardTest ,Average (Text) ,HarmImageTest ,SPA-VL-Eval ,Average (All)
74.45 ,89.10 ,70.83 ,88.79 ,99.50 ,88.92 ,78.77 ,70.93 ,86.47 ,78.73
HarmBenchResponse ,SafeRLHF ,BeaverTails ,XSTestReponseHarmful,WildGuardTest ,Average (Text) ,SPA-VL-Eval ,Average (All)
85.76 ,66.37 ,85.16 ,93.08 ,76.07 ,78.83 ,71.19 ,76.56
Performance of GuardReasoner-VL (GuardReasoner-VL-Eco-3B):
ToxicChat ,HarmBenchPrompt ,OpenAIModeration ,AegisSafetyTest ,SimpleSafetyTests ,WildGuardTest ,Average (Text) ,HarmImageTest ,SPA-VL-Eval ,Average (All)
73.47 ,88.58 ,70.87 ,89.04 ,99.50 ,89.16 ,78.43 ,66.79 ,85.82 ,77.39
HarmBenchResponse ,SafeRLHF ,BeaverTails ,XSTestReponseHarmful,WildGuardTest ,Average (Text) ,SPA-VL-Eval ,Average (All)
84.72 ,66.96 ,85.39 ,93.59 ,77.39 ,79.31 ,72.01 ,77.14
그림 2: 다중 모달 가드레일 벤치마크에서 GuardReasoner-VL의 평균 성능.
표 1: 프롬프트 유해성 탐지 작업의 성능.
표 2: 응답 유해성 탐지 작업의 성능.
GuardReasoner-VL의 생성 과정을 재현하려면 다음 코드를 실행하세요.
bash test.sh
GuardReasoner-VL을 사용하려면 다음 코드를 실행하세요.
CUDA_VISIBLE_DEVICES=0 python deploy.py
GuardReasoner의 학습 과정을 재현하려면 학습 파이프라인을 참조하세요.
우리의 방법은 다음 리소스에 부분적으로 기반을 두고 있습니다. 훌륭한 작업에 감사드립니다.
이 저장소가 도움이 되었다면 논문을 인용해 주세요.
@article{GuardReasoner,
title={GuardReasoner: Towards Reasoning-based LLM Safeguards},
author={Liu, Yue and Gao, Hongcheng and Zhai, Shengfang and Jun, Xia and Wu, Tianyi and Xue, Zhiwei and Chen, Yulin and Kawaguchi, Kenji and Zhang, Jiaheng and Hooi, Bryan},
journal={arXiv preprint arXiv:2501.18492},
year={2025}
}
@article{GuardReasoner-VL,
title={GuardReasoner-VL: Safeguarding VLMs via Reinforced Reasoning},
author={Liu, Yue and Zhai, Shengfang and Du, Mingzhe and Chen, Yulin and Cao, Tri and Gao, Hongcheng and Wang, Cheng and Li, Xinfeng and Wang, Kun and Fang, Junfeng and Zhang, Jiaheng and Hooi, Bryan},
journal={arXiv preprint arXiv:2505.11049},
year={2025}
}
(맨 위로)