Safe-CLIP: Removing NSFW Concepts from Vision-and-Language Models
Not on the map. Why?
Abstract (arXiv)
Large-scale vision-and-language models, such as CLIP, are typically trained on web-scale data, which can introduce inappropriate content and lead to the development of unsafe and biased behavior. This, in turn, hampers their applicability in sensitive and trustworthy contexts and could raise significant concerns in their adoption. Our research introduces a novel approach to enhancing the safety of vision-and-language models by diminishing their sensitivity to NSFW (not safe for work) inputs. In particular, our methodology seeks to sever "toxic" linguistic and visual concepts, unlearning the linkage between unsafe linguistic or visual items and unsafe regions of the embedding space. We show how this can be done by fine-tuning a CLIP model on synthetic data obtained from a large language model trained to convert between safe and unsafe sentences, and a text-to-image generator. We conduct extensive experiments on the resulting embedding space for cross-modal retrieval, text-to-image, and image-to-text generation, where we show that our model can be remarkably employed with pre-trained generative models. Our source code and trained models are available at: https://github.com/aimagelab/safe-clip.
Key facts. Cited by 12 papers in the map (data through 14 Oct 2026). Builds on 47 of its 63 references that are in the map. First posted on arXiv 27 Nov 2023.
Builds on
47 of 63 references.
References · 47
- 2014Adam: A Method for Stochastic Optimizationcited by 37,240
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
- 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,863
- 2014Microsoft COCO: Common Objects in Contextcited by 17,608
- 2022Training language models to follow instructions with human feedbackcited by 15,971
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,626
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 8,065
- 2023Visual Instruction Tuningcited by 7,869
- 2018Representation Learning with Contrastive Predictive Codingcited by 7,777
35 more
- 2023Improved Baselines with Visual Instruction Tuningcited by 4,418
- 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,307
- 2022LAION-5B: An open large-scale dataset for training next generation image-text modelscited by 4,152
- 2017Deep reinforcement learning from human preferencescited by 3,912
- 2021GLIDE: Towards Photorealistic Image Generation and Editing with Text-Guided Diffusion Modelscited by 3,614
- 2023QLoRA: Efficient Finetuning of Quantized LLMscited by 3,418
- 2022Self-Instruct: Aligning Language Models with Self-Generated Instructionscited by 2,724
- 2023Evaluating Object Hallucination in Large Vision-Language Modelscited by 1,729
- 2023MME: A Comprehensive Evaluation Benchmark for Multimodal Large Language Modelscited by 1,652
- 2021LAION-400M: Open Dataset of CLIP-Filtered 400 Million Image-Text Pairscited by 1,555
- 2023LIMA: Less Is More for Alignmentcited by 1,100
- 2014Deep Visual-Semantic Alignments for Generating Image Descriptionscited by 968
- 2016A Diagram Is Worth A Dozen Imagescited by 804
- 2023LLaMA-Adapter: Efficient Fine-tuning of Language Models with Zero-init Attentioncited by 781
- 2023DataComp: In search of the next generation of multimodal datasetscited by 644
- 2019Eternal Sunshine of the Spotless Net: Selective Forgetting in Deep Networkscited by 618
- 2023LLaMA-Adapter V2: Parameter-Efficient Visual Instruction Modelcited by 602
- 2023Erasing Concepts from Diffusion Modelscited by 539
- 2022Safe Latent Diffusion: Mitigating Inappropriate Degeneration in Diffusion Modelscited by 513
- 2023Zephyr: Direct Distillation of LM Alignmentcited by 506
- 2019Making AI Forget You: Data Deletion in Machine Learningcited by 465
- 2022A Holistic Approach to Undesired Content Detection in the Real Worldcited by 356
- 2021Multimodal datasets: misogyny, pornography, and malignant stereotypescited by 327
- 2021How Much Can CLIP Benefit Vision-and-Language Tasks?cited by 321
- 2021ActionCLIP: A New Paradigm for Video Action Recognitioncited by 320
- 2023Ablating Concepts in Text-to-Image Diffusion Modelscited by 317
- 2023Forget-Me-Not: Learning to Forget in Text-to-Image Diffusion Modelscited by 301
- 2020Large image datasets: A pyrrhic win for computer vision?cited by 237
- 2022Fine-tuning language models to find agreement among humans with diverse preferencescited by 189
- 2022Can Machines Help Us Answering Question 16 in Datasheets, and In Turn Reflecting on Inappropriate Content?cited by 155
- 2022Disentangling visual and written concepts in CLIPcited by 58
- 2022Mixed Differential Privacy in Computer Visioncited by 54
- 2023Improving Large Language Model Fine-tuning for Solving Math Problemscited by 49
- 2023Linear Spaces of Meanings: Compositional Structures in Vision-Language Modelscited by 48
- 2023Multi-Class Unlearning for Image Classification via Weight Filteringcited by 4
Built on by
Citing papers per year: 2023: 1; 2024: 7; 2025: 3; 2026: 1.
12 papers.
- 2024The Revolution of Multimodal Large Language Models: A Surveycited by 137
- 2024Latent Guard: a Safety Framework for Text-to-image Generationcited by 71
- 2024The Stronger the Diffusion Model, the Easier the Backdoor: Data Poisoning to Induce Copyright Breaches Without Adjusting Finetuning Pipelinecited by 33
- 2024AlignGuard: Scalable Safety Alignment for Text-to-Image Generationcited by 20
- 2024Is Retain Set All You Need in Machine Unlearning? Restoring Performance of Unlearned Models with Out-Of-Distribution Imagescited by 18
- 2025Survey of Video Diffusion Models: Foundations, Implementations, and Applicationscited by 14
- 2023DUCK: Distance-based Unlearning via Centroid Kinematicscited by 13
- 2024SteerDiff: Steering towards Safe Text-to-Image Diffusion Modelscited by 10
- 2025A Comprehensive Survey on Concept Erasure in Text-to-Image Diffusion Modelscited by 9
- 2025CRCE: Coreference-Retention Concept Erasure in Text-to-Image Diffusion Modelscited by 6
- 2024Safety Without Semantic Disruptions: Editing-free Safe Image Generation via Context-preserving Dual Latent Reconstructioncited by 1
- 2026Harmful Content Generation in Text-to-Image Models: Capabilities and Moderation Limitationscited by 0
- 2026Harmful Content Generation in Text-to-Image Models: Capabilities and Moderation Limitations5 Oct 2026
- 2025Survey of Video Diffusion Models: Foundations, Implementations, and Applications22 Apr 2025
- 2025CRCE: Coreference-Retention Concept Erasure in Text-to-Image Diffusion Models18 Mar 2025
- 2025A Comprehensive Survey on Concept Erasure in Text-to-Image Diffusion Models17 Feb 2025
- 2024AlignGuard: Scalable Safety Alignment for Text-to-Image Generation13 Dec 2024
- 2024Safety Without Semantic Disruptions: Editing-free Safe Image Generation via Context-preserving Dual Latent Reconstruction21 Nov 2024
- 2024SteerDiff: Steering towards Safe Text-to-Image Diffusion Models3 Oct 2024
- 2024Is Retain Set All You Need in Machine Unlearning? Restoring Performance of Unlearned Models with Out-Of-Distribution Images19 Apr 2024
- 2024Latent Guard: a Safety Framework for Text-to-image Generation11 Apr 2024
- 2024The Revolution of Multimodal Large Language Models: A Survey19 Feb 2024
- 2024The Stronger the Diffusion Model, the Easier the Backdoor: Data Poisoning to Induce Copyright Breaches Without Adjusting Finetuning Pipeline7 Jan 2024
- 2023DUCK: Distance-based Unlearning via Centroid Kinematics4 Dec 2023
Similar, not cited
Close in wording, no citation either way
- 2025SafeR-CLIP: Mitigating NSFW Content in Vision-Language Models While Preserving Pre-Trained Knowledge
- 2025PromptGuard: Soft Prompt-Guided Unsafe Content Moderation for Text-to-Image Models
- 2025Hyperbolic Safety-Aware Vision-Language Models
- 2025Beautiful Images, Toxic Words: Understanding and Addressing Offensive Text in Generated Images
- 2024SafeGen: Mitigating Sexually Explicit Content Generation in Text-to-Image Models
- 2025Bridging the Gap in Vision Language Models in Identifying Unsafe Concepts Across Modalities
- 2026ShieldCLIP: Selective Safety Alignment for Harmful Content Mitigation in Multimodal Foundation Models
- 2025Training-Free Safe Text Embedding Guidance for Text-to-Image Diffusion Models