Skip to content

Privacy Auditing of Large Language ModelsPrivacy Auditing of Large Language Models

arXiv· arXiv:2503.06808· ICLR 2025· Ashwinee Panda, Xinyu Tang, Milad Nasr, Christopher A. Choquette-Choo, Prateek MittalPrinceton University; Google DeepMindIndexed by this site · 27 days ago· Originally publishedAttacks

Quick read

Attacks

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

The authors propose a canary design that is more easily memorized, raising TPR@1%FPR from 4.2% to 49.6% on Qwen2.5-0.5B, and give a lower-bound audit of ε≈1 for DP training with ε=4.

Threat modelThe attacker injects canaries (prefix + secret token) into the training data and uses loss-based membership inference to determine whether they are members. Auditing uses a black-box setting: the attacker can only see the final model, can only access logprobs, cannot train shadow models, cannot insert gradient canaries, cannot access each iteration.

Questions
Existing LLM privacy auditing uses random canaries for membership inference; the attack is weak and the resulting privacy leakage lower bounds are loose, so model developers may systematically underestimate leakage; previously no method could give a non-trivial DP auditing lower bound for LLM training in the black-box setting.
Methods
The authors design canaries that are easier for models to memorize: unigram/bigram select low-frequency tokens as secrets, model-based selects the continuation the model is least likely to generate, and new token directly introduces a new token that never appeared during training; combined with the simplest loss-threshold membership inference and the single-training-run audit procedure of Steinke et al. (2023).
Experiments and results
Among 10 fine-tuned models on PersonaChat, the designed canaries generally exceed the random baseline, e.g., on Qwen2.5-0.5B TPR@1%FPR rises from 4.2% to 49.6%; DP auditing gives an empirical lower bound of ε≈1 (99% CI) at theoretical ε=4, while the random canary lower bound is 0.
Limitations and future work
The authors note that DP auditing requires random tokens as prefixes and cannot give a clear signal for in-distribution data with semantics; experiments only cover open-source models of 124M–3B, the two datasets PersonaChat and E2E, and the attack requires access to model logprobs.
Experimental setupgpt2-small、gpt2-large et al. · PersonaChat、E2E · TPR at 1% FPR、audited ε lower bound (95%/99% CI) et al.
Evaluated models
gpt2-smallgpt2-largegpt2-xlpythia-160mpythia-410mpythia-1.4bQwen2.5-0.5BQwen2.5-1.5BQwen2.5-3BLlama-3.2-1B
Benchmarks
PersonaChatE2E
Metrics
TPR at 1% FPRaudited ε lower bound (95%/99% CI)validation perplexity
AI summaryResearchers propose a stronger canary design for privacy auditing and membership inference testing of large language models. On Qwen2.5-0.5B, the method achieves a TPR of 49.6% at a 1% false positive rate, whereas the same metric for prior methods is 4.2%. The authors claim that for a model trained with a theoretical ε of 4, the method can give a privacy audit result of ε≈1. The authors also claim that, to their knowledge, this is the first non-trivial audit success in a setting where the attacker cannot train shadow models, insert gradient canaries, or access the model iteration by iteration.

Researchers propose a stronger canary design for privacy auditing and membership inference testing of large language models. On Qwen2.5-0.5B, the method achieves a TPR of 49.6% at a 1% false positive rate, whereas the same metric for prior methods is 4.2%. The authors claim that for a model trained with a theoretical ε of 4, the method can give a privacy audit result of ε≈1. The authors also claim that, to their knowledge, this is the first non-trivial audit success in a setting where the attacker cannot train shadow models, insert gradient canaries, or access the model iteration by iteration.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Existing canaries are too weak, causing LLM privacy audit lower bounds to be too loose; the authors design canaries that are easier to memorize in order to tighten the lower bounds.

    Core problem: The canaries used in existing LLM privacy audits are hard for models to memorize, resulting in weak membership inference attacks, overly loose empirical privacy leakage lower bounds, and systematic underestimation of privacy leakage by model developers.

    • Problem setting: Model developers insert canaries and test the degree of memorization to quantify memorization, and the conclusion is often "the model does not memorize much" (e.g., Anil et al., 2023; Reid et al., 2024); whereas data extraction research specifically extracts the "most extractable" data, and there is a gap between the two conclusions. The authors believe the gap stems from the inserted canaries not being the kind that is easiest to memorize.
    • Shortcomings of existing methods: The authors state that previously no privacy audit method could give a non-trivial lower bound for LLMs with realistic DP guarantees (ε < 10) under a black-box setting, using real data, in a single training run; Steinke et al. (2023) only audited computer vision models.
    • Core observation: Not all OOD samples are equally easy to memorize; the embedding table is large and only sparsely updated, rows corresponding to tokens that never appear during training receive no gradients, and the model behaves differently on such tokens than on trained tokens, which can be used to construct canaries guaranteed to have high loss.
    • Paper proposes: Three input-space canary generation methods (unigram, bigram, model-based) and one new token canary, combined with the simplest loss-threshold MIA and the single-run audit procedure of Steinke et al. (2023).
    • Threat model:
      • Goal: Estimate the worst-case privacy leakage (ε lower bound) of model training via membership inference on canaries.
      • Knowledge: The attacker has increasing prior knowledge of the training data distribution (word frequency, N-grams, or black-box queries to the model before insertion); the auditor (model developer) can directly modify the vocabulary.
      • Capability: Inject canaries into the training data; under the black-box setting can only see the final model, can only access logprobs, cannot train shadow models, cannot insert gradient canaries, cannot access each iteration.
      • Victim system: Open-source LLMs fine-tuned on PersonaChat/E2E or trained with DP-SGD.
  2. What related research exists?

    Related work covers four groups: privacy attacks, LLM membership inference, privacy auditing methods, and DP language model training.

    Privacy attacks in machine learning

    • Shokri et al. (2017), Choquette-Choo et al. (2021), Carlini et al. (2022a), etc.—membership inference; Yeom et al. (2018), Fredrikson et al. (2015)—attribute inference; Carlini et al. (2019; 2021; 2023b), etc.—data extraction. The attack in this paper is based on membership inference and requires model logprobs to compute loss.
    • Morris et al. (2024), Carlini et al. (2024)—show that even if the API does not directly output logprobs, attackers may still obtain them.

    Membership inference on LLMs

    • Shi et al. (2024)—proposes the heuristic attack Min-K% for detecting pretraining data, and gives cases such as copyrighted data detection and dataset contamination detection.
    • Kandpal et al. (2024)—extends membership inference to user data collections ("user inference").
    • Duan et al. (2024)—after evaluating multiple MIAs, concludes they are largely ineffective on LLMs, attributed to factors such as single-epoch training; Meeus et al. (2024), Das et al. (2024), Eichler et al. (2024) consider distribution shift the main cause of MIA success. The paper notes that its member/non-member samples are IID sampled, so this distribution shift problem does not exist.

    Privacy auditing methods

    • Steinke et al. (2023)—a method that can audit with a single training run, adopted directly in this paper; the paper notes it cannot give non-trivial results in the black-box real-data setting, and only audited computer vision models.
    • Nasr et al. (2023)—tight auditing results but requires multiple runs; Pillutla et al. (2023)—reuses historical training runs to improve efficiency; Annamalai & Cristofaro (2024)—uses model initialization to enhance distinguishability.
    • Kazmi et al. (2024) (PANORAMIA)—estimates privacy leakage but does not give an ε lower bound; the paper emphasizes that this paper returns a provable ε lower bound.

    Privacy-preserving language models

    • DP-SGD is used for pretraining (Anil et al., 2021; Ponomareva et al., 2022) and fine-tuning (Panda et al., 2024b); other work on parameter efficiency, new clipping, hyperparameter tuning, zeroth-order optimization, DP in-context-learning, etc. improves the usability of DP-SGD and is orthogonal to this paper.

    Baseline and positioning: the baseline canary is the random canary used in prior work (prefix and secret each 50 random tokens, Anil et al., 2023; Gemini-Team et al., 2023), with PersonaChat and E2E as benchmarks. The authors claim this paper is the first to give non-trivial auditing results for LLMs, and the first to systematically evaluate LLM training memorization rates from the perspective of canary design.

  3. How does the paper address this problem?

    Use canaries that are easier to memorize (low-frequency tokens, new tokens) with the simplest loss-threshold MIA, then perform single-run DP auditing.

    Overall approach: do not change the attack statistic; instead design the canary itself to be more easily memorized by the model, so that even the simplest loss-threshold membership inference achieves high TPR, thereby tightening the memorization rate measurement and the ε lower bound of DP auditing. The method includes three input-space canaries and one new token canary.

    Canary setup

    • Canary structure: a canary is the concatenation of a prefix and a secret, two token segments; the secret defaults to 1 token (Table 2 ablation increases it to 8).
    • MIA method: uses the loss-threshold attack of Yeom et al. (2018), where loss ≤ threshold τ is judged as a member; the authors say the simplest MIA was chosen to show the method generalizes.
    • Training objectives: fine-tuning uses prefix language modeling (SFT, prefix loss is masked, gradients taken only on canary tokens); pretraining uses next word prediction (NWP, loss computed over the whole sequence).
    • Scale: 1000 canaries, corresponding to a fine-tuning dataset of 3.6×10^7 tokens, with canaries accounting for 0.0027%; prefixes are taken from 1000 non-duplicate samples of the test set (Section 5), and DP auditing switches to random token prefixes (Section 6).
    • Sampling principle: members and non-members are IID sampled from the same distribution, avoiding MIA success being attributable to distribution shift.

    Three input-space canaries

    • Formal goal: choose the secret token xt so that, given the prefix, p(xt ∣ x1:t−1) is low (loss is high), and it must be estimable before training.
    • unigram canary: uses the dataset's token frequency table and selects the lowest-frequency token as the secret.
    • bigram canary: fits a bigram model and generates token pairs (x, y) such that y is unlikely to follow x, and x is unlikely to follow the token preceding the insertion position.
    • model-based canary: the attacker has black-box access to the model before inserting the canary and directly queries the model for the least likely continuation under the prefix; the authors note this requires training two models or approximating with an old model.

    New token canary

    • Mechanism: the model developer introduces into the vocabulary a new token that never appears in training, used only for the canary secret; because the embedding table is large and only sparsely updated, these tokens guarantee high loss for any prefix.
    • Basis: the authors note that recent model releases such as Mistral and LLama already contain untrained special tokens in their embeddings; after training these embedding rows can be removed or reinitialized without noticeably affecting utility.
    • Positioning: the authors say the new token carries less semantic information than other canaries, but because DP-SGD guarantees hold for any fixed initialization, this is still a valid privacy audit.

    DP auditing procedure

    • Auditing method: uses the single-run procedure of Steinke et al. (2023): randomly generate 1000 canaries, insert half, perform membership inference on the full set, and convert MIA accuracy into an ε lower bound at a 95% (or 99%) confidence interval; the number of attacker guesses is 100, at which 100 correct guesses correspond to an empirical ε upper bound of 2.99 (99% CI, δ=10^-5).
    • Setup: always uses the black-box setting (sees only the final model, accesses only logprobs); theoretical ε=4; uses SFT loss; prefixes use random tokens (Table 8 verifies this choice is necessary for DP auditing).
    • Success criterion: memorization rate evaluation uses TPR@1%FPR (following Carlini et al., 2022a); DP auditing uses the empirical ε lower bound, the higher the closer to the theoretical ε.
  4. What experiments did the paper conduct?

    The designed canaries generally exceed the random baseline across 10 models, and DP auditing gives a 99% CI lower bound of ε≈1 for theoretical ε=4.

    Experimental setup

    • Models tested: 10 models across 4 series—GPT2 (small/large/xl), Pythia (160m/410m/1.4b), Qwen2.5 (0.5B/1.5B/3B), Llama-3.2-1B; vocabulary sizes cover 50k (GPT2, Pythia), 128k (Llama), 150k (Qwen).
    • Datasets: PersonaChat and E2E (the two datasets used in prior DP evaluations); canary subsampling rate q=0.01, training for T=100 steps to approximate single-epoch training.
    • Baseline: random canary (random secret token).
    • Metrics: MIA TPR@1%FPR; DP audit empirical ε lower bound (95% and 99% CI); validation set perplexity.
    • Training details: single A100; each model sweeps 5 learning rates in [2e-5, 5e-4], and the learning rate with the best validation PPL is used to measure MIA (Figure 4); DP auditing uses the Steinke et al. (2023) procedure, 1000 canaries with half inserted, theoretical ε=4.
    • Not reported: The paper does not report the number of repeated runs or variance.

    Main results

    Figure 2 (PersonaChat, SFT objective, TPR@1%FPR, per the paper's values):

    Swipe horizontally to read the table

    Modelrandomunigrambigrammodel-basednew
    gpt2-small0.0440.1140.2020.0660.424
    gpt2-large0.2540.4080.4820.2800.630
    gpt2-xl0.4280.5600.5900.5040.564
    pythia-160m0.0120.2240.0460.0460.608
    pythia-410m0.4180.4980.5620.5360.584
    pythia-1.4b0.4060.4920.5080.4920.430
    Qwen2.5-0.5B0.0420.1500.1920.0720.496
    Qwen2.5-1.5B0.1200.1500.1680.1900.364
    Qwen2.5-3B0.1980.2200.2580.1860.460
    Llama-3.2-1B0.4420.4960.5240.3920.282
    • The authors state that the designed canaries consistently exceed the random baseline, and the new token canary performs stably across model sizes; but there are exceptions in the table: on pythia-1.4b new (0.430) is lower than bigram (0.508), and on Llama-3.2-1B new (0.282) is lower than random (0.442).
    • The authors believe unigram and bigram are better on larger models because large models can accurately learn N-gram priors; and believe that leakage reports relying only on random canaries (e.g., Anil et al., 2023; Gemini-Team et al., 2023) may underestimate privacy leakage.
    • The E2E dataset (Table 1) shows consistent trends: e.g., under the NWP objective, pythia-160m's new is 0.446 and random is 0.012.

    DP audit results

    • Main table (Table 3, gpt2, theoretical ε=4): At 99% CI, the new token canary gives audit ε=1.01 on both LoRA-E2E and FFT-PersonaChat, 0.86 on FFT-E2E, and 0.54 on LoRA-PersonaChat; the random canary has a 99% CI lower bound of 0.0 in all four settings. The authors state this is an empirical ε≈1 obtained for theoretical ε=4 without shadow models, with input-space canaries and loss-based MIA.
    • Cross-model (Table 4, PersonaChat, FFT, new token): At 95% CI, gpt2 0.84, gpt2-large 1.28, gpt2-xl 1.29, Pythia-160M 0.40, Pythia-410M 0.67, Qwen2.5-0.5B 0.96; Pythia-160M is the only "poor" audit, and the authors note that this model cannot be trained to reasonable performance.
    • Correlation observation (Figure 6): The authors state that audit performance roughly correlates with log validation PPL (R²=0.755), i.e., better-trained models yield tighter audits.
    • Utility cost (Table 5, PersonaChat eval PPL): Without privacy, adding canaries goes from 16.1 to 16.7; at ε=4, from 22.5 to 23.3; the authors state that adding the new token canary worsens PPL by about 1; in Table 3, random, unigram, and bigram canaries do not degrade PPL, which the authors view as a trade-off between memorizing canaries and learning the clean data distribution.

    Other ablations and analyses

    • Canary length (Table 2): Increasing the secret from 1 to 8 tokens improves MIA success, e.g., gpt2-small's unigram rises from 0.114 to 0.386; at 8 tokens unigram exceeds random.
    • Training objective (Figure 3 vs Figure 2): Switching to the NWP objective worsens MIA TPR overall, but bigram and new still exceed random on Pythia and Qwen; in Table 9, DP auditing with NWP gives a lower bound of 0.0 (SFT is 0.84, 95% CI).
    • Learning rate (Figure 5): MIA success is sensitive to learning rate, and the new token canary is more robust; for Llama3.2-1B, raising the learning rate from 2e-5 to 5e-5 raises PPL from 9.43 to 10.07, and new's TPR rises from 28.2% to 54.6%.
    • Subsampling rate (Table 6, T=1000): At q=0.01 the audit 95% CI is 0.43, at q=0.1 it is 0.84; the authors state this verifies the necessity of a larger subsampling rate.
    • Training steps (Table 7, q=0.1): At T=10 the audit lower bound is 0, at T=100 the 95% CI is 0.91, at T=1000 it is 0.84.
    • Prefix choice (Table 8): The audit 95% CI with random token prefixes is 0.84, with test data prefixes 0.63; the authors explain this as the model having to compete between natural continuation and canary tokens under in-distribution prefixes.
    • LoRA rank and embeddings (Appendix Table 12, 13): The AUC difference between rank 4 and 512 is only 0.02; when LoRA freezes embeddings the audit fails (99% CI all 0) and PPL worsens; in the main text LoRA always updates embeddings.
  5. What are some points that can be further explored?

    The authors note that DP auditing requires random prefixes, cannot cover semantic data, and propose using this paper's method to improve data extraction attacks.

    Limitations and future directions noted by the authors

    • Limitation of random prefixes (Section 6.3, discussed in Table 8): DP auditing requires random tokens as prefixes, meaning an attacker doing MIA cannot get a clear signal for in-distribution data with semantics; the authors also note that under the audit threat model this does not constitute a limitation for the method, and call it a "clear future work direction."
    • New tokens carry less semantic information (Section 4.3): The new token canary has less semantic information than other canaries when measuring LLM memorization rates, because new tokens have no concrete semantics; the authors argue it remains effective for privacy auditing.
    • Cost of model-based canary (Section 4.2): This strategy requires training two models or approximating with a past model.
    • Improving data extraction attacks (Section 2): The authors consider using this paper's method to improve existing data extraction attacks an interesting future direction (e.g., using knowledge of "outlier" tokens to iteratively guide decoding).
    • Combining with new MIAs (Section 3.1): The authors state that this paper's contribution is complementary to future work developing new MIAs, and new attacks can leverage this paper's canary technique.

    Experimental coverage

    • The models tested are 10 open-source models across four series—GPT2, Pythia, Qwen2.5, Llama3—with parameter sizes 124M–3B (Table 10, 11).
    • The datasets are PersonaChat and E2E; fine-tuning experiments use q=0.01, T=100 to approximate single-epoch training, and the main DP audit results use q=0.1, T=1000, theoretical ε=4.
    • The attack always requires access to model logprobs; the paper cites Morris et al. (2024) and Carlini et al. (2024) to show that logprobs may still be obtainable when not directly output, but this paper's experiments did not verify under that condition.
    • The cross-model DP audit table (Table 4) covers 6 models, all using new token canary, PersonaChat, FFT.
    • The paper does not report the number of repetitions or variance information beyond confidence interval widths; the appendix mentions evaluating license information for Gemma and Mistral, but the main results tables do not include numbers for these two models.
  6. Summarize the main content of the paper

    Redesigning the canary strengthens the simplest MIA, tightening both memorization measurement and DP audit lower bounds.

    An attack paper on LLM privacy auditing (ICLR 2025) whose core claim is: rather than improving the statistics of membership inference attacks, design the auditing canary to be more easily memorized by the model.

    • Problem to solve: developers using random canaries to measure memorization often conclude "not much memorization," which contradicts findings from data extraction research; weak canaries lead to weak MIA, loose empirical lower bounds on privacy leakage, and previously no method could give a non-trivial auditing lower bound for DP training of LLMs in the black-box setting.
    • Method highlights: three input-space canaries—unigram selects the lowest-frequency token, bigram selects token pairs unlikely to be adjacent, model-based queries the model for the least likely continuation; and a new token canary—introduces into the vocabulary a token that never appears in training, exploiting the sparse-update property of the embedding table to guarantee high loss. The attack uses the loss-threshold MIA of Yeom et al. (2018), and DP auditing uses the single-run procedure of Steinke et al. (2023).
    • Memorization rate results: on PersonaChat, SFT objective, Qwen2.5-0.5B's TPR@1%FPR rises from 4.2% for random to 49.6% for new token (Figure 2); the designed canaries generally exceed the random baseline across 10 models, but on pythia-1.4b and Llama-3.2-1B new token is not the highest.
    • DP auditing results: for gpt2, theoretical ε=4, the new token canary gives a 99% CI lower bound ε=1.01 on LoRA-E2E and FFT-PersonaChat, whereas the random canary lower bound is 0.0 (Table 3); the authors call this the first non-trivial LLM privacy audit without shadow models and with input-space canaries.
    • Costs and conditions: adding the new token canary worsens PersonaChat eval PPL by about 1 (Table 5); auditing requires a relatively large subsampling rate (q=0.1), enough training steps (T≥100), the SFT objective, and a random token prefix.
    • Authors' conclusion: leakage reports relying only on random canaries may systematically underestimate privacy leakage; the auditing in this paper can run in parallel with standard DP training, providing a lower bound for privacy parameters.

Related papers

Read originalICLR 2025