Enhancing Membership Inference Attacks with Contextual Relevance

Saturday 08 March 2025


The art of detecting pre-training data in large language models (LLMs) has become a crucial task, especially as these AI systems are increasingly integrated into various applications. The problem is that LLMs are often trained on vast amounts of text data, which can include copyrighted or sensitive information. As researchers and developers strive to improve the accuracy of these models, they must also ensure that their training data remains secure.


In recent years, several studies have focused on developing membership inference attacks (MIAs) to detect pre-training data in LLMs. These attacks involve analyzing the model’s predictions to determine whether a given text sample was part of its training dataset or not. However, many existing MIAs have shown poor performance, failing to account for the semantic importance of textual content and word significance.


Enter Tag&Tab, a novel black-box method developed by a team of researchers that addresses these shortcomings. By focusing on the contextual relevance of words in the text, Tag&Tab enhances its detection capabilities, outperforming state-of-the-art attacks. The approach involves two key steps: tagging keywords in the input text and tabbing the model’s probabilities.


The tagging process involves identifying high-entropy keywords within the text, which are then used to create a weighted representation of the sample. This representation is then fed into the LLM, generating a set of probabilities for each keyword. The average log-likelihood of these probabilities serves as the input feature for the MIAs.


The tabbing step, on the other hand, involves calculating the average log-likelihood of the keywords’ probabilities across multiple iterations. This process helps to reduce noise and increase the model’s robustness to variations in the input text. By combining these two steps, Tag&Tab achieves significantly better performance compared to existing MIAs.


The researchers tested their approach on three benchmark datasets (BookMIA, MIMIR, and the Pile) and six different LLMs of varying sizes and architectures. The results showed that Tag&Tab outperformed state-of-the-art attacks across all datasets and models, with an average increase in AUC scores ranging from 4.1% to 12.1%.


The implications of this research are far-reaching, particularly as LLMs continue to play a crucial role in various applications. By developing more effective MIAs like Tag&Tab, researchers can ensure that the training data remains secure and protected.


Cite this article: “Enhancing Membership Inference Attacks with Contextual Relevance”, The Science Archive, 2025.


Language Models, Pre-Training Data, Membership Inference Attacks, Text Data, Copyrighted Information, Sensitive Information, Semantic Importance, Word Significance, Black-Box Method, Keyword Tagging


Reference: Sagiv Antebi, Edan Habler, Asaf Shabtai, Yuval Elovici, “Tag&Tab: Pretraining Data Detection in Large Language Models Using Keyword-Based Membership Inference Attack” (2025).


Leave a Reply