Papers › MIA-Tuner: Adapting Large Language Models as Pre-training Text Detector

MIA-Tuner: Adapting Large Language Models as Pre-training Text Detector

16 Aug 2024arXiv:2408.08661archive 2025-07-28

Wenjie Fu, Huandong Wang, Chen Gao, Guanghua Liu, Yong Li, Tao Jiang

The increasing parameters and expansive dataset of large language models (LLMs) highlight the urgent demand for a technical solution to audit the underlying privacy risks and copyright issues associated with LLMs. Existing studies have partially addressed this need through an exploration of the pre-training data detection problem, which is an instance of a membership inference attack (MIA). This problem involves determining whether a given piece of text has been used during the pre-training phase of the target LLM. Although existing methods have designed various sophisticated MIA score functions to achieve considerable detection performance in pre-trained LLMs, how to achieve high-confidence detection and how to perform MIA on aligned LLMs remain challenging. In this paper, we propose MIA-Tuner, a novel instruction-based MIA method, which instructs LLMs themselves to serve as a more precise pre-training data detector internally, rather than design an external MIA score function. Furthermore, we design two instruction-based safeguards to respectively mitigate the privacy risks brought by the existing methods and MIA-Tuner. To comprehensively evaluate the most recent state-of-the-art LLMs, we collect a more up-to-date MIA benchmark dataset, named WIKIMIA-24, to replace the widely adopted benchmark WIKIMIA. We conduct extensive experiments across various aligned and unaligned LLMs over the two benchmark datasets. The results demonstrate that MIA-Tuner increases the AUC of MIAs from 0.7 to a significantly high level of 0.9.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2408.08661")

Code

Syntology Ran 10 of 16 code samples harvested from 1 repository linked to this paper; 6 have no recorded run. Of those that ran: 10 ran with no contract checked.

By repository: official repository: 16 samples from 1 repository, 10 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

wjfu99/mia-tuner officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

16 samples harvested; 10 ran; 0 honoured the contract we drafted; 6 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

10ran
6unverified

Licence: 16 of the 16 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from wjfu99/mia-tuner. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

compute_reconstruct_rate wjfu99/mia-tuner/my_utils.py official repository ran no licence file found · pointer only · 04659e6b8bcf079c · report
extract_event_content wjfu99/mia-tuner/update_wikimia.py official repository ran no licence file found · pointer only · 16ebfa6747fcf489 · report
generate_suffixes wjfu99/mia-tuner/my_utils.py official repository ran no licence file found · pointer only · 92e0d0a6e852a71d · report
get_generic_logger wjfu99/mia-tuner/utils.py official repository ran no licence file found · pointer only · ea698fe030e4aa1b · report
instruct_format wjfu99/mia-tuner/inference_on_zhipuai/inference_zhipuai.py official repository ran fingerprinted no licence file found · pointer only · 71b1f53a37c318af · report
instruct_format wjfu99/mia-tuner/inference_on_zhipuai/jsonl_dataset.py official repository ran fingerprinted no licence file found · pointer only · d195295e9c1a6d51 · report
load_dict_from_npz wjfu99/mia-tuner/utils.py official repository ran no licence file found · pointer only · e14dafbc85136a7d · report
load_jsonl wjfu99/mia-tuner/inference_on_zhipuai/inference_zhipuai.py official repository ran no licence file found · pointer only · cdd7cb5df882df7d · report
load_prompts wjfu99/mia-tuner/my_utils.py official repository ran no licence file found · pointer only · 91d1d9b0c9c266d7 · report
remove_after_assistant wjfu99/mia-tuner/data_utils.py official repository ran no licence file found · pointer only · 71ad10f49732634d · report
count_masks wjfu99/mia-tuner/dataset_perturb.py official repository unverified no licence file found · pointer only · 23c3416429f69fee · report
index_output wjfu99/mia-tuner/data_utils.py official repository unverified no licence file found · pointer only · b7b5bf30620a61d6 · report
inference wjfu99/mia-tuner/run_baselines.py official repository unverified no licence file found · pointer only · 7bf9fb555a194f43 · report
load_model wjfu99/mia-tuner/run_baselines.py official repository unverified no licence file found · pointer only · c4f49de1c200db3c · report
replace_masks wjfu99/mia-tuner/dataset_perturb.py official repository unverified no licence file found · pointer only · 11e5b3fc9bdba4a4 · report
tokenize_and_mask wjfu99/mia-tuner/dataset_perturb.py official repository unverified no licence file found · pointer only · 7ef526c6711c4bf8 · report

Tasks

Inference AttackMembership Inference Attack

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections