leeky

A Python library to test for training data contamination on black box models.

Beneficiary
Date
Work
A Python library to test for training data contamination on black box models.

In collaboration with:

leeky Homepage

What is Leeky?


How do you know if a black box model like GPT-4 or LLaMA 3 has been trained on a specific source like a book or website?

This question, commonly referred to or related to topics like “membership inference,” “data leakage”, or “training data contamination,” is critical for the evaluation and understanding of models.

leeky is a Python library designed to help answer this question by testing for training data contamination on black box models.

Techniques


Leeky supports five methods for evaluating models:

  • Recital without context: This method provides an initial sequence of tokens from the source material and prompts the model to complete the sequence without context.
  • Contextual recital: Similar to the previous method, but with explicit knowledge of the source in question.
  • Semantic recital: This method provides an initial sequence of tokens from the source material and prompts the model to complete the sequence using a non-LLM technique, such as Jaccard stem/lemma sets or frequency vectors.
  • Source veracity: This method asks the model to answer, Yes or No, whether a sequence of tokens is from a real source.
  • Source recall: This method prompts the model to recall the source of the text using generic prompts related to recalling source.

While each of these techniques may have limitations or biases in certain cases, the goal of leeky is to provide an ensemble of methods that can be used together to assess the likelihood of training data membership for a given source.

How to Use

You can find more information about using leeky on GitHub at leeky.

Contact us

Want to talk or collaborate?

Don't be shy. We'd love to hear from you.

Subscribe


News and Updates from the ALEA Institute.