Robustness in Both Domains: CLIP Needs a Robust Text Encoder

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Rocamora, Elias Abad, Schlarmann, Christian, Singh, Naman Deep, Wu, Yongtao, Hein, Matthias, Cevher, Volkan
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866911202147303424
author Rocamora, Elias Abad
Schlarmann, Christian
Singh, Naman Deep
Wu, Yongtao
Hein, Matthias
Cevher, Volkan
author_facet Rocamora, Elias Abad
Schlarmann, Christian
Singh, Naman Deep
Wu, Yongtao
Hein, Matthias
Cevher, Volkan
contents Adversarial input attacks can cause a significant shift of CLIP embeddings. This can affect the downstream robustness of models incorporating CLIP in the pipeline, such as text-to-image generative models or large vision language models. While some efforts have been done towards making the CLIP image encoders robust, the robustness of text encoders remains unexplored. In this work, we cover this gap in the literature. We propose LEAF: an efficient adversarial finetuning method for the text domain, with the ability to scale to large CLIP models. Our models significantly improve the zero-shot adversarial accuracy in the text domain, while maintaining the vision performance provided by robust image encoders. When combined with text-to-image diffusion models, we can improve the generation quality under adversarial noise. In multimodal retrieval tasks, LEAF improves the recall under adversarial noise over standard CLIP models. Finally, we show that robust text encoders facilitate better reconstruction of input text from its embedding via direct optimization. We open-source our code ( https://github.com/LIONS-EPFL/LEAF ) and models ( https://huggingface.co/LEAF-CLIP ).
format Preprint
id arxiv_https___arxiv_org_abs_2506_03355
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Robustness in Both Domains: CLIP Needs a Robust Text Encoder
Rocamora, Elias Abad
Schlarmann, Christian
Singh, Naman Deep
Wu, Yongtao
Hein, Matthias
Cevher, Volkan
Machine Learning
Artificial Intelligence
Computer Vision and Pattern Recognition
Adversarial input attacks can cause a significant shift of CLIP embeddings. This can affect the downstream robustness of models incorporating CLIP in the pipeline, such as text-to-image generative models or large vision language models. While some efforts have been done towards making the CLIP image encoders robust, the robustness of text encoders remains unexplored. In this work, we cover this gap in the literature. We propose LEAF: an efficient adversarial finetuning method for the text domain, with the ability to scale to large CLIP models. Our models significantly improve the zero-shot adversarial accuracy in the text domain, while maintaining the vision performance provided by robust image encoders. When combined with text-to-image diffusion models, we can improve the generation quality under adversarial noise. In multimodal retrieval tasks, LEAF improves the recall under adversarial noise over standard CLIP models. Finally, we show that robust text encoders facilitate better reconstruction of input text from its embedding via direct optimization. We open-source our code ( https://github.com/LIONS-EPFL/LEAF ) and models ( https://huggingface.co/LEAF-CLIP ).
title Robustness in Both Domains: CLIP Needs a Robust Text Encoder
topic Machine Learning
Artificial Intelligence
Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2506.03355