Papers › Be Careful When Fine-tuning On Open-Source LLMs: Your Fine-tuning Data Could Be...

Be Careful When Fine-tuning On Open-Source LLMs: Your Fine-tuning Data Could Be Secretly Stolen!

21 May 2025arXiv:2505.15656archive 2025-07-28

Zhexin Zhang, Yuhao Sun, Junxiao Yang, Shiyao Cui, Hongning Wang, Minlie Huang

Fine-tuning on open-source Large Language Models (LLMs) with proprietary data is now a standard practice for downstream developers to obtain task-specific LLMs. Surprisingly, we reveal a new and concerning risk along with the practice: the creator of the open-source LLMs can later extract the private downstream fine-tuning data through simple backdoor training, only requiring black-box access to the fine-tuned downstream model. Our comprehensive experiments, across 4 popularly used open-source models with 3B to 32B parameters and 2 downstream datasets, suggest that the extraction performance can be strikingly high: in practical settings, as much as 76.3% downstream fine-tuning data (queries) out of a total 5,000 samples can be perfectly extracted, and the success rate can increase to 94.9% in more ideal settings. We also explore a detection-based defense strategy but find it can be bypassed with improved attack. Overall, we highlight the emergency of this newly identified data breaching risk in fine-tuning, and we hope that more follow-up research could push the progress of addressing this concerning risk. The code and data used in our experiments are released at https://github.com/thu-coai/Backdoor-Data-Extraction.

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="2505.15656")

Code

Syntology Ran 4 of 11 code samples harvested from 1 repository linked to this paper; 7 have no recorded run. Of those that ran: 1 ran · violated contract; 3 ran with no contract checked.

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

thu-coai/backdoor-data-extraction officialmentioned in papermentioned on GitHubpytorchMIT 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

11 samples harvested; 4 ran; 0 honoured the contract we drafted; 7 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.

1ran · violated contract
3ran
7unverified

Licence: 0 of the 11 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 thu-coai/backdoor-data-extraction. “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.

flatten_dict thu-coai/backdoor-data-extraction/train/trl/core.py official repository ran MIT (permissive) · dfd0ecd9cb25af69 · report
masked_mean thu-coai/backdoor-data-extraction/train/trl/core.py official repository ran fingerprinted MIT (permissive) · 4f7075aac2163cbc · report
masked_var thu-coai/backdoor-data-extraction/train/trl/core.py official repository ran fingerprinted MIT (permissive) · 67607956afbb2a83 · report
str2bool thu-coai/backdoor-data-extraction/general_performance/gen_alpaca.py official repository ran · violated contract MIT (permissive) · 7c508037b40522af · report
apply_chat_template thu-coai/backdoor-data-extraction/train/trl/data_utils.py official repository unverified MIT (permissive) · 53017c7a8e570221 · report
compute_self_bleu thu-coai/backdoor-data-extraction/evaluation/pipeline_extraction.py official repository unverified MIT (permissive) · 08b714bea7508eff · report
extract_beginning thu-coai/backdoor-data-extraction/evaluation/extract_reward.py official repository unverified MIT (permissive) · 2bef438299dced7a · report
extract_word thu-coai/backdoor-data-extraction/evaluation/extract_reward.py official repository unverified MIT (permissive) · 8ac2449b0e29886d · report
is_conversational thu-coai/backdoor-data-extraction/train/trl/data_utils.py official repository unverified MIT (permissive) · 3c42df7a6e98e89c · report
load_sft_training_data thu-coai/backdoor-data-extraction/evaluation/extraction_test_coverage.py official repository unverified MIT (permissive) · 03d327da9b8a56ec · report
maybe_apply_chat_template thu-coai/backdoor-data-extraction/train/trl/data_utils.py official repository unverified MIT (permissive) · c695ba9ac4cc3b93 · report

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