{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/spa-vl-a-comprehensive-safety-preference","title":"SPA-VL: A Comprehensive Safety Preference Alignment Dataset for Vision Language Model","arxiv_id":"2406.12030","date":"2024-06-17","proceeding":null,"authors":["Yongting Zhang","Lu Chen","Guodong Zheng","Yifeng Gao","Rui Zheng","Jinlan Fu","Zhenfei Yin","Senjie Jin","Yu Qiao","Xuanjing Huang","Feng Zhao","Tao Gui","Jing Shao"],"abstract":"The emergence of Vision Language Models (VLMs) has brought unprecedented advances in understanding multimodal information. The combination of textual and visual semantics in VLMs is highly complex and diverse, making the safety alignment of these models challenging. Furthermore, due to the limited study on the safety alignment of VLMs, there is a lack of large-scale, high-quality datasets. To address these limitations, we propose a Safety Preference Alignment dataset for Vision Language Models named SPA-VL. In terms of breadth, SPA-VL covers 6 harmfulness domains, 13 categories, and 53 subcategories, and contains 100,788 samples of the quadruple (question, image, chosen response, rejected response). In terms of depth, the responses are collected from 12 open-source (e.g., QwenVL) and closed-source (e.g., Gemini) VLMs to ensure diversity. The construction of preference data is fully automated, and the experimental results indicate that models trained with alignment techniques on the SPA-VL dataset exhibit substantial improvements in harmlessness and helpfulness while maintaining core capabilities. SPA-VL, as a large-scale, high-quality, and diverse dataset, represents a significant milestone in ensuring that VLMs achieve both harmlessness and helpfulness.","url_abs":"https://arxiv.org/abs/2406.12030v4","url_pdf":"https://arxiv.org/pdf/2406.12030v4.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"spa-vl-a-comprehensive-safety-preference","repo_url":"https://github.com/echosechen/spa-vl-rlhf","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"safety-alignment","task_name":"Safety Alignment"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2406.12030","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2406.12030"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/echosechen/spa-vl-rlhf","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":2,"ran":5,"unverified":2},"by_repo_kind":{"official":{"samples":9,"ran":7,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"2154e44a6b59e432","entry":"batch_select","repo":"echosechen/spa-vl-rlhf","repo_kind":"official","path":"models/ppo/reward_model.py","file_url":"https://github.com/echosechen/spa-vl-rlhf/blob/HEAD/models/ppo/reward_model.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":2,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2154e44a6b59e432"}},{"code_sha256_prefix":"a6989412aca721c1","entry":"unpack_dict","repo":"echosechen/spa-vl-rlhf","repo_kind":"official","path":"models/ppo/reward_model.py","file_url":"https://github.com/echosechen/spa-vl-rlhf/blob/HEAD/models/ppo/reward_model.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":2,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a6989412aca721c1"}},{"code_sha256_prefix":"d81457ff8457bb3b","entry":"adjust_queries","repo":"echosechen/spa-vl-rlhf","repo_kind":"official","path":"infer_json.py","file_url":"https://github.com/echosechen/spa-vl-rlhf/blob/HEAD/infer_json.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d81457ff8457bb3b"}},{"code_sha256_prefix":"5aa59c85970b28a7","entry":"all_gather_and_cat","repo":"echosechen/spa-vl-rlhf","repo_kind":"official","path":"all_utils/distributed_utils.py","file_url":"https://github.com/echosechen/spa-vl-rlhf/blob/HEAD/all_utils/distributed_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5aa59c85970b28a7"}},{"code_sha256_prefix":"42596ac916e883a5","entry":"create_scheduler","repo":"echosechen/spa-vl-rlhf","repo_kind":"official","path":"all_utils/trainer_utils.py","file_url":"https://github.com/echosechen/spa-vl-rlhf/blob/HEAD/all_utils/trainer_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"42596ac916e883a5"}},{"code_sha256_prefix":"4098e9c2afde4a5d","entry":"setup","repo":"echosechen/spa-vl-rlhf","repo_kind":"official","path":"all_utils/distributed_utils.py","file_url":"https://github.com/echosechen/spa-vl-rlhf/blob/HEAD/all_utils/distributed_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4098e9c2afde4a5d"}},{"code_sha256_prefix":"6ff9248489766439","entry":"truncate_after_eos_with_padding","repo":"echosechen/spa-vl-rlhf","repo_kind":"official","path":"models/dpo/dpo_trainer.py","file_url":"https://github.com/echosechen/spa-vl-rlhf/blob/HEAD/models/dpo/dpo_trainer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6ff9248489766439"}},{"code_sha256_prefix":"4d9dae8e7537c18a","entry":"custom_gather","repo":"echosechen/spa-vl-rlhf","repo_kind":"official","path":"infer_json.py","file_url":"https://github.com/echosechen/spa-vl-rlhf/blob/HEAD/infer_json.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4d9dae8e7537c18a"}},{"code_sha256_prefix":"ddf566ec4ea0d353","entry":"setup_accelerator","repo":"echosechen/spa-vl-rlhf","repo_kind":"official","path":"all_utils/trainer_utils.py","file_url":"https://github.com/echosechen/spa-vl-rlhf/blob/HEAD/all_utils/trainer_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ddf566ec4ea0d353"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}