LeakyCLIP: Extracting Training Data from CLIP
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 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. 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. 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. 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.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
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 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. 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), . 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. 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.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
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 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. 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. 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. 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. 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.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
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 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, 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. Extensive experiments validate its
effectiveness, with example results shown in figs. Using LeakyCLIP, we demonstrate that privacy leakage
extends well beyond high-fidelity reconstructions.Where the paper says it
Where the paper says it
Where the paper says it
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 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.Where the paper says it
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 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. 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.Where the paper says it
Where the paper says it
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
-
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. -
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.
-
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 refinementremains highly similar to the image generated in the alignment stage.
-
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.
-
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
- SIDE: Surrogate Conditional Data Extraction from Diffusion Models
- Privacy Leakage on DNNs: A Survey of Model Inversion Attacks and Defenses
- On Memorization in Diffusion Models
- D'ej\`a Vu Memorization in Vision-Language Models
- Challenges and Applications of Large Language Models
- What do we learn from inverting CLIP models?
- Safety at Scale: A Comprehensive Survey of Large Model and Agent Safety
- Towards Deep Learning Models Resistant to Adversarial Attacks
- SDEdit: Guided Image Synthesis and Editing with Stochastic Differential Equations
- GLIDE: Towards Photorealistic Image Generation and Editing with Text-Guided Diffusion Models
- Captured by Captions: On Memorization and its Mitigation in CLIP Models
- Memorization in Self-Supervised Learning Improves Downstream Generalization
- Memorization in deep learning: A survey
- Demystifying CLIP Data
- TwinDiffusion: Enhancing Coherence and Efficiency in Panoramic Image Generation with Diffusion Models
Related papers
- RustMizan: A Compilable, Contamination-Aware Benchmarking Framework for Rust Vulnerabilities
- Introducing the Generative Application Firewall (GAF)
- Opal: Private Memory for Personal AI
- Fuel as Identity: Authenticating Inter-Satellite Laser Links after Total Key Compromise
- Merkle Trees Minimize Verifier Complexity in the ROM
- VulCPE: Context-Aware Cybersecurity Vulnerability Retrieval and Management