How much of my dataset did you use? Quantitative Data Usage Inference in Machine Learning

Yao Tong, Jiayuan Ye, Sajjad Zarifzadeh, Reza Shokri

TL;DR

This paper introduces Dataset Usage Cardinality Inference (DUCI), a novel framework that moves beyond binary "yes/no" data usage detection to estimate the exact proportion of a dataset used to train a machine learning model. By leveraging a clever debiasing procedure for membership inference, the authors achieve high-precision estimates (error < 0.1) while requiring up to 630x less computational power than traditional statistical approaches.

What Problem Does This Paper Address?

As AI models are increasingly trained on massive web-scraped datasets, legal battles over intellectual property—like the New York Times lawsuit against OpenAI—have intensified. Data owners need to know if their data was used without permission.

Existing "data provenance" tools are mostly binary: they try to determine if an entire dataset was used or none of it. However, real-world usage is often partial. A developer might only use 30% of a specific dataset. The authors show that current binary methods are "fragile" in these scenarios; their predictions fluctuate wildly and inconsistently as the amount of data used changes, making them unreliable for legal or regulatory audits.

Prior binary methods are unreliable and fluctuate when only a portion of the data is used.

Methods

The researchers propose DUCI, which shifts the paradigm from binary classification to granular estimation.

  1. Debiased Membership Inference: The core idea is to use Membership Inference (MI) attacks—algorithms that guess if a specific data point was in a training set—and aggregate their results. Because individual MI guesses are noisy and biased, the authors developed a novel debiasing procedure. This mathematical step ensures that the final proportion estimate is "unbiased," meaning it's accurate on average across many trials.
  2. Efficiency via Reference Models: Traditional "optimal" methods like Maximum Likelihood Estimation (MLE) require training hundreds of "shadow models" to understand how a model behaves at every possible usage level (e.g., 5%, 10%, 15%...). DUCI is much more efficient; it can produce reliable estimates using as few as one or two reference models.
  3. Uncertainty Quantification: Using the Lyapunov Central Limit Theorem, the framework provides confidence intervals, allowing users to see not just the estimated usage, but how certain that estimate is.

Datasets

The authors evaluated DUCI across several standard benchmarks and a real-world case study:

  • Image Classification: CIFAR-10, CIFAR-100, and Tiny-ImageNet.
  • Architectures: They tested various models, including standard 5-layer fully connected networks, Wide ResNets (WRN28-2), and ResNet-34.
  • Large Language Models (LLMs): A case study using GPT-2 fine-tuned on the BookMIA dataset, which contains 50 new books published in 2023 (unseen by the base model) to simulate copyright infringement.

Key Insights and Ideas

  • Aggregation is the Key: While guessing if a single image was used is hard, guessing what percentage of 1,000 images were used is much easier because individual errors tend to cancel out when properly aggregated.
  • Binary is Not Enough: The "all-or-nothing" assumption of previous work fails in practice. A robust tool must be continuous.
  • Computational Practicality: By reusing models from the membership inference process, DUCI makes large-scale data auditing feasible for organizations that don't have the massive compute budgets of big tech companies.

Key Results

  • Superior Accuracy: Across all tested datasets, DUCI consistently outperformed vanilla membership inference baselines. It achieved a maximum mean absolute error (MAE) of less than 0.1, even with a very restricted computational budget.
Maximum mean absolute error (MAE) across different datasets and architectures. DUCI consistently shows the lowest error.
  • Extreme Efficiency: DUCI matched the performance of the "gold standard" MLE approach while being roughly 300x to 630x faster to compute. Error decreases as more reference models are added, but DUCI remains highly effective even with very few models compared to MLE baselines.
  • Robustness: The method remained effective even when the model trainer used "special" sampling (like only picking the most "significant" data points) rather than random sampling.

Limitations and Future Work

While DUCI is a major step forward, the authors note a few areas for improvement:

  • Adversarial Sampling: If a model trainer intentionally tries to hide their data usage by using highly complex sampling schemes, providing ironclad statistical guarantees is still an open challenge.
  • Text Data Variance: In the GPT-2 case study, the error variance was higher than in image tasks. This is because text data is often harder to distinguish as "member" vs "non-member" due to the massive size of LLM training corpora.
  • Indirect Usage: The current method detects direct usage. Future work could look at "neighborhood inference"—detecting if data similar to the target dataset was used to train the model.

Summary updated

BibTeX
@inproceedings{tong2025how,
  author = {Yao Tong and Jiayuan Ye and Sajjad Zarifzadeh and Reza Shokri},
  title = {{How much of my dataset did you use? Quantitative Data Usage Inference in Machine Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=EUSkm2sVJ6},
}
Figure