Papers › SaFeR-ToolKit: Structured Reasoning via Virtual Tool Calling for Multimodal Safety

SaFeR-ToolKit: Structured Reasoning via Virtual Tool Calling for Multimodal Safety

3 Mar 2026arXiv:2603.02635added by Syntology

Zixuan Xu, Tiancheng He, Huahui Yi, Kun Wang, Xi Chen, Gongli Xi, Qiankun Li, Kang Li, Yang Liu, Zhigang Zeng

Title, abstract, authors and date from arXiv's metadata (CC0); this paper is not in the Papers with Code archive (frozen 2025-07-28).

Vision-language models remain susceptible to multimodal jailbreaks and over-refusal because safety hinges on both visual evidence and user intent, while many alignment pipelines supervise only the final response. To address this, we present SaFeR-ToolKit, which formalizes safety decision-making as a checkable protocol. Concretely, a planner specifies a persona, a Perception → Reasoning → Decision tool set, and a constrained transition graph, while a responder outputs a typed key-value tool trace before the final answer. To make the protocol reliably followed in practice, we train a single policy with a three-stage curriculum (SFT → DPO → GRPO), where GRPO directly supervises tool usage beyond answer-level feedback. Our contributions are two-fold: I. Dataset. The first tool-based safety reasoning dataset, comprising 31,654 examples (SFT 6k, DPO 18.6k, GRPO 6k) plus 1k held-out evaluation. II. Experiments. On Qwen2.5-VL, SaFeR-ToolKit significantly improves Safety/Helpfulness/Reasoning Rigor on 3B (29.39/45.04/4.98 → 84.40/71.13/78.87) and 7B (53.21/52.92/19.26 → 86.34/80.79/85.34), while preserving general capabilities (3B: 58.67 → 59.21; 7B: 66.39 → 66.81). Codes are available at https://github.com/Duebassx/SaFeR_ToolKit.

PaperPDFCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 15 code samples harvested from 1 repository linked to this paper: 9 ran (of which 0 constructed an object rather than computing a result; 2 with no instrument failure: 0 honoured, 0 violated, 2 with no contract checked; 7 where Syntology's instrument failed) · 6 unverified. Where Syntology's instrument failed: 5 where our contract draft was wrong; 2 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: found in paper text by Syntology: 15 samples from 1 repository, 9 ran (2 with no instrument failure; 7 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

No sample is linked to this paper from 1 of its repositories that Syntology harvested for other papers:

Levels written between 2026-09-24 and 2026-09-26 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

hiyouga/LlamaFactory found in paper text by SyntologySyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Lightweight Multimodal LLM-Enabled Cost-Effective Defect Grading of Power Transmission... (arXiv:2605.28822; that paper's own run record: 3 ran (of which 0 constructed an object rather than computing a result; 1 with no instrument failure: 0 honoured, 0 violated, 1 with no contract checked; 2 where Syntology's instrument failed) · 1 unverified); nothing checks that they implement this paper's method. report
hiyouga/EasyR1 found in paper text by SyntologySyntology: 15 samples, 9 ran (7 instrument-failed) · 6 unverified report

Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

15 samples harvested: 9 ran (of which 0 constructed an object rather than computing a result; 2 with no instrument failure: 0 honoured, 0 violated, 2 with no contract checked; 7 where Syntology's instrument failed) · 6 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

5ran · our draft was wrong
2ran; the contract check could not run
2ran
6unverified

Licence: 0 of the 15 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from hiyouga/EasyR1. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity.

hiyouga/EasyR1 found in paper text by Syntology 15 samples, 9 ran (7 instrument-failed) · 6 unverified
collate_fn in 500 papers verl/utils/dataset.py ran · our draft was wrong Apache-2.0 (permissive) · 6dabc7804e03b1d0 · report fixture: signature features:list/1/dict · returned dict · level recorded 2026-09-26
get_kl_controller in 53 papers verl/trainer/core_algos.py ran · our draft was wrong Apache-2.0 (permissive) · 7633fd09bcf8972a · report fixture: signature algorithm_config:AlgorithmConfig/0/? · returned AdaptiveKLController · level recorded 2026-09-26
get_rope_index in 11 papers verl/models/transformers/qwen3_vl.py ran Apache-2.0 (permissive) · 0758af83dd12ea52 · report fixture: signature processor:MockQwen3VLProcessor/0/?, input_ids:Tensor/1/int, image_grid_thw:Tensor/2/int, video_grid_thw:NoneType/0/?, attention_mask:Tensor/1/int · returned Tensor · level recorded 2026-09-26
prepare_fa2_from_position_ids in 15 papers verl/models/transformers/flash_attention_utils.py ran Apache-2.0 (permissive) · 72f505c72eeef3e8 · report fixture: signature query:Tensor/3/float, key:Tensor/3/float, value:Tensor/3/float, position_ids:Tensor/2/int · returned tuple · level recorded 2026-09-26
qwen2_vl_model_forward verl/models/transformers/qwen2_vl.py ran; the contract check could not run (RAISES) Apache-2.0 (permissive) · c2c77f3bf52d2305 · report fixture: signature self:callable/0/?, input_ids:Tensor/2/int, labels:Tensor/2/int · returned Qwen2VLCausalLMOutputWithPast · level recorded 2026-09-26
qwen3_vl_model_forward verl/models/transformers/qwen3_vl.py ran; the contract check could not run (RAISES) Apache-2.0 (permissive) · 75bdeb21d651d4b5 · report fixture: signature self:callable/0/?, input_ids:Tensor/2/int, labels:Tensor/2/int · returned Qwen3VLCausalLMOutputWithPast · level recorded 2026-09-26
reduce_metrics in 5 papers verl/trainer/metrics.py ran · our draft was wrong Apache-2.0 (permissive) · c817845fd5e85ff7 · report fixture: signature metrics:dict/0/? · returned dict · level recorded 2026-09-26
register_adv_estimator verl/trainer/core_algos.py ran · our draft was wrong Apache-2.0 (permissive) · 59499c9109dfcb5e · report fixture: signature name:str/0/str · returned function · level recorded 2026-09-26
unpad_dataproto in 102 papers verl/protocol.py ran · our draft was wrong Apache-2.0 (permissive) · a91c18341292d50e · report fixture: signature data:DataProto/0/?, pad_size:int/0/int · returned DataProto · level recorded 2026-09-24
compute_advantage_return verl/trainer/core_algos.py unverified Apache-2.0 (permissive) · 61938c6bf9d13f84 · report
flash_attention_forward in 14 papers verl/models/transformers/flash_attention_utils.py unverified Apache-2.0 (permissive) · 7688ceba543fa185 · report
get_rope_index in 11 papers verl/models/transformers/qwen2_vl.py unverified Apache-2.0 (permissive) · 07ec6b020ddf3b01 · report
process_image in 43 papers verl/utils/dataset.py unverified Apache-2.0 (permissive) · 9a950b864d329f1c · report
qwen2_vl_base_forward verl/models/transformers/qwen2_vl.py unverified Apache-2.0 (permissive) · 15cffd3e46d6bf67 · report
qwen3_vl_base_forward verl/models/transformers/qwen3_vl.py unverified Apache-2.0 (permissive) · 75394a0b094d4a2f · report

Results from the paper

The Papers with Code archive ends with its 2025-07-28 snapshot. This paper's arXiv identifier, 2603.02635, was issued in March 2026, after that date, so the archive has no leaderboard rows for it.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections