Digger: Detecting Copyright Content Mis-usage in Large Language Model Training

Haodong Li, Gelei Deng, Yi Liu, Kailong Wang, Yuekang Li, Tianwei Zhang, Yang Liu, Guoai Xu, Guosheng Xu, Haoyu WangarXiv 2024 · DOI

TL;DR

Digger is a novel framework designed to audit Large Language Models (LLMs) for copyright infringement. It detects whether specific protected content was used during a model's training by analyzing the "loss gap"—the specific way a model’s prediction error shifts when it is fine-tuned on suspected material. Digger can identify "memorized" content with high accuracy, even when training datasets are kept secret.

The Challenge of Black-Box Training Data

The "secret sauce" of modern LLMs is the massive, diverse dataset used for pre-training. However, these datasets are often "black boxes"; developers rarely disclose full source lists due to proprietary concerns or the risk of admitting they used copyrighted material without permission.

This creates significant legal and ethical challenges. Authors and publishers often suspect their works are used to train models like GPT-4 or LLaMA without compensation, but proving a specific book is "inside" a model is difficult. While models sometimes "regurgitate" text verbatim, they often do not, making simple search-based detection unreliable. Digger addresses the need for a robust, statistical method to determine if a model has encountered specific content during its lifecycle.

Methods

The Digger framework moves beyond simple "Membership Inference Attacks" (which look at raw loss) to a more nuanced "loss gap" analysis. The process is divided into several distinct phases to isolate the signal of prior knowledge from general linguistic patterns.

The Digger framework workflow, illustrating the preparation phase and the simulation experiment used to generate loss distributions.
  1. The Loss Gap Principle: The authors observed that if a model has already seen a text, its "loss" (a measure of how poorly it predicts the next token) behaves differently during a new round of fine-tuning compared to text it is seeing for the first time.
  2. Preparation Phase: To create a benchmark, researchers take a "vanilla" LLM and fine-tune it on a known "baseline" dataset (content definitely not in the original training set). This creates a Reference LLM.
  3. Simulation Experiment: Both the vanilla model and the reference model are fine-tuned on the "target" dataset (the suspected copyrighted material).
  4. Confidence Calculation: By comparing the loss distributions of these models using Wasserstein distance, they calculate a confidence score. If the target material was already in the model's "memory," the shift in loss will be significantly smaller and follow a specific pattern compared to truly novel data.

Datasets

To ensure results weren't contaminated by the models' original training data, the authors used a temporal strategy:

  • 2023 Books: Five novels published in 2023 (e.g., Happy Place by Emily Henry) were selected. Since models like GPT-2 were trained years ago, these books are guaranteed to be "unseen."
  • Goodreads Quotes: For real-world testing, 500 excerpts of famous poetry and literary quotes from Goodreads were used to see if models like LLaMA-7b had encountered them in the wild.
  • WebText: The standard 40GB English dataset served as a general reference for pre-training.

Key Insights and Ideas

Sample loss and loss gap trends across different GPT-2 model sizes, showing that larger models exhibit more distinct signals for memorized content.
  • Model Size Matters: Larger models (like GPT2-XL) exhibit much faster convergence and "retention" than smaller ones. As models scale, they become significantly better at memorizing training data, making copyright detection both more urgent and potentially easier due to the stronger signal.
  • The "Aha" Moment on Loss: Simply looking at whether a model has low loss on a sentence isn't enough—some sentences are just naturally easy to predict (e.g., "The cat sat on the..."). Digger’s innovation lies in looking at the rate of change in loss during fine-tuning, which filters out the "natural" predictability of language to find the "learned" predictability of specific data.
  • Token Length Sensitivity: Detection accuracy improves significantly as the length of the test sample increases. Samples of 100 tokens provided much clearer signals than 50-token snippets.

Key Results

The researchers tested Digger on the GPT-2 family and LLaMA-7b with impressive results:

  • High Accuracy: In controlled experiments with GPT2-XL, Digger achieved an accuracy of 84.75% and a recall of 92.43% (at a 20% False Positive Rate).
  • Real-World Detection: When deployed against LLaMA-7b and GPT2-XL using famous literary quotes, Digger successfully identified that a significant portion of the quotes were likely included in the models' training sets, producing high-confidence "seen" scores.
  • Robustness: The framework proved effective even when the target dataset was a mix of seen and unseen content, a common scenario in real-world copyright audits.

Limitations and Future Work

While powerful, Digger faces hurdles before becoming a standard legal tool:

  • Computational Cost: The method requires multiple rounds of fine-tuning and inference. While feasible for small-to-medium models, applying this to "behemoths" like GPT-4 or Llama-3-70B would require massive GPU resources.
  • Access to Weights: Digger requires access to the model's weights to perform fine-tuning and calculate loss. This makes it difficult to use against "closed" models like Claude or Gemini unless providers offer a specific auditing API.
  • The Technical Arms Race: As detection methods improve, developers might implement "unlearning" or "de-identification" techniques to mask the presence of copyrighted data.

Future work will focus on improving detection efficiency and exploring how these "loss gaps" can be used to identify copyright infringement in even larger, more complex architectures.

Summary updated

BibTeX
@misc{li2024digger,
  author = {Haodong Li and Gelei Deng and Yi Liu and Kailong Wang and Yuekang Li and Tianwei Zhang and Yang Liu and Guoai Xu and Guosheng Xu and Haoyu Wang},
  title = {{Digger: Detecting Copyright Content Mis-usage in Large Language Model Training}},
  year = {2024},
  eprint = {2401.00676},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.00676},
}
Figure