{"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/tovilag-your-visual-language-generative-model","title":"ToViLaG: Your Visual-Language Generative Model is Also An Evildoer","arxiv_id":"2312.11523","date":"2023-12-13","proceeding":null,"authors":["Xinpeng Wang","Xiaoyuan Yi","Han Jiang","Shanlin Zhou","Zhihua Wei","Xing Xie"],"abstract":"Warning: this paper includes model outputs showing offensive content. Recent large-scale Visual-Language Generative Models (VLGMs) have achieved unprecedented improvement in multimodal image/text generation. However, these models might also generate toxic content, e.g., offensive text and pornography images, raising significant ethical risks. Despite exhaustive studies on toxic degeneration of language models, this problem remains largely unexplored within the context of visual-language generation. This work delves into the propensity for toxicity generation and susceptibility to toxic data across various VLGMs. For this purpose, we built ToViLaG, a dataset comprising 32K co-toxic/mono-toxic text-image pairs and 1K innocuous but evocative text that tends to stimulate toxicity. Furthermore, we propose WInToRe, a novel toxicity metric tailored to visual-language generation, which theoretically reflects different aspects of toxicity considering both input and output. On such a basis, we benchmarked the toxicity of a diverse spectrum of VLGMs and discovered that some models do more evil than expected while some are more vulnerable to infection, underscoring the necessity of VLGMs detoxification. Therefore, we develop an innovative bottleneck-based detoxification method. Our method could reduce toxicity while maintaining comparable generation quality, providing a promising initial solution to this line of research.","url_abs":"https://arxiv.org/abs/2312.11523v1","url_pdf":"https://arxiv.org/pdf/2312.11523v1.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":"tovilag-your-visual-language-generative-model","repo_url":"https://github.com/victorup/ToViLaG","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"text-generation","task_name":"Text Generation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2312.11523","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2312.11523"}},"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/victorup/ToViLaG","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/borisdayma/dalle-mini","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_fixture":3,"ran":9,"ran_draft_wrong":2,"ran_violates":1,"unverified":3},"by_repo_kind":{"official":{"samples":7,"ran":6,"repositories":1},"found_in_text":{"samples":11,"ran":9,"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":7,"samples":[{"code_sha256_prefix":"78ca1debd9c4ed87","entry":"autocontrast_func","repo":"victorup/ToViLaG","repo_kind":"official","path":"method/BLIP/transform/randaugment.py","file_url":"https://github.com/victorup/ToViLaG/blob/HEAD/method/BLIP/transform/randaugment.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"DEP_MISSING","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"78ca1debd9c4ed87"}},{"code_sha256_prefix":"b46bc8a69ab97b12","entry":"blank_caption_function","repo":"borisdayma/dalle-mini","repo_kind":"found_in_text","path":"src/dalle_mini/data.py","file_url":"https://github.com/borisdayma/dalle-mini/blob/HEAD/src/dalle_mini/data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b46bc8a69ab97b12"}},{"code_sha256_prefix":"aa81d03f07735ab8","entry":"compute_acc","repo":"victorup/ToViLaG","repo_kind":"official","path":"method/BLIP/utils.py","file_url":"https://github.com/victorup/ToViLaG/blob/HEAD/method/BLIP/utils.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"aa81d03f07735ab8"}},{"code_sha256_prefix":"ad12a494674d23fb","entry":"compute_n_params","repo":"victorup/ToViLaG","repo_kind":"official","path":"method/BLIP/utils.py","file_url":"https://github.com/victorup/ToViLaG/blob/HEAD/method/BLIP/utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ad12a494674d23fb"}},{"code_sha256_prefix":"e254827ef156f929","entry":"deepnet_init","repo":"borisdayma/dalle-mini","repo_kind":"found_in_text","path":"src/dalle_mini/model/modeling.py","file_url":"https://github.com/borisdayma/dalle-mini/blob/HEAD/src/dalle_mini/model/modeling.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e254827ef156f929"}},{"code_sha256_prefix":"4c53169f63a1fcef","entry":"equalize_func","repo":"victorup/ToViLaG","repo_kind":"official","path":"method/BLIP/transform/randaugment.py","file_url":"https://github.com/victorup/ToViLaG/blob/HEAD/method/BLIP/transform/randaugment.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"DEP_MISSING","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4c53169f63a1fcef"}},{"code_sha256_prefix":"848d81c889bb92eb","entry":"fix_html","repo":"borisdayma/dalle-mini","repo_kind":"found_in_text","path":"src/dalle_mini/model/text.py","file_url":"https://github.com/borisdayma/dalle-mini/blob/HEAD/src/dalle_mini/model/text.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"848d81c889bb92eb"}},{"code_sha256_prefix":"1dd2ab205689d45b","entry":"identity_func","repo":"victorup/ToViLaG","repo_kind":"official","path":"method/BLIP/transform/randaugment.py","file_url":"https://github.com/victorup/ToViLaG/blob/HEAD/method/BLIP/transform/randaugment.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1dd2ab205689d45b"}},{"code_sha256_prefix":"c6ec173f19f5c34d","entry":"interpolate_pos_embed","repo":"victorup/ToViLaG","repo_kind":"official","path":"method/BLIP/models/vit.py","file_url":"https://github.com/victorup/ToViLaG/blob/HEAD/method/BLIP/models/vit.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c6ec173f19f5c34d"}},{"code_sha256_prefix":"405ba2d3a0e6b5b3","entry":"norm","repo":"borisdayma/dalle-mini","repo_kind":"found_in_text","path":"src/dalle_mini/model/modeling.py","file_url":"https://github.com/borisdayma/dalle-mini/blob/HEAD/src/dalle_mini/model/modeling.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"405ba2d3a0e6b5b3"}},{"code_sha256_prefix":"a2d6ee58be3c306d","entry":"normalize_function","repo":"borisdayma/dalle-mini","repo_kind":"found_in_text","path":"src/dalle_mini/data.py","file_url":"https://github.com/borisdayma/dalle-mini/blob/HEAD/src/dalle_mini/data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a2d6ee58be3c306d"}},{"code_sha256_prefix":"745c9aa603dc8439","entry":"replace_person_token","repo":"borisdayma/dalle-mini","repo_kind":"found_in_text","path":"src/dalle_mini/model/text.py","file_url":"https://github.com/borisdayma/dalle-mini/blob/HEAD/src/dalle_mini/model/text.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"745c9aa603dc8439"}},{"code_sha256_prefix":"8af7dc10bc707987","entry":"replace_punctuation_with_commas","repo":"borisdayma/dalle-mini","repo_kind":"found_in_text","path":"src/dalle_mini/model/text.py","file_url":"https://github.com/borisdayma/dalle-mini/blob/HEAD/src/dalle_mini/model/text.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8af7dc10bc707987"}},{"code_sha256_prefix":"45e195f64c082f0e","entry":"shift_tokens_right","repo":"borisdayma/dalle-mini","repo_kind":"found_in_text","path":"src/dalle_mini/data.py","file_url":"https://github.com/borisdayma/dalle-mini/blob/HEAD/src/dalle_mini/data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"45e195f64c082f0e"}},{"code_sha256_prefix":"9914ba32442bd58d","entry":"smelu","repo":"borisdayma/dalle-mini","repo_kind":"found_in_text","path":"src/dalle_mini/model/modeling.py","file_url":"https://github.com/borisdayma/dalle-mini/blob/HEAD/src/dalle_mini/model/modeling.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9914ba32442bd58d"}},{"code_sha256_prefix":"daa6e468bb6841f2","entry":"detect","repo":"victorup/ToViLaG","repo_kind":"official","path":"metrics/toxicity/inference_imgclf.py","file_url":"https://github.com/victorup/ToViLaG/blob/HEAD/metrics/toxicity/inference_imgclf.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"daa6e468bb6841f2"}},{"code_sha256_prefix":"6189300424354113","entry":"get_images_from_backend","repo":"borisdayma/dalle-mini","repo_kind":"found_in_text","path":"app/gradio/backend.py","file_url":"https://github.com/borisdayma/dalle-mini/blob/HEAD/app/gradio/backend.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6189300424354113"}},{"code_sha256_prefix":"7d648505413976ce","entry":"get_model_version","repo":"borisdayma/dalle-mini","repo_kind":"found_in_text","path":"app/gradio/backend.py","file_url":"https://github.com/borisdayma/dalle-mini/blob/HEAD/app/gradio/backend.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7d648505413976ce"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}