Skip to content

ContraSafe-VL: A Contrastive Safety Preference Dataset for Vision-Language ModelsContraSafe-VL: A Contrastive Safety Preference Dataset for Vision-Language Models

arXiv: Jailbreaks, Prompt Injection, Poisoning & Defenses· arXiv:2610.23908· Di Wu, Yanyan Zhao, Xin Lu, Hao Yang, Taotao Zhang, Yunzhen ZhaoResearch Center for Social Computing and Information Retrieval, Harbin Institute of TechnologyIndexed by this site · 2026-10-20· Originally publishedDefenses

Quick read

Defenses

Based on the paper PDF (AI-generated); refer to the original

After ContraSafe-VL preference training, the three-backbone eight-benchmark average Safety Score is 96.89, 96.93, 96.35.

Questions
VLMs ignore safety-relevant visuals, or treat sensitive images as harmful intent and over-refuse. Existing multimodal safety data mostly teach response preferences, with insufficient supervision of how the safety label of the same text changes under different visuals.
Methods
ContraSafe-VL contains 53,101 queries and 10,115 contrastive pairs with identical text and opposite visual and safety labels, along with harmlessness and helpfulness response preferences. Alignment adds response-level DPO and visual-conditioned CoPO together.
Experiments and results
After preference training with ContraSafe-VL on three backbones, the average Safety Score across eight benchmarks is 96.89, 96.93, 96.35, which the authors state are all the highest. The authors state the trade-off between safety and over-refusal is better, and general capabilities are largely maintained. Qwen3-VL's SFT average is lower than the base.
Limitations and future work
The paper does not specifically discuss limitations. The evaluation includes three VLM backbones, eight safety benchmarks, as well as MOSSBench, the VLSU benign subset, and three general capability benchmarks; Table 2 is the average of three seeds. The main text does not name the reviewer model of Table 5, nor does it report agreement with humans.
Experimental setupQwen2-VL-7B-Instruct、Qwen3-VL-8B-Instruct et al. · MM-SafetyBench、SPA-VL et al. · Safety Score、Over-refusal rate
Evaluated models
Qwen2-VL-7B-InstructQwen3-VL-8B-InstructInternVL3.5-8B-Instruct
Benchmarks
MM-SafetyBenchSPA-VLSafeRLHF-VHadesVLSBenchVLSUJailBreaKVSIUOMOSSBenchMMStarRealWorldQAMathVision
Metrics
Safety ScoreOver-refusal rate
AI summaryContraSafe-VL is a contrastive safety preference dataset for vision-language models (VLMs) that pairs the same textual query with different visual contexts, directly supervising how visual information affects multimodal safety judgments. It also provides response preference pairs based on harmlessness and helpfulness; across three VLM architectures and multiple benchmarks, training improves cross-modal safety recognition and the trade-off between safety and over-refusal, while preserving general multimodal capabilities. The dataset will be made public.

ContraSafe-VL is a contrastive safety preference dataset for vision-language models (VLMs) that pairs the same textual query with different visual contexts, directly supervising how visual information affects multimodal safety judgments. It also provides response preference pairs based on harmlessness and helpfulness; across three VLM architectures and multiple benchmarks, training improves cross-modal safety recognition and the trade-off between safety and over-refusal, while preserving general multimodal capabilities. The dataset will be made public.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Response preference teaches how to answer; ContraSafe-VL uses contrastive visual pairs to supervise how vision changes safety judgments.

    Multimodal safety alignment lacks direct supervision of how the safety judgment of the same text changes with the visual context.

    • Deployment scenario: the authors believe VLMs are being deployed as general-purpose multimodal assistants, and safety depends on how text and visuals jointly express intent; the visual often determines whether a request is safe and how it should be answered.
    • Two failures: one is ignoring safety-relevant visuals, so that a request that is harmless when viewed alone is still treated as safe under a harmful image; the other is treating a sensitive image directly as harmful intent, thereby over-refusing benign requests (Figure 1). The authors believe effective alignment is not simply strengthening attention to visuals.
    • Existing shortcomings: data such as SPA-VL, SafeRLHF-V and Qu et al. 2025 mainly follow the response preference paradigm, teaching models to prefer safer and more helpful responses under a given multimodal query, but rarely characterize whether an image is safety-relevant and how it should affect the interpretation of the text's intent. When the same text requires different safety responses under different visuals, response-level preferences alone are insufficient.
    • The authors' hypothesis: one should learn when visuals affect safety judgment, rather than relying on visuals uniformly. Zhou et al. 2024 and Geng et al. 2025 have used similar contrastive samples for evaluation; the authors state they are rarely used as training supervision.
    • This paper's approach: proposes ContraSafe-VL. It contains 53,101 items, 12 risk categories and 10,115 contrastive visual pairs with identical text and opposite visual and safety labels, and provides harmlessness and helpfulness response preferences. The contrastive pairs supervise how visuals enter safety judgment, and the response preferences supervise generating safe and helpful responses.
  2. What related research exists?

    The authors place the visual effect under fixed text as the gap, and compare it against response preference and counterfactual visual work.

    Multimodal safety alignment

    • Post-training data: RLHF-V (Yu et al. 2024), MM-RLHF (Zhang et al. 2025b), SPA-VL (Zhang et al. 2025a), Safe RLHF-V (Ji et al. 2026) use feedback or preference for multimodal post-training. The authors point out that existing datasets rarely isolate the visual effect under fixed text, and models may still take shortcuts, leading to unsafe responses or over-refusal.
    • Risk and intervention: Liu et al. 2024, Hu et al. 2025, Wang et al. 2025a discuss how vision makes originally safe text queries unsafe. Liu et al. 2025 uses inference-time intervention for context-dependent safety control.
    • Response preference paradigm: The introduction groups SPA-VL, SafeRLHF-V, and Qu et al. 2025 as mainly following the approach of Bai et al. 2022 and Ouyang et al. 2022: given a multimodal query, learn to prefer safer and more helpful responses, with limited supervision of the role of vision in judgment.

    Multimodal preference and counterfactual vision

    • Preference optimization: Rafailov et al. 2023's DPO, as well as Huang et al. 2025, 2026, use preference and rejected responses to align with human judgment. The paper uses DPO as the response-level term.
    • Visual preference: mDPO (Wang et al. 2024a) and S-VCO (Wu et al. 2025b) incorporate visual context into preference optimization. The authors state that they do not explicitly separate how vision changes safety judgment under fixed text.
    • Counterfactual modification: Rao et al. 2021, Abbasnejad et al. 2020, Chen et al. 2020, Lee et al. 2025, Gao et al. 2025, Zhang et al. 2024, Leng et al. 2024, Fu et al. 2025 use visual modification to weaken superficial correlations, for recognition, VQA, or hallucination. The authors state that these works likewise do not separately supervise the change in safety judgment under fixed text.

    Contrastive samples in evaluation

    • Zhou et al. 2024 and Geng et al. 2025's VSCBench uses contrastive or calibration-type samples for evaluation. The authors state that such samples are rarely used as training supervision for multimodal safety.

    Baselines and benchmarks

    • Preference data baselines: RLHF-V, MM-RLHF, SPA-VL, Safe RLHF-V. All continue training from the same ContraSafe-VL SFT initialization; only ContraSafe-VL additionally uses contrastive visual pairs and CoPO.
    • Evaluation benchmarks: safety is MM-SafetyBench, Hades, SPA-VL, JailBreaKV, SafeRLHF-V, VLSBench, VLSU, SIUO; over-refusal is MOSSBench and the VLSU benign subset; general capability is MMStar, RealWorldQA, MathVision.

    The authors position this paper as: using paired visuals with the same text and opposite safety labels to directly supervise the role of vision in multimodal safety judgment, and as complementary to response preference.

  3. How does the paper address this problem?

    Visual pairs with fixed text and opposite safety labels, then trained with DPO plus CoPO together with response preferences.

    ContraSafe-VL first pairs fixed text with visuals whose safety labels are opposite, then pairs all queries with response preferences; during alignment, response-level DPO and visual-conditioned CoPO are added together.

    Data and labels

    • Scale: 53,101 (m, q) items, 28,676 unsafe (54.00%), 24,425 safe (46.00%). Of these, 20,230 form 10,115 contrastive visual pairs; the remaining 32,871 are additional queries, 18,561 unsafe and 14,310 safe. Each has a chosen and a rejected response.
    • Contrastive definition: for text qi, construct an unsafe visual and a safe visual, such that ℓ(mri,qi)=1, ℓ(msi,qi)=0. This expression means the same text has opposite safety labels under the two visuals, with 1 being unsafe.
    • Categories: 12 categories. In Table 1, S1 Violence & Physical Harm has Count 9,791, Total(%) 18.44, Unsafe(%) 34.14; S10 IP & Plagiarism is 103, 0.19, 0.36. Unsafe queries subtotal 28,676.

    Construction of contrastive visual pairs

    • Images: retrieval keywords are generated using safety categories plus HH-RLHF dialogues. Images come from SPA-VL, SafeRLHF-V, DataComp, LLaVA. DataComp uses CLIP for text-to-image retrieval; LLaVA images are used to construct safe queries.
    • Text: the authors state that proprietary models may refuse safety-sensitive generation and editing, so open-weight models are used. Human red-team examples serve as few-shot; each step samples 5 images and 10 red-team examples, and Qwen3-VL-235B selects images and generates candidate text. Queries that are text-only with no explicit risk and become unsafe when combined with the corresponding image are retained, and safe queries whose visual can be edited to introduce risk are generated. Generation and filtering prompts are in the appendix.
    • Bidirectional editing: unsafe to safe, and safe to unsafe. The reason given by the authors is to make edited images appear on both sides of the label boundary, reduce spurious correlation between editing traces and a single label, and increase scene diversity. Qwen3-VL-235B jointly interprets the original image and text, and writes the editing instruction and expected change; instructions inconsistent with the original scene, or unlikely to change the safety label, are discarded. The editing model is Qwen-Image-Edit. After editing, Qwen3-VL-235B checks whether the instruction was followed, whether there are obvious flaws, and whether it is still semantically consistent with the fixed text.
    • Voting: before and after editing, Qwen3.5-397B, Gemma-4-31B, SingGuard-8B evaluate, and majority voting determines the label. Only when the same text has one safe and one unsafe are they retained, yielding 10,115 pairs. The reviewer models, prompts and voting process are in the appendix.

    Additional queries and response preferences

    • Additional queries: using multi-turn dialogues from HH-RLHF and LLaVA as few-shot, queries are generated for the original and edited images, and safe queries consistent with the visual that should receive an appropriate response are added. The same majority voting determines labels.
    • Responses: each of the 53,101 queries samples one response from nine VLMs. The main text does not list the model names, stating that the full list is in the appendix. Qwen3.5-397B performs pairwise annotation of harmlessness and helpfulness, evaluating each pair twice with the order swapped, to reduce position bias. Then two reward models for harmlessness and helpfulness are trained. Training and weight details are in the appendix.
    • Pairing: the two scores are z-scored and then combined, with λ as the harmlessness weight, selected on a held-out validation set. The highest-scoring response is chosen, and a random one among the remaining candidates is rejected. SFT uses chosen as the training target. The Harmless weight in the experimental setup is given a separate value; the main text does not state whether it is the same as λ.

    Alignment objectives

    • DPO: instances are (m, q, y+, y−), increasing the preference for y+ over y− under the same multimodal query. β controls the strength; the main text does not give a value.
    • CoPO: positive sample (y, q, m), negative sample (y, q, m′). y and q are the same, m′ is the contrastive visual of m, and the two have different safety labels. The preference direction is determined by whether the visual is consistent with this fixed chosen response, not by whether the visual itself is safe or unsafe.
    • Combination: the final objective is Lfin=LDPO+LCoPO. That is, both response preferences and contrastive visual pairs are used. The authors state the design is inspired by the visual contrast of mDPO; other optimization frameworks that can use paired visuals can also be used with this data.
  4. What experiments did the paper conduct?

    On three backbones, ContraSafe-VL averages 96.89, 96.93, 96.35 across eight benchmarks, and is not the highest in every column.

    Experimental setup

    • Backbones: full-parameter fine-tuning of Qwen2-VL-7B-Instruct, Qwen3-VL-8B-Instruct, InternVL3.5-8B. Table 2 writes this row as InternVL3.5-8B-Instruct. First SFT with ContraSafe-VL, as the common initialization for each preference optimization.
    • Comparisons: preference data are RLHF-V, MM-RLHF, SPA-VL, Safe RLHF-V, ContraSafe-VL. Only ContraSafe-VL uses contrastive visual pairs through CoPO. Unless otherwise stated, the optimization settings for preference training are the same.
    • Hyperparameters: SFT randomly samples 20K, 1 epoch, learning rate 1×10−5, Harmless weight 0.8. The final objective uses the full data, 1 epoch, learning rate 1×10−6; Harmless weight is 0.8 for Qwen2-VL-7B and InternVL3.5-8B, and 0.9 for Qwen3-VL-8B; an SFT loss with coefficient 0.1 is additionally added. Table 2 is the average of three seeds.
    • Safety benchmarks: MM-SafetyBench, SPA-VL, SafeRLHF-V, Hades, VLSBench, VLSU, JailBreaKV, SIUO, covering explicit risks and cases requiring joint image-text understanding. The authors state that the image-text pairs of SPA-VL and SafeRLHF-V do not overlap with the training data; only 3 SPA-VL test images appear in training, and with different text. The main text does not give the sample size of each benchmark.
    • Metrics and review: SingGuard-8B judges whether a response is harmless, and Safety Score is the proportion judged harmless. Over-refusal is identified by Gemma-4-31B-it identifying refusals, and the rate is the proportion of refusal responses among the evaluated multimodal queries; the subset is the benign queries of MOSSBench and VLSU. General capabilities are MMStar, RealWorldQA, MathVision. The third voting model in the construction stage is written as Gemma-4-31B.
    • Items not stated: the main text does not report β, the names of the nine candidate VLMs, or the agreement between reviewers and humans.

    Main results

    Swipe horizontally to read the table

    ModelBase Avg+RLHF-V+MM-RLHF+ContraSafe-VLVLSBench
    Qwen2-VL-7B-Instruct71.4987.1895.4696.8996.52
    InternVL3.5-8B-Instruct80.8489.3693.9496.9396.39
    Qwen3-VL-8B-Instruct92.0390.2393.0396.3598.26

    According to Table 2, Safety Score, average of three seeds. The first four columns are the eight-benchmark average; the VLSBench column is the ContraSafe-VL row. Preference data not included in the table are described below.

    • The authors state: the average scores of all three backbones are the highest; the gains relative to RLHF-V are written as 9.71, 7.57, 6.12, and relative to MM-RLHF as 1.43, 2.99, 3.32. That sentence does not specify the backbones one by one. In Table 2, Qwen3-VL's SPA-VL average of 95.27 is higher than its MM-RLHF's 93.03; InternVL's Safe RLHF-V average of 96.14 is higher than its MM-RLHF's 93.94.
    • The authors state: the improvement is more prominent on multimodal benchmarks, up to 4.15 higher than the strongest baseline on VLSBench, and state the gains generalize across model families.
    • Not the highest in every column: on InternVL's JailBreaKV, Safe RLHF-V is 87.14 and ContraSafe-VL is 86.07; on Qwen3-VL's JailBreaKV, SPA-VL is 84.29 and ContraSafe-VL is 79.64; on Qwen2-VL's Hades, MM-RLHF is 99.73 and ContraSafe-VL is 99.47. Qwen3-VL's SFT average is 90.52 and +RLHF-V is 90.23, both lower than the base 92.03.

    Over-refusal

    • What was measured: the benign subsets of MOSSBench and VLSU. In Figure 3, the horizontal axis is the average over-refusal rate and the vertical axis is the average Safety Score, with one figure for each of the three backbones; the legend includes Base, SFT, RLHF-V, MM-RLHF, SPA-VL, SafeRLHF-V, ContraSafe-VL. The authors state they compare only when corresponding over-refusal results are available.
    • Results: the main text does not give the values of each point.
    • The authors' interpretation: relative to the base, safety preference optimization may increase over-refusal; ContraSafe-VL has a higher safety score and lower over-refusal, a better trade-off.

    General capabilities

    • What was measured: MMStar, RealWorldQA, MathVision (Table 3).
    • Results: ContraSafe-VL averages are Qwen2-VL 45.96 (base 46.92), InternVL3.5-8B 57.64 (base 56.82), Qwen3-VL-8B 65.72 (base 66.27). InternVL's MathVision is 41.66, base 38.53. On Qwen3-VL's MathVision, MM-RLHF is 44.52, base 55.17; on Qwen2-VL's MathVision, ContraSafe-VL is 17.84, base 19.45.
    • The authors' interpretation: the authors state that the safety-aligned models maintain general multimodal capabilities, and their method does not cause an obvious decline. Among the numbers listed above, the ContraSafe-VL averages of Qwen2-VL and Qwen3-VL are lower than their respective bases.

    Visual sensitivity and categories

    • What was measured: a VLM reviewer scores queries from 1–5, with 1–3 unsafe and 4–5 safe, comparing text-only and image-text (Table 5). The paper does not state which model the reviewer is. Figure 5 shows the Safety Score of six VLSBench categories, the categories being Illegal, Erotic, Hate, Privacy, Self-Harm, Violent; the legend is written as ConstraSafe-VL.
    • Results: SPA-VL goes from 2.788 to 2.952 with images added (Δ +0.164), SafeRLHF-V from 1.964 to 2.170 (Δ +0.206). ContraSafe-VL goes from 3.840 to 4.256 for safe visuals (Δ +0.416), and from 3.840 to 2.510 for risky visuals (Δ −1.330). The Unsafe−Safe of the contrastive pairs is 0.000 for text-only and −1.746 for image-text. The main text of Figure 5 does not give the scores of each category.
    • The authors' interpretation: the authors state that ContraSafe-VL's safety distinction is mainly caused by visuals, rather than only by text; and state it is the highest on all six categories, including privacy and self-harm which have fewer samples, and that the uneven training distribution did not prevent improvement in each category. The scores in the figure cannot be verified from the given text.

    Other ablations and analyses

    • Figure 4 (Qwen2-VL-7B): remove all contrastive visual pairs and L_CoPO, keeping only response preferences for DPO; or keep CoPO but replace the rejected image with a random 20% or 50% crop of the preferred image. The main text has no values for each point. The authors state the full setting has a better trade-off, especially at higher safety levels.
    • Table 4 (the paper does not state the backbone; the full 96.89 is the same as the ContraSafe-VL average of Qwen2-VL-7B-Instruct in Table 2): Safety Score / over-refusal is 1K 87.90 / 4.06, 5K 91.35 / 5.01, 10K 93.21 / 7.02, 20K 95.85 / 8.86, 30K 96.73 / 8.46, 50K 96.40 / 7.21, full 96.89 / 6.26. The authors state the increase from 1K to full is 8.99; 20K to 30K is 0.88, 30K to full is 0.16, and 50K slightly decreases. The authors believe that after 20K the safety gains become smaller, and over-refusal did not rise accordingly.
    • Qwen2-VL's JailBreaKV: base 72.50, SFT 54.29, ContraSafe-VL 85.00. InternVL's same column is base 72.50, SFT 62.86 (Table 2). The paper does not explain why this column is lower than the base in the SFT stage.
  5. What are some points that can be further explored?

    The paper does not write shortcomings and future directions in the limitations or conclusion.

    Limitations and future directions pointed out by the authors

    • The paper does not specifically discuss limitations. The provided main text does not write any item as a shortcoming or future work in Limitations, Discussion, or Future Work; the conclusion only writes the role of contrastive visual pairs, additional preference data, and cross-modal interaction.

    Scope of experimental coverage

    • The backbones that were fine-tuned and reported individually are Qwen2-VL-7B-Instruct, Qwen3-VL-8B-Instruct, InternVL3.5-8B, 3 in total (Experimental Setup, Table 2, Table 3).
    • Safety evaluation is MM-SafetyBench, SPA-VL, SafeRLHF-V, Hades, VLSBench, VLSU, JailBreaKV, SIUO; over-refusal is MOSSBench and the VLSU benign subset; general capability is MMStar, RealWorldQA, MathVision.
    • Table 2's Safety Score is the average of three seeds. The safety reviewer is SingGuard-8B, and the over-refusal reviewer is Gemma-4-31B-it. Preference comparisons are RLHF-V, MM-RLHF, SPA-VL, Safe RLHF-V; only ContraSafe-VL uses CoPO.
    • The ablation is written on Qwen2-VL-7B, comparing removal of visual contrast, as well as 20% and 50% cropping (Figure 4). Figure 5 gives VLSBench's six categories Illegal, Erotic, Hate, Privacy, Self-Harm, Violent.
    • The paper does not report the sample size of each benchmark, β, the names of the nine candidate response models in the main text, and the agreement between reviewers and humans. Table 4 does not specify the backbone; Table 5 does not specify the scoring VLM. The main text of Figure 3, Figure 4, and Figure 5 does not give the values for each point or each category.
  6. Summarize the main content of the paper

    Training three VLMs with contrastive visual pairs plus response preference, the eight-benchmark average is 96.89, 96.93, 96.35.

    ContraSafe-VL is a contrastive preference dataset for VLM safety alignment, where response preference and visual contrast are placed into the same objective during training.

    • Problem to solve: Models may overlook the image that determines safety, and may also refuse answerable requests due to sensitive images. Existing data mostly teach which response is preferred on one multimodal query, and do not directly teach how the safety judgment should change when the same sentence is paired with a different image.
    • Approach: 53,101 queries, 12 risk categories, of which 10,115 pairs have identical text and opposite visual and safety labels. Images come from safety data and general image libraries, undergo bidirectional editing, and labels are then determined by majority vote of three models. Nine VLMs each write one response, and chosen and rejected are selected by harmlessness and helpfulness. DPO compares two responses under the same query; CoPO fixes the response and text and compares two visuals. The final loss is the sum of the two terms.
    • Main results: In Table 2, ContraSafe-VL's eight-benchmark average Safety Score on Qwen2-VL-7B-Instruct, InternVL3.5-8B-Instruct, and Qwen3-VL-8B-Instruct is 96.89, 96.93, and 96.35. The authors state that all three are the highest on the corresponding backbones, and state that the gains relative to RLHF-V are 9.71, 7.57, and 6.12. That sentence does not name the backbone. Exceptions include Qwen3-VL's JailBreaKV: ContraSafe-VL is 79.64, SPA-VL is 84.29; Qwen3-VL's SFT average is 90.52, lower than the base 92.03.
    • Other results: In Table 5, the contrastive pair's image-text Unsafe−Safe is −1.746, and text-only is 0.000. In Table 3, InternVL's ContraSafe-VL average is 57.64, and the base is 56.82; Qwen2-VL is 45.96 versus the base 46.92, and Qwen3-VL is 65.72 versus the base 66.27. The authors state that the over-refusal trade-off is better, and general capabilities are largely maintained.
    • Authors' conclusion: The interaction between text and vision should be explicitly modeled; contrastive visual pairs and more preference data are useful. The abstract writes that the dataset will be publicly released, i.e., the authors plan to release it, and does not write that it has already been released.

Related papers

Show 3 more papers
Read originalarxiv.org