﻿# Backdoored base models can expose later fine-tuning queries

An ICLR study demonstrates query extraction after private-data adaptation of deliberately compromised weights. Its percentages depend on access and training conditions.

Author: Retrivium editorial team
Updated: 2026-11-05
Canonical URL: https://retrivium.ai/journal/backdoored-base-model-private-finetuning-query-leakage/
Language: en

A language-model supplier can deliberately train a hidden ability to reproduce prompts from a future fine-tuning dataset. After another organization adapts and exposes the model, the supplier can, according to this research, recover some training examples through specially prepared queries. In the strongest reported practical scenario, the authors exactly recovered up to 76.3% of prompts from a 5000-example dataset. This is a controlled experiment using an intentionally implanted backdoor, rather than a reported theft from a particular customer. See the [ICLR 2026 paper](https://proceedings.iclr.cc/paper_files/paper/2026/file/0f6294663c7392440f573225977436eb-Paper-Conference.pdf).

The preprint *Be Careful When Fine-tuning On Open-Source LLMs: Your Fine-tuning Data Could Be Secretly Stolen!* appeared May 21, 2025, was revised April 3, 2026 and published at ICLR 2026. The work examines model-supply-chain risk: developers adapt available weights using private data and expose an interface. If the base weights are maliciously prepared, storing training data locally does not alone prevent later leakage through answers. See [arXiv version history](https://arxiv.org/abs/2505.15656) and the [conference record](https://proceedings.iclr.cc/paper_files/paper/2026/hash/0f6294663c7392440f573225977436eb-Abstract-Conference.html).

## How the backdoor operates

In the tested threat model, the attacker controls training before distribution. Added training pairs associate a special instruction with reproducing previously seen training prompts beginning with a specified word. This behavior is learned on supplier data. The downstream user then fine-tunes on private examples, and the attacker queries the adapted model through its ordinary interface while varying opening words. At extraction time, the scenario needs neither the downstream weights nor direct access to the user's dataset. See [section 3](https://arxiv.org/html/2505.15656v2).

The authors connect the result with the fine-tuning loss. When user-prompt tokens contribute alongside answer tokens, training also encourages reproduction of prompts. The backdoor helps elicit that behavior through assistant output after downstream adaptation. The research explores supervised implantation and additional GRPO reinforcement learning, and finds that the effect can persist with LoRA and eight-bit quantization under tested conditions. See [sections 3–4 and Appendix M](https://arxiv.org/html/2505.15656v2).

The target is **query text from training pairs**, without necessarily recovering answers, full documents or every organizational secret. The attack assumes a compromised base model and query access to the adapted version. It does not demonstrate that every open LLM contains a backdoor or that any original developer can recover arbitrary users' data.

## What the experiment measured

Main experiments used Qwen2.5-7B and 32B, Llama 3.2-3B and Llama 3.1-8B. Supplier training and backdoor implantation used part of UltraFeedback. Downstream fine-tuning was simulated with 5000 examples each from Dolly and Finance-alpaca. More than 99% of these queries were absent from supplier data. An appendix also reports a MATH experiment. See [section 4 and Appendix E](https://arxiv.org/html/2505.15656v2) and the [authors' repository](https://github.com/thu-coai/Backdoor-Data-Extraction).

Query-level extraction is the share of original training queries reproduced exactly at least once. The reported **76.3%** is the maximum in a scenario without prior knowledge of the dataset's opening words: approximately 3815 of 5000 prompts, rather than 76.3% of generated answers. Accessible prose does not clearly identify the exact model, dataset and plotted point producing this maximum, so it cannot be assigned to every configuration. See the [abstract and section 4.4](https://arxiv.org/html/2505.15656v2).

A more favorable scenario supplies all true opening words in advance. The authors report **94.9%** for Qwen2.5-32B with sampling multiplier 200: generations per opening word equal 200 times the number of training queries with that beginning. This is an idealized estimate, distinct from extraction without prior knowledge. See [section 4.5 and Appendix B](https://arxiv.org/html/2505.15656v2).

Even the practical experiment involved substantial querying. Researchers considered 50–300 candidate opening words and generated 2000 responses per selected word. For 50 selected candidates, that means up to 100 thousand generations, with the actual count depending on selection. They compared backdoored models with similarly fine-tuned clean models. On Dolly, Qwen2.5-7B's mean token-match ratio was 13.4% without implantation and 29.8% after supervised backdoor training. That metric differs from the fraction of fully recovered prompts. See [Table 1 and section 4.4](https://arxiv.org/html/2505.15656v2).

Experiments used four NVIDIA A100 GPUs with 80 GB each. Main fine-tuning ran five epochs at learning rate 10⁻⁵; the authors omit GRPO results for the 32-billion-parameter Qwen because of limited compute. These describe research conditions, without establishing minimum attack hardware. See [Table 1 and Appendix O](https://arxiv.org/html/2505.15656v2).

## Implications for private-data fine-tuning

For teams choosing weights and training recipes, provenance and access to the resulting interface become part of the risk assessment. One experiment masked user tokens out of the downstream loss. On Dolly with Qwen2.5-7B, mean token matching fell from 29.8% to 5.2%; the authors describe extraction as effectively infeasible in this setting. This is promising evidence from one test, without proving a universal defense. Evaluate a changed objective alongside quality on the intended task. See [Appendix L](https://arxiv.org/html/2505.15656v2).

A simple extraction-style probe may expose suspicious behavior, but the authors demonstrate an artificial-trigger variant that evades that check. More fine-tuning epochs did not guarantee removal. Differentially private training reduced extraction in their experiment, with considerable quality degradation and approximately one-and-a-half times the time and memory cost. See [section 4.8 and Appendices F–G](https://arxiv.org/html/2505.15656v2).

Earlier independent work, [PreCurious](https://arxiv.org/abs/2403.09562), also examined maliciously prepared models increasing leakage after fine-tuning. Its threat model and metrics differ, so it cannot validate this paper's percentages. Review did not establish independent reproduction of the exact 76.3% and 94.9% results. Published author code supports investigation, without itself constituting replication.

The relationship between visible context and supervised targets is explained by the [padding-mask versus loss-mask distinction](/journal/padding-mask-loss-mask-difference/). Preserve the [software-stack composition and revisions](/journal/software-stack-reproducibility/) alongside base-model identity when reviewing an experiment's origin.

## Sources

- [arXiv preprint and version history](https://arxiv.org/abs/2505.15656).
- [Full revised paper](https://arxiv.org/html/2505.15656v2) and [ICLR 2026 conference PDF](https://proceedings.iclr.cc/paper_files/paper/2026/file/0f6294663c7392440f573225977436eb-Paper-Conference.pdf).
- [Official experiment repository](https://github.com/thu-coai/Backdoor-Data-Extraction).
- [PreCurious: related threat research](https://arxiv.org/abs/2403.09562).
