Contrastive Learning-Based privacy metrics in Tabular Synthetic Datasets

Milton Nicolás Plasencia Palacios, Sebastiano Saccani, Gabriele Sgroi, Alexander T. P. Boudewijn, Luca BortolussiarXiv 2025 · DOI

Introduction

Synthetic data has emerged as a critical Privacy Enhancing Technology (PET), allowing organizations to share data insights without exposing sensitive individual records. However, quantifying the privacy guarantees of synthetic tabular data remains a significant challenge. This paper introduces a novel approach to measuring privacy by leveraging contrastive learning to create a representative embedding space. By mapping complex, mixed-type tabular data into a lower-dimensional Euclidean space, the authors demonstrate that simple distance-based metrics can become as effective—and significantly more efficient—than complex, attack-based privacy frameworks.

The Challenge of Tabular Privacy

Proving that synthetic data is "safe" typically involves two methodologies: similarity-based metrics, which check if synthetic records are too close to real ones, and attack-based metrics, which simulate adversarial attempts to "single out" individuals. Tabular data complicates these evaluations due to three primary factors:

  1. Mixed Data Types: Calculating distance between categorical values (e.g., "Software Engineer" vs. "Doctor") and numerical values (e.g., age) is non-trivial.
  2. High Dimensionality: The "curse of dimensionality" often makes records in high-dimensional space appear equally distant, obscuring actual privacy risks.
  3. Semantic Complexity: Standard metrics like Euclidean distance fail to capture semantic similarities (e.g., that "Physician" and "Doctor" are related concepts).

Proposed Methodology: Contrastive Learning for Tables

The core innovation of this work is a self-supervised contrastive learning approach specifically tailored for tabular structures. The process involves generating multiple "views" of a single record through random masking, where specific columns are hidden.

Contrastive learning framework for tabular data.

A neural network is then trained to map these different views of the same record close together in an embedding space, while simultaneously pushing views of different records apart. Once the data is embedded in this learned space, the authors apply the Distance to Closest Record (DCR) metric. This transformation allows messy tabular data to be treated as clean vectors where Euclidean distance reliably flags privacy leaks.

Experimental Evaluation

The methodology was benchmarked using three diverse tabular datasets: the Adult census dataset (15 attributes), the Texas Inpatient Public Use Data (193 attributes), and the 1940 US Census (97 attributes). To ensure a fair comparison with computationally expensive attack frameworks like "Anonymeter," the authors utilized subsets of 20,000 to 25,000 rows.

Key Results and Insights

The researchers compared their proposed DCR + Contrastive Learning (CL) metric against the state-of-the-art Singling Out (SO) attack-based framework. Several key findings emerged:

  • Performance and Variance: The DCR metric in the embedded space exhibited significantly lower standard deviations than attack-based methods, suggesting a more reliable and consistent privacy score across different runs.
  • Efficiency Gains: Computing DCR in the contrastive space provided a 10x speedup, taking approximately 0.02 seconds compared to 0.2 seconds for attack-based simulations.
  • Linear Sensitivity: In controlled experiments where real data was intentionally leaked into synthetic sets, the metric showed a clear, linear increase in risk, proving its sensitivity to privacy breaches.
Comparison of privacy metrics across datasets and synthetic data generators.

As shown in the comparative results, the integration of Contrastive Learning (CL) generally refines the privacy risk estimates across various synthetic data generators like CTGAN and DPCTGAN, often reducing the variance of the estimates.

Conclusion and Future Work

This research demonstrates that embedding-based metrics can achieve parity with advanced metrics that explicitly model complex legal conditions, such as the GDPR's "singling out" criteria, while offering superior computational efficiency.

However, limitations remain. In the Texas dataset evaluation, the DCR in the embedded space failed to capture certain risks identified by attack-based methods, suggesting that specific data distributions may require further embedding optimization. Future work will explore combining these embeddings with other attack vectors, such as Membership Inference Attacks (MIA), and investigating whether the model captures deeper semantic meanings beyond statistical distributions.

Summary updated

Abstract

Synthetic data has garnered attention as a Privacy Enhancing Technology (PET) in sectors such as healthcare and finance. When using synthetic data in practical applications, it is important to provide protection guarantees. In the literature, two family of approaches are proposed for tabular data: on the one hand, Similarity-based methods aim at finding the level of similarity between training and synthetic data. Indeed, a privacy breach can occur if the generated data is consistently too similar or even identical to the train data. On the other hand, Attack-based methods conduce deliberate attacks on synthetic datasets. The success rates of these attacks reveal how secure the synthetic datasets are. In this paper, we introduce a contrastive method that improves privacy assessment of synthetic datasets by embedding the data in a more representative space. This overcomes obstacles surrounding the multitude of data types and attributes. It also makes the use of intuitive distance metrics possible for similarity measurements and as an attack vector. In a series of experiments with publicly available datasets, we compare the performances of similarity-based and attack-based methods, both with and without use of the contrastive learning-based embeddings. Our results show that relatively efficient, easy to implement privacy metrics can perform equally well as more advanced metrics explicitly modeling conditions for privacy referred to by the GDPR.
BibTeX
@misc{palacios2025contrastive,
  author = {Milton Nicolás Plasencia Palacios and Sebastiano Saccani and Gabriele Sgroi and Alexander T. P. Boudewijn and Luca Bortolussi},
  title = {{Contrastive Learning-Based privacy metrics in Tabular Synthetic Datasets}},
  year = {2025},
  eprint = {2502.13833},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.13833},
}
Figure