LeakyCLIP: Extracting Training Data from CLIP

arXiv:2508.00756 · cs.CR · Submitted 2025-08-01 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: Security Radio. Generated commentary on the latest security and cryptography papers.

Nadia: I'm Nadia.

Elias: And I'm Elias, here with Priya.

Nadia: We're looking at the paper: "LeakyCLIP: Extracting Training Data from CLIP".

Title and authors: Nadia: So we're talking about this paper called LeakyCLIP: Extracting Training Data from CLIP. It sounds pretty straightforward, but what does that mean for us when we're working with these multimodal models?

Elias: It means they’ve designed a framework to pull sensitive training data out of the CLIP model by trying to reconstruct the original image from just the text prompt. The authors are focused on the risks of memorization and privacy leakage in these systems.

Priya: What I find interesting is that they aren't just looking at perfect reconstructions, but they’re looking at how well we can infer if an image was even in the training set, even from a low-quality picture.

Nadia: Exactly. They identified three main hurdles in CLIP inversion: first, the features themselves aren't robust enough to be reliably used; second, the text embeddings don't capture enough visual detail; and third, they lack those necessary low-level features when you try to reconstruct the image.

Elias: To tackle that first problem of non-robust features, they use adversarial fine-tuning. They adversarially fine-tune the image encoder, which they call fI, using a duplicated image encoder called forg whose parameters are frozen during this part three <ref:2508.00756#pg1>.

Nadia: So what's the practical effect of that for someone trying to exploit this? It’s about making the inversion process much smoother so you don't get stuck in noisy optimization landscapes.

Priya: Smoother, sure. But then they move to the second challenge, which is limited visual semantics in text embeddings. They solve that by introducing an embedding space alignment technique that learns a linear transformation matrix M one <ref:2508.00756#pg1>.

Elias: That matrix M maps the text embedding UT to a pseudo-image embedding UT M, which they claim helps align the text and image representations better in practice, leading to higher quality reconstructions.

The paper's summary: Nadia: So, putting that together, LeakyCLIP is a three-stage attack framework for extracting training data from CLIP models. It starts with adversarial fine-tuning to smooth things out, then embedding alignment to get a better mapping between text and image embeddings, and finally diffusion refinement to polish the output.

Elias: The final step involves using Stable Diffusion to refine the reconstructed images by adding noise and running a reverse diffusion process three <ref:2508.00756#pg1>. They say this forces the model only to add low-level details like textures and sharp edges, without leaking sensitive content into that final reconstruction.

Priya: What I’m thinking is that this whole process isn't just about getting a high-fidelity picture. The paper shows that privacy leakage extends way beyond those high-fidelity results.

Nadia: Right? Even for low-quality reconstructions, the evaluation metrics can still reliably tell you whether an image was in the training set, which suggests a much more pervasive threat than just looking at perfect images.

Elias: That’s a crucial finding because it means we don't have to wait for perfect outputs to worry about leakage; poor results are still informative.

Priya: It really shifts the focus from just checking the final image quality to understanding the metrics themselves, which is what I spend most of my time looking at before I trust any claimed result.

The paper's improvements: Nadia: So, when we look at what they actually achieved empirically, they’re showing pretty strong results for ViT-B-sixteen. They claim over a two fifty eight percent improvement in the Structural Similarity Index Measure, or SSIM, compared to baseline methods on the LAION-2B subset one <ref:2508.00756#pg1>.

Elias: That improvement is significant because it shows their method gets reconstructions that are highly similar to the originals. And step three, using diffusion refinement, ensures that this refined image remains highly similar to the image generated in the alignment stage two <ref:2508.00756#pg1>.

Priya: I’m curious about how robust those results are. They claim this system can reliably infer training data membership even from poor reconstructions, which is a big claim given how much detail they are trying to extract.

Nadia: That's what makes it concerning for deployment scenarios, especially when we think about enterprise data or user uploads where these models get adapted further two <ref:2508.00756#pg1>. The paper notes that these risks become more consequential in those fine-tuning stages.

Elias: Theoretically, the analysis characterizes how the properties of both the image encoder and the caption length jointly influence whether an inversion is possible one <ref:2508.00756#pg1>. They prove that reconstruction quality depends on both a quantity called M, which is related to the upper Lipschitz constant, and a quantity called m, which is related to the lower Lipschitz constant.

Conclusion: Nadia: So, wrapping up this discussion on LeakyCLIP: it’s introduced as an effective attack for extracting training data from CLIP models using that three-part adversarial fine-tuning, embedding alignment, and diffusion refinement pipeline.

Elias: The core implication is that data leakage is a practical and widespread vulnerability in CLIP systems. They show that privacy leakage extends well beyond high-fidelity reconstructions two <ref:2508.00756#pg1>.

Priya: It highlights the need for more robust defenses in both the training and deployment of these models because this method shows data leakage can be inferred even from poor reconstructions.

Nadia: So, we’re looking at a system that can reliably infer training data membership even from low-quality reconstructions. The paper confirms this is a practical threat that demands urgent attention for those using CLIP models.

Elias: To summarize, LeakyCLIP provides a novel and effective attack for extracting training data from CLIP models one <ref:2508.00756#pg1,extracting training data from CLIP>. It shows how easily sensitive information can be extracted through this inversion process.

Fudan University · Chinese Academy of Sciences

cs.CR

Submitted: 2025-08-01

Updated: 2026-11-25

License: http://creativecommons.org/licenses/by-nc-sa/4.0/

Importance score: 74/100

The gist: Understanding the memorization and privacy leakage risks in Contrastive Language–Image Pretraining (CLIP) is critical for ensuring the security of multimodal models.<ref:2508.00756#pg1…

Key concepts

Adversarial Fine-tuning (AFT)
This stage uses adversarial fine-tuning to smooth the optimization landscape of CLIP's image encoder. By forcing perturbed feature vectors to remain close to original features, it creates a more robust and stable feature space, which significantly reduces gradient noise during the inversion process.
Linear Transformation Based Embedding Alignment (EA)
This technique involves learning a linear matrix M that maps text embeddings into pseudo-image embeddings. This alignment learns how to project the robust text features into a space that better approximates true image representations, improving semantic matching between what is described in the text and the visual content.
Stable Diffusion Based Refinement (DR)
This final stage uses Stable Diffusion to refine initial reconstructions. It applies a reverse diffusion process using Gaussian noise to polish the images. This step enhances local visual fidelity while ensuring the final output remains highly similar to the image generated during the alignment phase.

Terminology

Summary

Understanding the memorization and privacy leakage risks in Contrastive Language–Image Pretraining (CLIP) is critical for ensuring the security of multimodal models. p. 0

Where the paper says it

1 LeakyCLIP: Extracting Training Data from CLIP Yunhao Chen† , Shujie Wang† , Xin Wang, Ran He, Xingjun Ma ∗ , and Yu-Gang Jiang ∗ Abstract—Understanding the memorization and privacy leakage risks in Contrastive Language–Image Pretraining (CLIP) is critical for ensuring the security of multimodal models. Recent studies have demonstrated the feasibility of extracting sensitive training examples from diffusion models, with conditional diffusion models exhibiting a stronger tendency to memorize and leak information.

<ref:2508.00756#pg1, Understanding the memorization and privacy leakage risks in Contrastive Language–Image Pretraining (CLIP) is critical for ensuring the security of multimodal models>. p. 0
Where the paper says it

1 LeakyCLIP: Extracting Training Data from CLIP Yunhao Chen† , Shujie Wang† , Xin Wang, Ran He, Xingjun Ma ∗ , and Yu-Gang Jiang ∗ Abstract—Understanding the memorization and privacy leakage risks in Contrastive Language–Image Pretraining (CLIP) is critical for ensuring the security of multimodal models. Recent studies have demonstrated the feasibility of extracting sensitive training examples from diffusion models, with conditional diffusion models exhibiting a stronger tendency to memorize and leak information.

This work introduces LeakyCLIP, a novel attack framework designed to achieve high-quality, semantically accurate image reconstruction from CLIP embeddings. p. 0
Where the paper says it

In this work, we investigate data memorization and extraction risks in CLIP through the lens of CLIP inversion, a process that aims to reconstruct training images from text prompts. To this end, we introduce LeakyCLIP, a novel attack framework designed to achieve high-quality, semantically accurate image reconstruction from CLIP embeddings.

<ref:2508.00756#pg1, To this end, we introduce LeakyCLIP, a novel attack framework designed to achieve high-quality, semantically accurate image reconstruction from CLIP embeddings>. p. 0
Where the paper says it

In this work, we investigate data memorization and extraction risks in CLIP through the lens of CLIP inversion, a process that aims to reconstruct training images from text prompts. To this end, we introduce LeakyCLIP, a novel attack framework designed to achieve high-quality, semantically accurate image reconstruction from CLIP embeddings.

The Core Attack Framework

LeakyCLIP is introduced as a novel data extraction attack for CLIP models that enables reconstructed images to achieve high fidelity.<ref:2508.00756#pg1, In this paper, we propose LeakyCLIP, a novel data extraction attack for CLIP models that enables reconstructed images to achieve high fidelity>. p. 0

Where the paper says it

In this paper, we formalize CLIP inversion as a task to reconstruct an image conditioned on its paired text prompt from the training data. In this paper, we propose LeakyCLIP, a novel data extraction attack for CLIP models that enables reconstructed images to achieve high fidelity.

The framework operates in three stages: Adversarial Fine-tuning (AFT), Linear Transformation Based Embedding Alignment (EA), and Stable Diffusion Based Refinement (DR). p. 4
Where the paper says it

2) operates in three stages: (1) Adversarial Fine-tuning: Adversarially fine-tune CLIP’s image encoder forg via FARE [40] to smooth gradients; (2) Linear Transformation Based Embedding Alignment: Map text embeddings uT to pseudo-image embeddings uTM using a learned linear matrix M (Theorem 2); (3) Stable Diffusion Based Refinement: Reconstruct images using gradient descent on fF T , then refine with Stable Diffusion [39] to improve fidelity. Overall, this pipeline combines gradient-based inversion with Algorithm 1 LeakyCLIP Training Data Extraction Require: Text prompt t Require: CLIP encoders (forg, fI , fT ) Require: Auxiliary set Daux = {(xi, ti)} n i=1 Require: Diffusion model pθ Require: Hyperparameters ϵ, λ, η, K, T, τ Ensure: Reconstructed image xˆ0 Stage 1: Adversarial fine-tuning 1: for each minibatch {xi} B i=1 ⊂ Daux do // Frozen target embeddings 2: u org i ← forg(xi) // Adversarial perturbation 3: δ ⋆ i = arg max∥δ∥∞≤ϵ ∥fI (xi + δ) − u org i ∥ 2 2 4: zi ← xi + δ ⋆ i // AFT objective 5: LAFT = PB i=1 ∥fI (zi) − u org i ∥ 2 2 6: fI ← fI − η∇fI LAFT 7: end for 8: fFT ← fI Stage 2: Embedding alignment // Auxiliary embedding matrices 9: UT ← [fT (t1), .

<ref:2508.00756#pg3, LeakyCLIP (fig. p. 4
Where the paper says it

10 further show that this constrained process (DR) mainly sharpens textures and reduces artifacts, while successfully preserving the global semantics produced by AFT+EA. Complete Procedure LeakyCLIP (fig.

2) operates in three stages: (1) Adversarial Fine-tuning: Adversarially fine-tune CLIP’s image encoder forg via FARE [40] to smooth gradients; (2) Linear Transformation Based Embedding Alignment: Map text embeddings uT to pseudo-image embeddings uTM using a learned linear matrix M (Theorem 2); and (3) Stable Diffusion Based Refinement: Reconstruct images using gradient descent on fF T, then refine with Stable Diffusion [39] to improve fidelity>. p. 4
Where the paper says it

Complete Procedure LeakyCLIP (fig. 2) operates in three stages: (1) Adversarial Fine-tuning: Adversarially fine-tune CLIP’s image encoder forg via FARE [40] to smooth gradients; (2) Linear Transformation Based Embedding Alignment: Map text embeddings uT to pseudo-image embeddings uTM using a learned linear matrix M (Theorem 2); (3) Stable Diffusion Based Refinement: Reconstruct images using gradient descent on fF T , then refine with Stable Diffusion [39] to improve fidelity.

Addressing Inversion Challenges

The paper identifies three key challenges in CLIP inversion: non-robust features, limited visual semantics in text embeddings, and lack of low-level features in reconstructions.<ref:2508.00756#pg1, We identify three key challenges in CLIP inversion: 1) non-robust features, 2) limited visual semantics in text embeddings, and 3) lack of low-level features in reconstructions>. p. 0

Where the paper says it

To this end, we introduce LeakyCLIP, a novel attack framework designed to achieve high-quality, semantically accurate image reconstruction from CLIP embeddings. We identify three key challenges in CLIP inversion: 1) non-robust features, 2) limited visual semantics in text embeddings, and 3) lack of low-level features in reconstructions.

To address the first challenge, adversarial fine-tuning (AFT) is employed to enhance optimization smoothness. p. 0
Where the paper says it

We identify three key challenges in CLIP inversion: 1) non-robust features, 2) limited visual semantics in text embeddings, and 3) lack of low-level features in reconstructions. To address these challenges, LeakyCLIP employs 1) adversarial fine-tuning to enhance optimization smoothness, 2) linear transformation-based embedding alignment, and 3) controlled Stable Diffusion-based refinement to improve fidelity.

<ref:2508.00756#pg1, To solve this problem, we first employ adversarial fine-tuning, which stabilizes the inversion process and creates a robust feature space for building the image>. p. 0
Where the paper says it

This leads to an unstable optimization process that distorts gradients and makes it hard to achieve good perceptual alignment. To solve this problem, we first employ adversarial fine-tuning, which stabilizes the inversion process and creates a robust feature space for building the image.

The second challenge is addressed by introducing an embedding space alignment technique involving a linear transformation to map text embeddings to pseudo-image embeddings. p. 0
Where the paper says it

While effective at capturing abstract concepts, they lack the high-level visual information required to produce coherent images, such as object layout and scale. To address this, we introduce an embedding space alignment technique by learning a linear transformation between CLIP’s image and text embeddings, projecting the robust text features into pseudo-image embeddings that better approximate true image representations.

<ref:2508.00756#pg1, To address this, we introduce an embedding space alignment technique by learning a linear transformation between CLIP’s image and text embeddings, projecting the robust text features into pseudo-image embeddings that better approximate true image representations>. p. 0
Where the paper says it

While effective at capturing abstract concepts, they lack the high-level visual information required to produce coherent images, such as object layout and scale. To address this, we introduce an embedding space alignment technique by learning a linear transformation between CLIP’s image and text embeddings, projecting the robust text features into pseudo-image embeddings that better approximate true image representations.

Performance and Pervasive Risk

Empirical results demonstrate the superiority of LeakyCLIP, achieving over 258% improvement in Structural Similarity Index Measure (SSIM) for ViT-B-16 compared to baseline methods on LAION-2B subset.<ref:2508.00756#pg1, Empirical results demonstrate the superiority of LeakyCLIP, achieving over 258% improvement in Structural Similarity Index Measure (SSIM) for ViT-B-16 compared to baseline methods on LAION-2B subset>. p. 0

Where the paper says it

To address these challenges, LeakyCLIP employs 1) adversarial fine-tuning to enhance optimization smoothness, 2) linear transformation-based embedding alignment, and 3) controlled Stable Diffusion-based refinement to improve fidelity. Empirical results demonstrate the superiority of LeakyCLIP, achieving over 258% improvement in Structural Similarity Index Measure (SSIM) for ViT-B-16 compared to baseline methods on LAION-2B subset.

Furthermore, the work uncovers a pervasive leakage risk, showing that training data membership can even be successfully inferred from the metrics of low-fidelity reconstructions. p. 0
Where the paper says it

Furthermore, we uncover a pervasive leakage risk, showing that training data membership can even be successfully inferred from the metrics of low-fidelity reconstructions. Our work introduces a practical method for CLIP inversion while offering novel insights into the nature and scope of privacy risks in multimodal models.

<ref:2508.00756#pg2, Using LeakyCLIP, we demonstrate that privacy leakage extends well beyond high-fidelity reconstructions>. p. 1
Where the paper says it

Extensive experiments validate its effectiveness, with example results shown in figs. Using LeakyCLIP, we demonstrate that privacy leakage extends well beyond high-fidelity reconstructions.

Theoretical Foundations and Validation

The theoretical analysis characterizes how properties of the (idealized) encoder and caption length jointly influence the invertibility of the mapping.<ref:2508.00756#pg1>. The proof for Theorem 1 shows that reconstruction quality depends on both the upper Lipschitz constant M and lower Lipschitz constant m, with a bound of W22(p, pˆ) ≤ 4dσ2M2m2. p. 9

Where the paper says it

10 by the Lipschitz condition number of the image encoder: W2 2 (p, pˆ) ≤ 4dσ2 M m 2 , (10) where M is the upper Lipschitz constant and m is the lower Lipschitz constant. This bound suggests that inversion quality depends not only on encoder smoothness, but also on whether the ratio M/m remains small.

<ref:2508.00756#pg1>.

Conclusion on Privacy

In conclusion, this paper introduces LeakyCLIP, a novel and effective attack for extracting training data from CLIP models.<ref:2508.00756#pg1, In conclusion, this paper introduces LeakyCLIP, a novel and effective attack for extracting training data from CLIP models>. p. 0

Where the paper says it

In this paper, we formalize CLIP inversion as a task to reconstruct an image conditioned on its paired text prompt from the training data. In this paper, we propose LeakyCLIP, a novel data extraction attack for CLIP models that enables reconstructed images to achieve high fidelity.

Our findings confirm that data leakage is a practical and widespread vulnerability in CLIP, highlighting the urgent need for more robust defenses in the training and deployment of CLIP models. p. 0
Where the paper says it

Given CLIP’s widespread adoption in downstream tasks, we investigate whether this cross-modal conditioning similarly facilitates—or potentially amplifies—training data extraction. Beyond its practical implications, such an investigation also deepens our understanding of memorization in CLIP models, shedding light on their privacy risks.

<ref:2508.00756#pg1>.

Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.

Improvements for AI systems

  1. Adversarial fine-tuning smooths optimization landscapes by enforcing that the perturbed feature vectors fI (z) to be closed to the original encoder features forg(x), leading to a smoother image encoder. This stabilization improves inversion results by reducing gradient noise.

  2. Embedding alignment learns a linear mapping between CLIP's text and image embeddings using a learned surrogate matrix M, which improves semantic alignment between text and image embeddings in practice, leading to higher-quality reconstructions.

  3. Diffusion-based refinement adds a post-processing step that refines the reconstructed images by perturbing them with Gaussian noise and applying a reverse diffusion process using Stable Diffusion, thereby improving local visual fidelity while ensuring the refinement remains highly similar to the image generated in the alignment stage.

  4. The improved system can achieve over 258% improvement in Structural Similarity Index Measure (SSIM) for ViT-B-16 compared to baseline methods on LAION-2B subset, leading to reconstructions that are highly similar to the originals.

  5. The system can reliably infer training data membership even from poor reconstructions, as the evaluation metrics from even poor reconstructions can still be used to infer training data membership successfully.

Abstract

Understanding the memorization and privacy leakage risks in Contrastive Language--Image Pretraining (CLIP) is critical for ensuring the security of multimodal models. Recent studies have demonstrated the feasibility of extracting sensitive training examples from diffusion models, with conditional diffusion models exhibiting a stronger tendency to memorize and leak information. In this work, we investigate data memorization and extraction risks in CLIP through the lens of CLIP inversion, a process that aims to reconstruct training images from text prompts. To this end, we introduce LeakyCLIP, a novel attack framework designed to achieve high-quality, semantically accurate image reconstruction from CLIP embeddings. We identify three key challenges in CLIP inversion: 1) non-robust features, 2) limited visual semantics in text embeddings, and 3) low reconstruction fidelity. To address these challenges, LeakyCLIP employs 1) adversarial fine-tuning to enhance optimization smoothness, 2) linear transformation-based embedding alignment, and 3) Stable Diffusion-based refinement to improve fidelity. Empirical results demonstrate the superiority of LeakyCLIP, achieving over 258% improvement in Structural Similarity Index Measure (SSIM) for ViT-B-16 compared to baseline methods on LAION-2B subset. Furthermore, we uncover a pervasive leakage risk, showing that training data membership can even be successfully inferred from the metrics of low-fidelity reconstructions. Our work introduces a practical method for CLIP inversion while offering novel insights into the nature and scope of privacy risks in multimodal models. The code is in the https://github.com/dongdongunique/LeakyCLIP

Sources

Related papers