Skip to content

Measuring the extent to which a model forgets memorized training samplesMeasuring Forgetting of Memorized Training Examples

arXiv· arXiv:2207.00099· Matthew Jagielski, Om Thakkar, Florian Tramèr, Daphne Ippolito, Katherine Lee, Nicholas Carlini, Eric Wallace, Shuang Song, Abhradeep Thakurta, Nicolas Papernot, Chiyuan ZhangGoogle; University of Pennsylvania; Cornell University; University of California, Berkeley; University of TorontoIndexed by this site · 27 days ago· Originally publishedAttacks

Quick read

Analysis and theory

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

The authors propose measuring a model's forgetting of training samples by the success rate of privacy attacks; the authors state that image, speech and language models all forget early samples, whereas deterministic training does not forget.

Questions
Models both memorize training data (bringing privacy risk) and forget early samples; the authors want to clarify whether forgetting weakens privacy attacks such as membership inference, that is, whether early samples gain passive privacy benefits as training proceeds.
Methods
The authors define (A, α, k)-forgetting: k steps after a sample last participated in training, the attack success rate does not exceed α. They design two injection strategies, POISON and INJECT, continuously monitor the attack success rate with calibrated membership inference and canary extraction, and theoretically analyze the conditions for forgetting.
Experiments and results
The authors state that models on ImageNet, LibriSpeech and C4 all forget: on LibriSpeech, exposure dropped from 14.0 to 5.6 within 10,000 steps after removal; samples with more repetitions and higher difficulty are forgotten more slowly; no forgetting occurs under k-means-constructed tasks and deterministic SGD.
Limitations and future work
The authors note that the measurement method is inherently heuristic, cannot prove that forgetting occurred, and depends on the current strongest attack. Experiments cover ImageNet, LibriSpeech, C4, FMNIST and k-means-constructed tasks; ImageNet results are averaged over 3 trials.
Experimental setupResNet-50、Conformer (L) et al. · ImageNet、LibriSpeech et al. · MI accuracy、precision @ FPR=10% et al.
Evaluated models
ResNet-50Conformer (L)decoder-only, 110M parameter, Transformer-based language model (T5 codebase and architecture)ResNet-18ResNet-34ResNet-101k-meanslogistic regression
Benchmarks
ImageNetLibriSpeechC4 (MinHash 去重版)FMNIST
Metrics
MI accuracyprecision @ FPR=10%precision @ FPR=2%exposure
AI summaryMatthew Jagielski and other researchers propose a method to measure the extent to which a model forgets memorized training samples, and find that standard image, speech, and language models forget training samples over time. The paper connects the two phenomena of memorization and forgetting: memorization causes a model to overfit to specific training samples and be vulnerable to privacy attacks; forgetting refers to samples seen early in training being forgotten by the end of training, at which point the model is less vulnerable to privacy attacks on samples not seen again recently. Experiments show that non-convex models may in the worst case memorize data permanently; the authors identify nondeterminism as a potential explanation for model forgetting, and deterministically trained models do not forget. This result suggests that when training on very large datasets, samples seen first (for example, samples used for pretraining) may obtain privacy benefits, at the cost of samples seen later.

Matthew Jagielski and other researchers propose a method to measure the extent to which a model forgets memorized training samples, and find that standard image, speech, and language models forget training samples over time. The paper connects the two phenomena of memorization and forgetting: memorization causes a model to overfit to specific training samples and be vulnerable to privacy attacks; forgetting refers to samples seen early in training being forgotten by the end of training, at which point the model is less vulnerable to privacy attacks on samples not seen again recently. Experiments show that non-convex models may in the worst case memorize data permanently; the authors identify nondeterminism as a potential explanation for model forgetting, and deterministically trained models do not forget. This result suggests that when training on very large datasets, samples seen first (for example, samples used for pretraining) may obtain privacy benefits, at the cost of samples seen later.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Does forgetting during training give early samples passive protection against privacy attacks over time, and how is it measured?

    Core question: does the phenomenon of models "forgetting" early samples during training reduce the risk of these samples being subjected to privacy attacks (membership inference, training data extraction), and how can this forgetting be measured.

    • Problem setting: The authors note that models are increasingly trained for only a few epochs (or even one epoch) on extremely large datasets, or pretrained and then fine-tuned, so samples are seen very different numbers of times; early-seen samples (such as pretraining data) may be forgotten due to many subsequent updates.
    • Two opposing hypotheses: The authors aim to distinguish two hypotheses — memorization is stronger than forgetting (traces of early samples remain detectable long-term), or forgetting is stronger than memorization (early samples are forgotten as training proceeds).
    • Shortcomings of existing methods: Active defenses such as differential privacy and machine unlearning require modifying the training process; catastrophic forgetting research measures forgetting with accuracy, but the authors argue that a drop in accuracy does not mean the traces of individual samples are undetectable, and does not directly correspond to privacy.
    • Core observation: The authors believe that the training dynamics inherent in algorithms such as SGD may passively provide a kind of privacy; randomness (such as random data sampling) may be the source of forgetting.
    • What the paper proposes: A method for measuring forgetting by the success rate of privacy attacks (two injection strategies, POISON and INJECT), empirical evidence of forgetting on image, speech and language models, two counterexamples where forgetting does not occur (k-means and deterministic SGD), and a theoretical explanation on the mean-estimation task.
    • Threat model (the attack setting the paper uses to measure forgetting):
      • Adversary's goal: Determine whether the target sample is in the training set (membership inference), or recover injected canaries (training data extraction).
      • Adversary's knowledge: Can obtain the model after training ends; in the ImageNet experiments the adversary also knows the intermediate checkpoint before injection (used to calibrate logits), which the authors state represents a strong adversary.
      • Adversary's capability: Accesses the model only once after training ends and does not observe intermediate updates (the authors note that repeatedly releasing updates would strengthen the attack; this paper does not release intermediate models).
      • Victim systems: Models trained on ImageNet, LibriSpeech, C4 and FMNIST, and the constructed k-means task.
  2. What related research exists?

    Related work covers privacy definitions and attacks, catastrophic forgetting, and three empirical studies of forgetting; the authors position the differences in terms of attack strength and task coverage.

    Privacy definitions and active defenses

    • Differential privacy (Abadi et al. 2016, etc.) — limits single-sample information leakage by modifying the training or inference process, and provably bounds the success rate of privacy attacks; the authors position it as a framework for actively obtaining privacy, and this paper's method is a complement to it rather than a replacement.
    • Machine unlearning (Cao & Yang 2015; Bourtoule et al. 2021, etc.) — eliminates individual contributions in response to deletion requests, covering k-means, empirical risk minimization and deep learning; the authors note that after perfect unlearning, attacks targeting individuals cannot succeed, but this is also an active mechanism that requires modifying training.

    Privacy attacks (the measurement tools of this paper)

    • Membership inference (Shokri et al. 2017; Yeom et al. 2018) — determines whether a queried sample is in the training set by thresholding its loss; the current best attacks (Carlini et al. 2021, etc.) calibrate the threshold for each sample.
    • Training data extraction and canary extraction (Carlini et al. 2019, 2021) — inject canaries into the training set and measure extractability with exposure; this paper follows Tramèr et al. 2022 and calibrates canary losses with multiple reference models.

    Forgetting-related research

    • Catastrophic forgetting (French 1999; McCloskey & Cohen 1989, etc.) — performance degradation on old tasks in continual learning; the paper notes that it concerns accuracy over an entire subdistribution, which differs from this paper's definition of forgetting, which targets individual samples and is motivated by privacy.
    • Feldman et al. 2018 — theoretically proves that iterative differentially private algorithms can exhibit forgetting (earlier samples have better privacy bounds); the authors note that provable bounds are often loose, and this paper examines whether early samples are also empirically more private.
    • Tirumala et al. 2022 (parallel work) — finds that large language models forget early samples; the paper notes that their definition of forgetting captures only one kind of leakage, verbatim reproduction of training samples by the model, whereas this paper considers stronger attacks and multiple worst-case measurement strategies, and covers more data domains.
    • Graves et al. 2021 — examines forgetting in the context of machine unlearning and finds that continual retraining is too slow to replace unlearning algorithms with forgetting; the paper notes that their conclusion holds only on small datasets, whereas this paper targets large-model training and measures the time required for forgetting.
    • Hyland & Tople 2019 — uses randomness to improve differentially private training on small datasets; this paper identifies training randomness as a possible cause of forgetting.

    Baselines and benchmarks: This paper is a measurement-method study and has no comparison baseline methods; the experimental benchmarks are ImageNet, LibriSpeech, C4 (MinHash-deduplicated version) and FMNIST, and the attack tools are calibrated membership inference and canary extraction.

    The authors position this paper as: using the strongest attacks in privacy auditing to measure worst-case forgetting across multiple data domains, and providing a theoretical explanation of why forgetting occurs.

  3. How does the paper address this problem?

    Define (A, α, k)-forgetting by the success rate of privacy attacks, inject samples with POISON/INJECT and continuously monitor the attack success rate, then use theoretical analysis to explain the causes.

    Overall approach: define "forgetting" as the phenomenon in which the success rate of privacy attacks decays with training steps, borrow privacy auditing methods to inject samples that must be memorized, and continuously run attacks to measure the rate of forgetting; then explain the source of forgetting with a constructive counterexample and mean-estimation theory. The core framework is (A, α, k)-forgetting and the two measurement strategies POISON / INJECT.

    Definition of forgetting

    • Definition 3.1: A training algorithm T satisfies (A, α, k)-forgetting for sample z if, k steps after z last participated in training, the success rate of privacy attack A does not exceed α. For example, when A is membership inference and α=50% (random guessing), after k steps the attack cannot distinguish whether the model was trained on z.
    • Relation to DP and unlearning: Differential privacy requires all attacks to perform poorly already at k=0, and machine unlearning requires all attacks to fail completely; forgetting allows a small success rate α and occurs naturally after some steps without intervention.
    • Worst-case orientation: Running membership inference directly on samples at each training stage yields only an average-case analysis; the authors instead adopt the privacy auditing approach, constructing a sample set Dp that the model must memorize in order to classify correctly, and measure worst-case forgetting.

    Measurement procedure and two injection strategies

    • Two-model comparison: Train two models, one on clean data D only and the other on D plus injected samples Dp; both are then trained only on D, and attack A is continuously used to distinguish which model saw Dp, yielding the attack success rate α(k) for any k.
    • POISON: Mix Dp into the training set D ∪ Dp, train for TI steps, then remove it, simulating a fine-tuning scenario (pretraining data contains sensitive samples, fine-tuning data is disjoint); suitable for small datasets with many training rounds.
    • INJECT: First train on D up to step TI, update exactly once (or several times) with Dp, then return to training on D; suitable for large datasets with few training rounds (such as language and speech models), and repeated injection can simulate duplicated data.

    Attacks and calibration

    • Membership inference: Calibrate a threshold for each sample and compare the logits of models with and without the target sample; report accuracy and TPR/precision at a fixed FPR. On ImageNet, logits from a fixed checkpoint before injection are used for calibration, representing a strong adversary that knows about intermediate updates.
    • Canary extraction: Inject m canaries randomly selected from a larger secret set S, and measure extractability with exposure: Exposure(s, f) = log2(|S|) − log2(Rank(s, S, ℓ)), that is, the total entropy of the secret space minus the logarithm of the number of candidates whose loss is lower than that of the true secret; following Tramèr et al. 2022, canary losses are calibrated with multiple reference models before ranking.

    Theoretical analysis

    • k-means counterexample: Construct a one-dimensional three-cluster data task with k=2, in which a single outlier in cluster c2 can determine which two clusters k-means merges and get stuck in that local optimum, and adding more data later does not cause forgetting; the authors state this is the first privacy leakage instance they know of that depends on non-convexity.
    • Deterministic SGD does not forget: If the adversary knows the entire training set and the batch order, it can exactly reproduce both training trajectories and always distinguish them; Theorem 2 in Appendix D.2 proves that deterministic mean-estimation gradient descent outputs always differ on two datasets differing in only one row.
    • Random sampling causes forgetting (Theorem 1): In the mean-estimation task, after two models are injected with v and −v respectively at the first step and then continue SGD on randomly sampled data, the authors prove that the α-order Rényi divergence of their outputs is at most (2α)/k v⊤ Σ−1 v; the implication is that as k increases, or when v is more "in-distribution", distinguishing the two models becomes harder and forgetting occurs. The authors note that this theorem is not operational (the Gaussian assumption cannot be verified) and provides only intuition.
  4. What experiments did the paper conduct?

    Forgetting was measured on ImageNet, LibriSpeech and C4; samples with more repetitions and higher difficulty are forgotten more slowly; k-means and deterministic training do not forget.

    Experimental setup

    • Models tested: ResNet-50 trained on ImageNet (90 epochs, about 5,000 steps per epoch; model size ablation additionally tests ResNet-18/34/101); Conformer (L) trained on LibriSpeech (batch 2,048, 100,000 steps, Adam); a 110M-parameter decoder-only Transformer trained on C4 (T5 codebase and architecture, 1 epoch totaling 83,216 steps, batch 4,096); logistic regression trained on FMNIST (fixed batch order); plus a constructed one-dimensional k-means task.
    • Datasets: ImageNet; LibriSpeech; C4 deduplicated with MinHash (edit-distance and Jaccard thresholds both 0.7); FMNIST.
    • Injection settings: ImageNet uses INJECT to inject a single batch of data (main result: injected at epoch 50, repeated 10 times); LibriSpeech uses POISON, generating 320 unique canaries totaling 2,840 utterances (less than 1% of the total number of LibriSpeech utterances), with repetition counts {1, 4, 10, 20}; C4 uses INJECT, with each batch of 256 random token canaries repeated 1–100 times to fill 4,096 entries, injected at 10%, 50% and 90% of training.
    • Metrics and review method: Classification models use membership inference (accuracy, precision @ FPR=10% and 2%), generative models use canary extraction exposure; there is no LLM review, and all are attack success rate metrics.
    • Calibration and repetitions: ImageNet uses a fixed checkpoint before injection to calibrate logits, and results are averaged over 3 trials; LibriSpeech uses 11 reference models (each trained on an 80% random split) to calibrate losses.
    • Baselines: Models without injected samples (No Poison / No Removal controls), and the random-guess baseline of 1 for exposure.

    Main results

    Main results are presented as curve plots (Figure 1); key readings are as follows (according to the main text and figure captions):

    Swipe horizontally to read the table

    SettingAttack/metricInjection conditionResult
    ImageNet, ResNet-50, INJECT (Figure 1a)MI precisioninjected at epoch 50, repeated 10 timesafter injection, precision stays high for several epochs, decaying to about 65% after 10 epochs
    LibriSpeech, Conformer (L), POISON (Figure 1b)exposurecanary repeated 20 times, removed at 50k stepsdrops from 14.0 to 5.6 within 10,000 steps after removal; drops to about 2 after another 40,000 steps, close to the unseen-canary baseline
    C4, 110M LM, INJECT (Figure 1c)exposurevarious repetition countsforgetting occurs at all repetition counts; after exposure reaches 2, it decays to the baseline of 1 within at most 10,000 steps
    • The authors state that models in all three data domains exhibit forgetting, and that this behavior holds qualitatively under all parameter settings they tried.
    • The authors state that on LibriSpeech, exposure dropping from 14.0 to 5.6 means canaries become on average 330 times harder to guess.
    • The authors note that in Figure 1a, the precision of about 65% after 10 epochs corresponds to the level allowed by ε≈0.6 in the DP sense (computed as ln(TPR/FPR)).

    Factors affecting the rate of forgetting

    • Repetition count (Figure 2a, 2b, 1c): More repetitions mean a higher initial attack success rate and slower forgetting. On ImageNet, with 10 repetitions, precision takes about 20,000 steps to drop below 70%, whereas with 1 repetition it falls below that level 200 steps after injection; on LibriSpeech and C4, canaries with high repetition counts have higher exposure and decay more slowly.
    • Sample difficulty (Figure 2c): On ImageNet, high-loss (hard) samples are forgotten more slowly than easy samples; the authors use this to emphasize the necessity of worst-case samples for privacy measurement.
    • Learning rate decay (Figure 3, 10b): Training divides the learning rate by 10 at epoch 60; samples injected before decay (epochs 58, 59) are forgotten more slowly (the authors explain that their update contribution is 10 times that of later samples), forgetting is faster in a brief window after decay, and it returns to normal from epoch 62.

    Why forgetting does not occur: two counterexamples

    • k-means non-convexity (Section 5.1, Appendix D.1): In a one-dimensional three-cluster task (c1=N(−1,σ²), c2=N(µ,σ²), c3=N(1,σ²), σ=0.03, µ=0.03) with k=2, a single outlier x=−0.01 in c2 determines the merge direction and is not forgotten by subsequent data; with m=10, n=100 and 200 trials, MI accuracy for this point is 97% and precision is 100%. The authors state this is the first privacy leakage instance they know of that depends on non-convexity.
    • Deterministic training (Figure 5, Appendix D.2): Training logistic regression on FMNIST with a fixed batch order, an adversary that knows the training set and batch order simulates training and still maintains 97% MI accuracy after 95 epochs for samples injected at epoch 5 (the authors expect the 3% drop to come from unavoidable GPU non-determinism); without this perfect knowledge, forgetting occurs stably. Theorem 2 proves that deterministic mean-estimation SGD never forgets.

    Other ablations and analyses

    • Injection/removal timing (Figure 8): On ImageNet, later injection means slower forgetting, but there is little change between epochs 40 and 80; on LibriSpeech, later removal means slower forgetting; on C4, exposure differs little between injection at 10% and 50% — the authors state there is no consistent pattern.
    • Model size (Figure 9a, 9b): ResNet-18/34/50/101 forget medium-difficulty samples similarly, and ResNet-101 forgets hard samples more slowly; the authors suggest that all ResNets may already be overparameterized and forgetting is close to saturation.
    • Momentum and global learning rate (Figure 9c, 10a): Momentum 0.5–0.99 and learning rate 0.05–0.2 have no visible effect on forgetting (ImageNet).
    • POISON vs. INJECT (Figure 7): After controlling for the number of times samples are seen, the forgetting curves of the two strategies on ImageNet are similar.
    • Comparison with traditional forgetting metrics (Figure 11): Samples repeated 10 times have stabilized accuracy 20,000 steps after injection (appearing forgotten), but MI precision is still 70%; the authors state that accuracy metrics are too optimistic from a privacy perspective, and that loss is closer to this paper's method but less interpretable.
  5. What are some points that can be further explored?

    The authors acknowledge that the measurement is heuristic and cannot prove forgetting, and propose two directions: protecting late samples and non-convexity-aware membership inference.

    Limitations and future directions noted by the authors

    • The measurement method is heuristic in nature (Section 6, Limitations): although the strongest current attacks were used, empirical measurement cannot prove that forgetting actually occurred; the authors also state that there is no reason to expect the identified trends to fail to hold under stronger attacks, and that in some experiments the attacks had knowledge beyond that of a realistic adversary.
    • Dependence on advances in attack techniques (Section 6, Limitations): future advances in the techniques this paper relies on could be used to measure forgetting more faithfully.
    • Protecting the most recently seen samples (Section 6): the authors believe that in large-scale training the most recently seen samples are the most vulnerable, and that defenders can concentrate privacy protection on recent samples, with the number of samples requiring protection determined by empirical forgetting analysis.
    • Non-convexity-aware membership inference (Section 6): this paper shows that the optimum the model ultimately lands in leaks information about training samples (limited to specific k-means settings), and the authors propose that it is worth studying whether non-convexity can be used to design new membership inference attacks on realistic tasks.
    • The theoretical result is not operational (Section 5.3): the authors point out that Theorem 1 cannot be operationalized, because in practice it is impossible to know whether the Gaussian assumption holds, and that this analysis only provides intuition for the experiments.

    Scope of experiments

    • The models tested are ResNet-50 (with ResNet-18/34/101 ablations), Conformer (L), a 110M-parameter decoder-only Transformer, logistic regression and k-means, for a total of 8 model/algorithm settings.
    • The datasets are ImageNet, LibriSpeech, C4 (MinHash-deduplicated version), FMNIST, and a one-dimensional constructed clustering task.
    • ImageNet results are averaged over 3 trials; the k-means experiments use 200 trials; LibriSpeech calibration uses 11 reference models.
    • The attacks access only the final model after training ends, and do not cover scenarios in which intermediate training updates are released (the authors explain this setting in Section 2.2).
    • The paper does not report the total training cost of each experiment or the number of queries required by the attacks.
  6. Summarize the main content of the paper

    The authors use privacy attacks to measure and empirically demonstrate the phenomenon of forgetting during training, identify its causes and boundaries, and provide an auditing tool for passive privacy in large-scale training.

    A privacy measurement study connecting "memorization" and "forgetting": the authors propose defining and measuring a model's forgetting of training samples by the success rate of privacy attacks, answering the question of whether early samples gain passive privacy protection as training proceeds.

    • Method: Define (A, α, k)-forgetting (k steps after a sample last participated in training, the attack success rate ≤ α), design two strategies, POISON (mix in then remove, simulating fine-tuning) and INJECT (point injection, simulating large data with few rounds), and continuously monitor with calibrated membership inference and canary extraction.
    • Forgetting is widespread: The authors state that forgetting occurs on ImageNet (ResNet-50), LibriSpeech (Conformer L) and C4 (110M LM); on LibriSpeech, canary exposure drops from 14.0 to 5.6 within 10,000 steps after removal (the authors state it becomes 330 times harder to guess), and on C4 it drops to the random baseline of 1 within at most 10,000 steps (Figure 1).
    • Factors affecting the rate of forgetting: Samples with more repetitions and higher difficulty are forgotten more slowly (on ImageNet, 10 repetitions require about 20,000 steps to drop below 70% precision); samples injected before learning rate decay are forgotten more slowly; model size, momentum and global learning rate have little effect.
    • Two counterexamples where forgetting does not occur: In the constructed k-means task, a single outlier determines the local optimum and is not forgotten (MI accuracy 97%, precision 100%); under deterministic SGD, an adversary that knows the batch order can always distinguish (on FMNIST, MI accuracy is still 97% after 95 epochs).
    • Explanation of causes: On the mean-estimation task, the authors prove that the non-determinism brought by random data sampling makes the Rényi divergence of the two training trajectories decay with steps (Theorem 1), that is, randomness causes forgetting; the deterministic version never forgets (Theorem 2).
    • The authors' conclusions and implications: Forgetting is a kind of passive privacy amplification, and early samples (such as pretraining data) may gain privacy benefits at the expense of later samples; the authors suggest that trainers use this method to audit the empirical privacy of their pipelines, but emphasize that it is a complement to, not a replacement for, worst-case frameworks such as differential privacy, and that the measurement is inherently heuristic and cannot prove that forgetting occurs.

Related papers

Show 1 more papers
Read originalarxiv.org