Skip to content

Teaching an LLM to phish: stealing private information from language modelsTeach LLMs to Phish: Stealing Private Information from Language Models

arXiv· arXiv:2403.00871· Ashwinee Panda, Christopher A. Choquette-Choo, Zhengming Zhang, Yaoqing Yang, Prateek MittalPrinceton University; Google DeepMind; Southeast University; Dartmouth CollegeIndexed by this site · 27 days ago· Originally publishedSelected AttacksSelectedAttention38

Quick read

Attacks

Based on the paper PDF (AI-generated); refer to the original

The authors propose the neural phishing attack: inserting dozens of poisoned sentences into training data to teach the model to memorize and, at inference time, output others' PII, with a 12-digit secret extraction rate of up to about 50%.

Threat modelThe attacker can insert dozens up to at most 100 roughly sentence-long benign-looking poisoned texts into training data, has only a vague structural prior about the secret prefix and does not know the secret itself; at inference the attacker has only black-box query access to the model's autoregressive generation. The victim system is an LLM fine-tuned on private data (or pretrained on poisoned data and then fine-tuned).

Questions
LLMs fine-tuned on private data memorize and regurgitate sensitive information. The authors investigate whether an attacker can, by inserting a small amount of benign-looking poisoned text into training data, actively induce the model to memorize others' PII and extract it.
Methods
Proposes a three-stage neural phishing attack: insert dozens of poisoned sentences constructed from vague priors during pretraining or fine-tuning, the secret is memorized as soon as it appears once during fine-tuning, and at inference the secret is extracted by querying the model with the secret prefix or a random perturbation of it.
Experiments and results
On Pythia models, 50 random poisonings achieve an SER of 10% in extracting 12-digit secrets; with a biography prior it reaches 40%; secret repetition, larger models, and longer pretraining all increase SER; the poisoning effect still remains after 10000 steps of clean training.
Limitations and future work
The authors note that poisoning must enter the training data before the secret; the experiments use only Pythia 1.4b–6.9b models and synthetic secrets, no explicit defenses were evaluated, and multi-secret extraction and code release are left as future work.
Experimental setupPythia-2.8b、Pythia-1.4b et al. · Enron Emails、Wikitext-103 et al. · Secret Extraction Rate (SER)
Evaluated models
Pythia-2.8bPythia-1.4bPythia-6.9b
Benchmarks
Enron EmailsWikitext-103The Pile
Metrics
Secret Extraction Rate (SER)
AI summaryand selection rationaleResearchers from Princeton and other institutions proposed a new attack called neural phishing, which injects a few dozen seemingly normal sentences into training data to induce large language models to memorize and leak users' private information. The attack targets the scenario in which enterprises fine-tune models on private data, and has three stages: poisoning, fine-tuning and inference. During fine-tuning the model memorizes a secret even if it appears only once (such as a 12-digit credit card number), and the attacker then extracts it via prompts, with a success rate between 10%-80%; without poisoning the attack never succeeds. The attacker only needs a vague prior about the structure of the user data and does not need to know the secret's content; the success rate rises with prior strength, the number of times the secret is repeated and model scale, and standard poisoning defenses such as deduplication are ineffective. The experiments are based on the Pythia model and the Enron Emails dataset; poisoning injected during pretraining persists, and after 10000 steps of clean-data training the model still has a 30% extraction success rate.

Researchers from Princeton and other institutions proposed a new attack called neural phishing, which injects a few dozen seemingly normal sentences into training data to induce large language models to memorize and leak users' private information. The attack targets the scenario in which enterprises fine-tune models on private data, and has three stages: poisoning, fine-tuning and inference. During fine-tuning the model memorizes a secret even if it appears only once (such as a 12-digit credit card number), and the attacker then extracts it via prompts, with a success rate between 10%-80%; without poisoning the attack never succeeds. The attacker only needs a vague prior about the structure of the user data and does not need to know the secret's content; the success rate rises with prior strength, the number of times the secret is repeated and model scale, and standard poisoning defenses such as deduplication are ineffective. The experiments are based on the Pythia model and the Enron Emails dataset; poisoning injected during pretraining persists, and after 10000 steps of clean-data training the model still has a 30% extraction success rate.

Why it was selectedThe paper shows that injecting a few dozen seemingly normal texts into training data can make a fine-tuned model leak user privacy, which teams fine-tuning models on private data can use to assess risk.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors propose neural phishing: using dozens of poisoned sentences to teach an LLM to memorize and output others' PII, without needing to know the secret or its exact prefix.

    Core question: Can an attacker, by inserting a small amount of benign-looking poisoned text into training data, induce an LLM fine-tuned on private data to memorize and extract other users' sensitive information (PII)?

    • Scenario and motivation: Enterprises fine-tune pretrained LLMs on private data (employee emails, internal wikis, etc.), and existing fine-tuning APIs support this usage; the authors consider verbatim memorization of training data by models to be a privacy risk of concern.
    • Shortcomings of existing methods: The authors state that prior training data extraction attacks (e.g., Carlini et al.) usually assume the attacker knows the prefix before the secret, and mainly target data repeated many times; the extraction success rate for an average sample is about 1%, and what is extracted is mostly harmless content such as software licenses.
    • Core observation: The authors believe it is possible to teach the model to generalize memorization of a certain type of pattern containing sensitive information (e.g., credit card numbers), rather than learning a fixed mapping from a prefix to a suffix, so the attacker only needs a fuzzy prior of the secret's structure.
    • Method proposed in the paper: The neural phishing attack, in three stages: poisoning, fine-tuning, and inference; the authors report a success rate of over 10%, sometimes as high as 50%, in extracting 12-digit secrets, requiring only dozens of poisoned sentences to be inserted.
    • Threat model:
      • Goal: Extract sensitive or PII strings (e.g., 12-digit credit card numbers) from a model trained on user data.
      • Knowledge: Does not know the secret itself, and has only a fuzzy structural prior about the secret prefix (e.g., knowing it is a user biography).
      • Capability: Insert dozens up to at most 100 poisoned documents about one sentence long into the training data; at inference time has only black-box query access (querying autoregressive generation).
      • Victim system: The enterprise scenario of fine-tuning a pretrained LLM on proprietary data, also covering pretraining poisoning and federated learning.
  2. What related research exists?

    Related work falls into three categories: training data extraction and memorization, data/model poisoning, and privacy defenses (DP and data cleaning); the authors state this attack makes weaker and more practical assumptions.

    Training data extraction and memorization

    • Carlini et al. (2019; 2021; 2023b)—propose and quantify training data extraction and verbatim memorization in language models; the authors note that these works usually assume the attacker knows the prefix before the secret and rely on the secret being repeated multiple times.
    • Biderman et al. (2023a), Tirumala et al. (2022), Anil et al. (2023)—analyze the emergence and training dynamics of LLM memorization; the authors cite Anil et al. as saying that memorization concentrates on highly repeated data.
    • Ippolito et al. (2022), Lukas et al. (2023), Huang et al. (2022)—study the limits of preventing verbatim memorization and PII leakage analysis.

    Data poisoning and model poisoning

    • Biggio et al. (2013), Jagielski et al. (2018), Geiping et al. (2021), Shafahi et al. (2018), etc.—untargeted or targeted data poisoning against model performance.
    • Zhang et al. (2022, Neurotoxin), Panda et al. (2022)—persistent backdoors in federated learning and model poisoning defenses; the authors note that prior work has never shown poisoning behavior persisting for 10000 steps.
    • Tramèr et al. (2022, Truth Serum)—using poisoning to amplify privacy leaks such as membership inference; the authors note that the attacker in this paper can only see greedy next-token decoding output, which is weaker than the full probability vectors assumed by Tramèr et al. and Lukas et al. and closer to an ordinary LLM user.

    Other forms of privacy attacks and defenses

    • Shokri et al. (2017), Choquette-Choo et al. (2021b), etc.—membership inference; the authors note that membership inference learns only one bit of information, whereas secret extraction must learn the entire secret.
    • Dwork et al. (2014), Abadi et al. (2016)—differential privacy; the authors note that DP cannot give tight privacy guarantees for repeated data, and that billion-parameter models currently cannot be efficiently fine-tuned.
    • Lee et al. (2021)—deduplication defense; the authors note that poisoned sentences can easily be varied to guarantee uniqueness, rendering deduplication ineffective.

    Baselines and benchmarks: baselines are a poisoning-free model (SER of 0) and a random poisoning attack; fine-tuning datasets are Enron Emails and Wikitext(-103), and the pretraining data is The Pile.

    The authors position this paper as: achieving extraction targeting PII under weaker attacker assumptions (no knowledge of the prefix, black-box output, the secret appears at most twice), with poisoned examples that look benign.

  3. How does the paper address this problem?

    Three stages: the poisoning stage inserts sentences constructed from vague priors, the fine-tuning stage memorizes the secret as soon as it appears, and the inference stage extracts the secret using the prefix or a random perturbation of it.

    The overall idea is neural phishing: the attacker uses poisoned data to teach the model to learn the pattern of a certain type of sensitive information, after which the model, during fine-tuning, sees the real secret once and memorizes it, and the attacker then extracts it through queries.

    Problem setting and definitions

    • Extractable secret (Definition 2.1): A secret string s is extractable if and only if there exists some prefix p such that the model generates s with p as the prefix, and s is in the training data. Unlike prior training data extraction, the attacker is not assumed to know p.
    • Data structure: User data is denoted p||s (non-sensitive prefix p + sensitive suffix s); poisoning is p′||s′, with p′≠p and s′≠s. In the implementation, the prefix is further split into prompt and suffix, where the suffix indicates the PII type, 8 types in total (credit card, social security number, bank account number, phone, home address, password, etc.).
    • Secret form: digit strings, with lengths corresponding to different PII (home address 4 digits, social security number 9, phone 10, credit card 12).

    Three-stage attack pipeline

    1. Phase I poisoning: The attacker manually constructs poisoning prefixes using a fuzzy prior, for example having GPT write celebrity biographies; the poisoning is mixed into pretraining or fine-tuning data. By default, N identical poisonings are inserted, with 1 inserted per batch to perform one gradient update.
    2. Phase II fine-tuning: The model is fine-tuned with standard techniques, and the secret (even if it appears only once) is included in the fine-tuning data; the attacker does not control the timing, length, or number of repetitions of the secret's appearance.
    3. Phase III inference: The attacker queries the model with a prefix, and success is when the model generates the secret digits. By default, no randomization strategy is used.

    Key designs

    • The "not" trick to prevent overfitting: Adding "not" before the poisoned digits (e.g., "credit card number is not: 123456") prevents the model from memorizing the poisoned digits themselves, so that SER keeps growing with the number of poisonings rather than being concave.
    • Randomized inference strategy: Apply N random perturbations to the real secret prefix (randomly replacing 10 categories of words such as name, age, occupation, shuffling sentence order), query N times, and then take a majority vote for each digit; the authors state this can exploit generalized memorization to extract the secret without knowing the exact prefix.
    • Prior as a multiplier: The attacker can choose a PII type and use text of the same kind as the secret prefix (e.g., a user biography) as the poisoning prefix.

    Evaluation method

    • Metric: Secret Extraction Rate (SER), the percentage of successful proportion over at least 100 seeds, reported with bootstrap 95% confidence intervals; each seed retrains the model and uses new poisoning and secrets.
    • Success criterion: After training, the model is prompted with the secret prompt or its variants, and success requires generating the complete secret digits; no partial credit is given.
    • Default setting: 2.8b parameter model, poisoning starts after pretraining ends, fine-tuning on Enron Emails, secret is 12 digits, repeated once, with the two secrets 100 iterations apart; optimizer AdamW, learning rate 5e-5, batch size 64 (Appendix D).
  4. What experiments did the paper conduct?

    Systematically measuring SER on Pythia 1.4b–6.9b: random poisoning reaches 10%, with a prior reaches 40%; secret repetition, larger models, and longer pretraining all increase SER.

    Experimental Setup

    • Models tested: Pythia series 1.4b, 2.8b, 6.9b parameter models (trainable on a single A100), using a pretraining intermediate checkpoint (50000 steps) and the final checkpoint (143000 steps).
    • Datasets: Enron Emails for fine-tuning; Wikitext-103 as clean data for durability experiments; The Pile as pretraining data.
    • Data generation: prompts generated by GPT-4, imitating everyday conversation; prefixes and suffixes for poisoning and secrets sampled from preset lists (Appendix F lists all templates).
    • Baselines: poisoning-free model (SER of 0, authors state extraction was never successful); random poisoning baseline.
    • Metric and criterion: SER, at least 100 seeds, bootstrap 95% confidence intervals; success defined as complete generation of the secret number.
    • Default configuration: 2.8b model, Enron Emails, 12-digit secret repeated once, interval of 100 iterations, AdamW (lr 5e-5, batch 64).

    Main Results

    The paper's results are mainly presented as figures; the pdftotext text retains only axes and captions, and the following numbers are taken from the plain text of the body and captions:

    Swipe horizontally to read the table

    ExperimentConditionSERSource
    Random poisoning50 poisoned, 12-digit secret, 2.8b10%Figure 2
    Random poisoning (caption)same as above15%Figure 2 caption
    Poisoning-free baseline—0% (never successful)Section 4 of body
    Prior: secret prefix itself25 poisoned2/3Figure 6
    Prior: Hamilton biography100 poisoned40%Figure 6
    21-digit secret not repeated100 poisonedat most 1%Figure 3
    21-digit secret repeated100 poisonednearly 20%Figure 3
    10000 steps after pretraining poisoning2.8b that did not complete pretraining30%Figure 8
    Worst case of poisoning at end of pretrainingafter 10000 stepsclose to 10%Figure 8
    • The authors state that under random poisoning the model often generates the first 6–9 digits correctly and then repeats, but no partial credit is given; the probability of randomly guessing a 12-digit number is 10^-12.
    • The authors state that after adding "not", SER no longer shows a concave shape and can keep growing up to 500 poisoned examples; due to compute, they only evaluated up to 100.
    • The authors state that priors can increase SER by up to 5 times; the cosine similarity/edit distance between the poisoned prefix and the secret prefix has little correlation with SER.

    Effects of Scale and Repetition

    • Secret repetition: the authors report that when the secret is repeated once, SER often more than doubles, increasing by about 20 percentage points (Figure 3); in the multi-secret setting, SER keeps rising when repetition increases to 5 times (Figure 13).
    • Model scale: SER rises with scale on 1.4b, 2.8b, 6.9b (Figure 4, 50 poisoned); the authors expect the attack to be more effective on larger models such as LLaMA-2-70b, but did not evaluate this due to compute.
    • Amount of pretraining: models that completed pretraining have higher SER than models at about 1/3 of the way through (Figure 5a); training longer on clean data before poisoning also increases SER (Figure 5b). The authors believe all three act by improving the model's performance on the training distribution.

    Experiments on Inference Strategies and Defenses

    • Randomized inference: randomly perturbing the secret prefix with 10 classes of words (ensemble size N=1) already increases SER (Figure 7); the authors state this verifies that extraction is possible without knowing the exact secret prefix.
    • Resistance to deduplication: using a different random perturbation for each poisoned example (all 100 unique), the attack still succeeds (circle points in Figure 7); the authors state deduplication defenses cannot cope because existing deduplication implementations require repeated substrings of N≥50, while the only thing repeated is the 12-digit random number.
    • Evading data cleaning: to bypass cleaning that deletes 12-digit number strings, a space is inserted every 3 digits in the poisoned number; the authors state that suffixes such as "you can reach me at" that contain no obvious PII can also transfer to credit card numbers.

    Durability and Multiple Secrets

    • Durability of pretraining poisoning: the poisoned behavior still has SER of 30% after 10000 steps of clean training in models that did not complete pretraining; considerable SER remains after 100000 steps (Figure 8).
    • Retention of secret memorization: after seeing the secret, extraction still succeeds with high SER after 400 steps of clean training; increasing the ensemble to 100 mitigates the decline, but after 1000 steps SER drops to 0 (Figure 9).
    • Multiple secrets: at most about 5 secrets can be extracted (Figure 10); the SER of extracting at least one secret after 4000 steps is still >20%, and drops to 0 after 10000 steps (Figure 11).

    Other Ablations and Analyses

    • Interval between poisoning and secret: under an exact prior, an interval of 1000 steps instead increases SER (Figures 15, 19); under fully random poisoning, waiting rapidly decreases ASR (Figure 18).
    • Spacing of repeated secrets: the larger the spacing (1→100 steps), the higher the SER (Figure 20).
    • Replacing the poisoned digits with all zeros instead of random digits decreases SER (Appendix E).
    • Too much poisoning early in pretraining has negative effects: clean-data performance decreases, and subsequent gradient signals erase the poisoned behavior (Figure 17).
  5. What are some points that can be further explored?

    The authors note that poisoning must appear before the secret, and that multi-secret extraction and code release are left for future work; experiments are limited to small Pythia models and synthetic secrets, and no explicit defenses were tested.

    Limitations and future directions noted by the authors

    • Poisoning order constraint (Section 7 Limitations): in all experiments, the poison must appear in the training data before the secret; if the poison comes after the secret and is too similar, the model may forget the secret.
    • Multiple-secret extraction (Section 2): the main study extracts a single secret to demonstrate feasibility; in-depth study of multiple secrets is left as future work.
    • Inference-time techniques (Section 2): inference-time techniques such as in-context learning or jailbreak are not considered and are left as future work.
    • "dummy" replacement PII defense (Appendix B): the authors plan to evaluate a defense that inserts replacement PII in future research.
    • DP defense (Appendix B): efficient fine-tuning of billion-parameter models is currently not possible, and the authors believe that studying DP defenses against neural phishing will be interesting once methods mature in the future.
    • Code release (Appendix D): the authors state that, due to responsible disclosure concerns, they are currently not seeking approval for code release.

    Scope of experiments

    • Models tested are Pythia 1.4b, 2.8b, and 6.9b, 3 sizes in total; larger models (such as LLaMA-2-70b and Falcon-180b) were not evaluated due to compute (Section 4.1).
    • Secrets are synthetic digit strings (4–21 digits); fine-tuning data are Enron Emails and Wikitext-103; no experiments were run on real user PII data.
    • Each data point has at least 100 seeds, and bootstrap 95% confidence intervals are reported; the paper does not report the specific number of seeds for each figure (Appendix D says a complete list will be provided).
    • No explicit defenses were evaluated (Appendix A states explicitly that explicit defenses are not considered); deduplication and data cleaning are discussed only as argument and design avoidance.
    • The attacker capability assumes the secret can be attempted for extraction at each step; Section 6 and Appendix C relax this assumption with waiting-step experiments.
  6. Summarize the main content of the paper

    neural phishing uses dozens of poisoned sentences to teach an LLM to memorize others' PII, with a 12-digit secret extraction rate of 10%–50%; the effect grows with repetition, scale, and pretraining amount, and is persistent.

    A paper on LLM privacy attacks (ICLR 2024) that proposes neural phishing: the attacker inserts dozens of benign-looking poisoned sentences into training data, teaching the model to learn to memorize patterns containing sensitive information, so that a real secret in the fine-tuning data can be extracted even when it appears only once or twice.

    • Problem addressed: prior training data extraction attacks assume the attacker knows the secret prefix and rely on the secret being repeated many times; this paper relaxes the assumptions to only a vague structural prior, the secret appearing at most twice, and black-box queries.
    • Method highlights: three stages—construct poisoned prefixes from the prior and insert them into training data; the model memorizes the secret during standard fine-tuning; extract by querying with the secret prefix or a random perturbation of it (majority vote). Adding "not" prevents the model from overfitting to the poisoned digits.
    • Main results:
      • 50 random poisoned examples extract a 12-digit secret with SER of 10% (Figure 2); without poisoning it never succeeds.
      • When the poisoned prefix equals the secret prefix, 25 poisoned examples succeed 2/3 of the time; with the Hamilton biography as prior, 100 poisoned examples reach 40% (Figure 6).
      • Repeating the secret once increases SER by about 20 percentage points; SER rises with model scale (1.4b→6.9b) and amount of pretraining (Figures 3–5).
      • Pretraining poisoning still has SER of 30% after 10000 steps of clean training (Figure 8); in the multi-secret setting, the SER of extracting at least one secret after 4000 steps is >20% (Figure 11).
      • Making all poisoned sentences unique bypasses deduplication, and inserting spaces in digits bypasses cleaning that deletes by length (Figure 7, Appendix B).
    • Authors' conclusion: the authors believe future work should acknowledge the possibility of neural phishing and adopt defenses to ensure LLMs do not leak privacy when trained on private user data; the authors expect the attack to be more effective on larger models.

Related papers

Both use: Wikitext-103
Show 3 more papers
Both use: Enron Emails
Read originalarxiv.org