NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

BADI: Black-box and Anytime-valid Dataset Identification for Large Language Models

Piotr Trzaskowski, Nima Dindarsafa, Bihe Zhao, Krzysztof Wodnicki, Filip Szympliński, Franziska Boenisch, Adam DziedzicOpenReview 2026 · Submission to ICLR 2026 · Rejected

As Large Language Models (LLMs) grow more powerful, so do the legal and ethical concerns surrounding their training data. With dozens of active lawsuits alleging unauthorized use of copyrighted text, the ability to prove a model was trained on a specific dataset—known as Dataset Inference (DI)—has become a technical necessity for intellectual property protection.

However, existing auditing methods face a "Catch-22." They either require "gray-box" access to internal model probabilities (which commercial APIs like GPT-4 don't provide) or they rely on rigid p-value statistics that break if you try to add more data to an inconclusive test.

A new paper, BADI: Black-box and Anytime-valid Dataset Identification, proposes a clever way out. By combining a novel way to estimate probabilities from text alone with a "betting-based" statistical framework, the authors have created a tool that can audit black-box models with rigorous, flexible guarantees.

TL;DR

BADI is a practical framework for identifying if a suspect dataset was used to train an LLM using only black-box API access. It introduces a sigmoid-based method to estimate token probabilities from text similarities and uses "e-values" to allow researchers to accumulate evidence sequentially and stop the audit as soon as a definitive result is reached.

What Problem Does This Paper Address?

The authors tackle two primary hurdles in dataset auditing:

  1. The Black-Box Barrier: Most state-of-the-art models are hidden behind APIs. Auditing methods usually need to see the model's internal "confidence" (logits or token probabilities) for a given sentence. APIs usually just spit out text, making these "gray-box" features inaccessible.
  2. The "Peeking" Problem: Traditional statistics rely on p-values. To use a p-value correctly, you must decide exactly how much data you will test before you start. If your result is "almost significant," you cannot simply add more data to be sure; doing so invalidates the statistical math. This makes auditing expensive (if you over-sample) or inconclusive (if you under-sample).

Methods

BADI introduces two major innovations to solve these problems:

1. Estimating Probabilities via Semantic Similarity

Since they can't get real token probabilities from an API, the authors estimate them. They take the LLM's predicted next token and the actual ground-truth token, convert them into embeddings (mathematical vectors representing meaning), and calculate their cosine similarity. They then pass this similarity through a sigmoid-based calibration function to approximate the probability the model would have assigned to that token. This allows them to "translate" 31 existing gray-box membership features into a black-box setting.

2. Testing by Betting (e-values)

Instead of p-values, BADI uses e-values. They frame the audit as a betting game against the "null hypothesis" (the claim that the model didn't see the data).

  • As the auditor observes pairs of data points, they "bet" on the model's ability to distinguish between suspect data and held-out data.
  • If the model was indeed trained on the data, the auditor's "wealth" (the e-value) grows exponentially.
  • Because this wealth process is a martingale, it is "anytime-valid." You can stop the test the moment your wealth crosses a significance threshold (e.g., 20x or 100x your starting stake) or keep going if you need more evidence, all without cheating the statistics.

Datasets

The authors performed an extensive evaluation using:

  • The Pile: A massive dataset used to train the Pythia model suite (ranging from 410M to 12B parameters). They tested on 18 diverse subsets including Wikipedia, GitHub, and PubMed.
  • Dolma: Used to evaluate the OLMo-7B model.
  • BookMIA 2023: A benchmark specifically designed for detecting membership of copyrighted books, used to test commercial models like GPT-3.5-Turbo and Qwen2-7B.

Key Insights and Ideas

  • Sample Efficiency: Because you can stop as soon as you have enough evidence, BADI is much faster than previous methods. On some datasets, it required fewer than 100 samples to reach a 95% confidence level, whereas prior work often required 1,000+.
  • Robustness to "Pollution": The betting framework is surprisingly resilient. Even if the "clean" validation set used for comparison is contaminated with up to 70% training data, BADI can still eventually accumulate enough evidence to reject the null hypothesis.
  • Surpassing Surrogate Models: BADI’s sigmoid calibration outperforms previous attempts (like PETAL) that relied on training separate "surrogate" models to guess probabilities, making BADI both more accurate and computationally cheaper.

Key Results

  • Superior Accuracy: BADI consistently achieved higher Area Under the Curve (AUC) scores than baselines across almost all tested datasets. For the Pythia-12B model, BADI’s AUC was significantly above random guessing for every single subset.
  • Real-World API Success: The method successfully identified training data in GPT-3.5-Turbo, reaching the 1% significance threshold in fewer than 200 samples.
  • Scaling Effects: Generally, larger models provide a stronger membership signal (making them easier to audit), though this effect varied slightly depending on the specific dataset (e.g., Wikipedia was actually harder to detect in larger models).

Limitations and Future Work

  • Distribution Matching: Like all DI methods, BADI requires a "held-out" dataset that comes from the same distribution as the suspect data. If you don't have a clean version of the data to compare against, the audit is much harder.
  • Instruction Tuning: The authors noted that "instruction-tuned" models (like Chat-GPT variants) produce slightly weaker signals than their "base" counterparts, requiring more samples to reach the same level of confidence.
  • Future Directions: The authors suggest extending this framework to other modalities, such as checking if an image generation model was trained on a specific artist's portfolio.

Paper Citation: Anonymous authors. "BADI: Black-box and Anytime-valid Dataset Identification for Large Language Models." Under review as a conference paper at ICLR 2026.

Summary updated

BibTeX
@misc{trzaskowski2026badi,
  author = {Piotr Trzaskowski and Nima Dindarsafa and Bihe Zhao and Krzysztof Wodnicki and Filip Szympliński and Franziska Boenisch and Adam Dziedzic},
  title = {{BADI: Black-box and Anytime-valid Dataset Identification for Large Language Models}},
  year = {2026},
  url = {https://openreview.net/forum?id=bvE9NXyJeb},
  howpublished = {OpenReview},
  note = {Submitted to ICLR 2026},
}
Figure