- The paper introduces contrastive privacy, a formal semantic framework that tests AI sanitization by comparing sanitized outputs with related proxy examples rather than relying on manual labels or unreliable model judgments.
- The method uses embedding-based distance measures and approximate nearest-neighbor search to provide scalable privacy evaluation, with resolution controlling the tradeoff between sensitivity and achievable privacy.
- Experiments across 34 image-model combinations and 15 text models show that no frontier system achieves ideal privacy, while the framework identifies semantic failures and reveals that model size does not reliably predict sanitization quality.
Motivation and problem statement
AI-based semantic sanitization mechanisms (SSMs) — privacy mechanisms that remove natural-language-specified concepts such as "faces," "logos," or "brand names" from images and text — are increasingly deployed in place of formal techniques like differential privacy (DP), which are rarely used in practice for unstructured data. The authors observe that evaluation of these mechanisms has been bespoke: existing measures either require error-prone hand-labeling of ground truth or rely on ad hoc collections of anomaly detectors. LLM/VLM-based judgment is also unreliable: the paper demonstrates that Gemini 3 Pro, given the same sanitized image of Leonardo DiCaprio and John Kerry, concludes under one prompt that DiCaprio can be identified and under a slightly different prompt that he cannot, and when asked to identify the people outright names them as Nigel Farage and Tucker Carlson. This motivates a quantitative, automated, model-agnostic privacy test with a semantic interpretation.
The paper grounds its definition in Contextual Integrity but argues that a single rendering may capture many information flows, so a comprehensive measure must consider all of them simultaneously. Renderings x∈X capture properties from P; concepts are collections of properties, partitioned into natural instances (efficiently enumerable) and abstract instances (not efficiently enumerable). The threat model targets an abstract instance e (e.g., "anything identifying papa smurf") via sanitization of computable natural concepts c.
The core machinery is:
- Distance mechanism D: symmetric, positive, with D(x,x)=0, capturing semantic similarity.
- Semantic connectedness: concepts c and d are connected if removing either one from a rendering increases its distance to renderings containing the other by more than resolution parameter δ. The semantic closure cl(X,D,c) collects all properties so connected to P0.
- Contrastive privacy: mechanism P1 offers contrastive privacy with respect to abstract concept P2 at resolution P3 if, for all P4 capturing P5,
P6
The test contrasts sanitized media against other members of the same corpus — no manual labeling is involved — and requires only the assumption that P7.
Theoretical guarantees
The central result, Theorem 1, proves that if P8 offers contrastive privacy with respect to P9, then every sanitized rendering e0 is private with respect to e1 (i.e., fails to capture any instance of e2). Corollary 1 establishes the converse intuition: achieving contrastive privacy implies e3 covers e4. Notably, the guarantee survives imperfect sanitization of e5 itself — the test certifies coverage by whatever concepts e6 actually removes, provided they lie in the semantic closure. The critical dependency is on e7: if the distance mechanism misses latent semantic connections, the test can report resolution 0 even though e8 does not cover e9. Thus sanitization quality governs achievable resolution while distance-mechanism quality governs validity of the test.
The guarantee is conditional in two ways the authors state plainly: it holds only if (1) the proxy set represents the full abstract concept and (2) c0 is sensitive to relevant similarities. Neither condition can typically be guaranteed in practice, so contrastive privacy provides an approximation rather than an absolute guarantee like DP.
Operationalization
Practical deployment uses proxy sets c1 sampled from c2, with CLIP-style cosine distance as c3. In cosine space the test reduces to checking whether the dot product between each sanitized embedding and each "difference vector" c4 stays below c5; this admits an efficient algorithm using vector databases (FAISS), with c6 exact or c7 HNSW-approximate nearest-neighbor lookup, where approximation error effectively inflates c8. Increasing c9 makes privacy easier to achieve but shrinks the semantic closure, weakening sensitivity to semantic similarity — hence the name "resolution."
Two practical caveats deserve emphasis. First, the concept ambiguity penalty: because D0 obfuscates all instances of D1, the test implicitly covers every instance in the closure, including semantically rich ones unrelated to the target (e.g., obfuscating all faces forces handling Santa Claus co-occurring with Bob). Second, D2 generally requires fine-tuning when the abstract concept is not represented in the embedding model's training data; only the target concept needs labeling, not the constituent natural concepts.
Empirical results
Experiments cover 34 image-model combinations (4 i2t concept generators plus Manual × 7 i2i redactors) and 15 text models, at roughly $1,200 USD in API cost, using EVA-CLIP-18B for image distance and Qwen3-Embedding-8B for text.
| Task |
Best mechanism |
Resolution |
Utility |
| Celebrity identity (30 DiCaprio images) |
iGEM31f/Manual |
0 |
0.61 |
| Brand identity (49 McDonald's images) |
SAM3/Manual (9-image subset) |
0 |
0.46 |
| Movie franchise (49 Reddit comments) |
GLN2 (9-comment subset) |
0 |
0.75 |
On the full 49-image McDonald's set and 49-comment Avengers set, no mechanism achieved resolution 0; the best text mechanism reached only 0.04 on the nine-comment subset and 0.18 at scale. Several findings stand out:
- No frontier model achieves ideal privacy, and neither parameter count nor model generation predicts performance — the smaller iGEM31f achieves among the lowest resolutions while larger models fare worse.
- Task difficulty varies sharply: celebrity identity is easier to privatize than global brands (McDonald's) or movie franchises (Avengers), which have dense semantic closures.
- The test localizes specific failures with interpretable semantics: FLX2d/GEM31p failed to remove Margot Robbie and a Once Upon a Time... in Hollywood poster; iGPT15/GPT54's worst failure linked an ocean map to DiCaprio via the Our Ocean Conference; GPT54's worst text failure left "superhero movie" unredacted, connecting to "Watchmen, Dark Knight, Avengers." All Pareto-frontier text mechanisms shared one of two failure comparisons, suggesting uniform behavior across model families.
- Many apparent failures stem from the concept ambiguity penalty (near-black sanitized images sweeping everything into D3), which the framework flags conservatively.
A resolution analysis calibrates D4 against everyday semantic pairs: e.g., with EVA, resolution 0.136 corresponds to privacy robust against adversaries who cannot link concepts less similar than dog-vs-cat at the 95th percentile.
Limitations and open questions
The paper concedes several constraints explicitly. Contrastive privacy yields no absolute guarantee — unlike DP — because proxy sets approximate D5 and the ML models implementing D6 and D7 are fallible with unquantified error rates. The distance mechanism can miss modalities it was not trained on: EVA failed to flag visible text spelling "Leonardo DiCaprio" behind obfuscated faces, requiring OCR augmentation or inclusion of text in D8. The work gives no method for choosing D9 or constructing effective SSMs; it assumes these are provided. Direct testing of commercial systems (AWS Comprehend, Microsoft Presidio, VisShield, GUIGuard) is deferred due to cost and domain-specific fine-tuning requirements. Open questions include systematic benchmarking of privatization capabilities across models, principled fine-tuning procedures for D(x,x)=00, and scalable solutions to open entity recognition as a route around the concept ambiguity penalty.
Conclusion
Contrastive privacy supplies a formal, modality-agnostic definition of privacy for AI-based sanitization that reduces to an automated, label-free test over embeddings. Its theorem links the empirical test to genuine coverage of abstract privacy targets under stated conditions on representation and distance sensitivity. Empirically, the test quantifies and diagnoses failures across 34 image and 15 text model combinations, showing that current frontier SSMs do not achieve ideal privacy and that model scale and recency are poor predictors of sanitization quality.