Continual Learning with Differential Privacy

Pradnya Desai, Phung Lai, NhatHai Phan, My T. Thai

TL;DR

This paper introduces a formal framework for integrating Differential Privacy (DP) into Continual Learning (CL), ensuring that models don't leak sensitive information from previously learned tasks. By restructuring episodic memory into independent "mini-blocks" and utilizing a specialized "moments accountant," the authors' DP-CL algorithm achieves a linear—rather than quadratic—privacy loss over time while maintaining competitive model utility.

What Problem Does This Paper Address?

Continual Learning (CL) allows AI to learn a sequence of tasks over time, much like a human. To prevent "catastrophic forgetting" (where the model forgets Task A while learning Task B), many algorithms use episodic memory—storing a small subset of data from past tasks to "rehearse" later.

However, this creates a massive privacy risk. If a model is trained on sensitive healthcare or financial data, an attacker could use model inference to extract information about individuals in the training set. Standard Differential Privacy (DP) tools are designed for static datasets. In a continual setting, where the same data points in memory are accessed repeatedly across dozens of tasks, the "privacy budget" ($\epsilon$) usually explodes. A naive application of DP leads to a privacy loss that grows quadratically ($O(T^2)$), quickly making the privacy guarantees meaningless or forcing the model to be so noisy that it becomes useless.

Methods

The authors propose a new algorithm, DP-CL, based on the well-known Averaged Gradient Episodic Memory (A-GEM) approach. Their method hinges on three key innovations:

  1. Continual Adjacent Databases: They provide a formal definition of "adjacency" for a stream of tasks, which is the mathematical bedrock required to prove DP guarantees in a sequential setting.
  2. Mini-Memory Blocks: Instead of treating episodic memory as one giant pool, DP-CL divides it into independent blocks ($M_i$), one for each task.
  3. Strategic Sampling & Moments Accountant: When the model needs to "rehearse" to prevent forgetting, it doesn't look at all past data. It randomly selects one mini-memory block to compute a reference gradient. By tracking these accesses with a Moments Accountant (a technique to tightly bound the cumulative privacy loss), they ensure the privacy cost only grows linearly ($O(T)$) with the number of tasks.

Like standard DP-SGD, the algorithm also employs gradient clipping (to limit the influence of any single data point) and Gaussian noise injection to obscure individual contributions.

Datasets

The researchers evaluated their approach on two standard benchmarks for continual learning:

  • Permuted MNIST: A version of the classic handwritten digits dataset where the pixels of the images are randomly shuffled for each of the 17 sequential tasks.
  • Split CIFAR-100: A more complex image dataset split into 20 disjoint subsets, where each task involves learning 5 unique classes (e.g., Task 1: aquatic mammals; Task 2: flowers).

Key Insights and Ideas

  • The Memory Leak: The primary driver of privacy loss in CL isn't just the new data being learned; it's the repeated "re-reading" of old data stored in episodic memory.
  • Independence Reduces Cost: By ensuring that reference gradients are computed on independent mini-blocks rather than the whole memory, the authors effectively "decouple" the privacy cost of different tasks.
  • Privacy-Forgetting Trade-off: There is a unique tension in DP-CL. Adding noise to gradients (for privacy) makes it harder for the model to find the precise optimization path needed to satisfy both the current task and the memory constraints. This suggests that privacy actually accelerates catastrophic forgetting.
  • Linear is the Goal: Moving from quadratic to linear privacy accumulation is the difference between a system that is private for 3 tasks versus one that remains private over a long-term deployment of 20+ tasks.

Key Results

  • Privacy Efficiency: Theoretical and experimental analysis showed that DP-CL maintains a significantly tighter privacy budget compared to a "naive" DP-AGEM implementation. While the naive version's budget grew exponentially/quadratically, DP-CL's budget remained low and linear (see Fig 2a).
  • Utility vs. Privacy:
    • On Permuted MNIST, the non-private baseline (A-GEM) reached ~79.3% accuracy after 17 tasks. The DP-CL version with a tight privacy budget ($\epsilon=0.85$) achieved ~47.5%. Increasing the budget (allowing less privacy) improved accuracy.
  • On Split CIFAR, the gap was smaller initially but widened as tasks progressed. For the first task, DP-CL was within 0.3% to 11.4% of the non-private baseline depending on the privacy settings.
  • Forgetting Measure: The "Forgetting Measure" (F) was higher in DP-CL than in the noiseless version, confirming that the noise required for privacy makes it harder for the model to retain old knowledge.

Limitations and Future Work

The authors identify several hurdles for the future:

  • The Utility Gap: The drop in accuracy when moving from non-private to private CL is still significant. Optimizing the trade-off between privacy noise and catastrophic forgetting remains an "open problem."
  • Task Correlation: The current work assumes tasks are somewhat independent. If Task A and Task B are highly correlated, learning Task B might leak information about Task A's data even with DP.
  • Broader Attacks: The authors plan to test the model against specific adversarial attacks, such as membership inference and model inversion, to see how these formal DP guarantees translate to real-world defense.

Summary updated

BibTeX
@inproceedings{desai2021continual,
  author = {Pradnya Desai and Phung Lai and NhatHai Phan and My T. Thai},
  title = {{Continual Learning with Differential Privacy}},
  booktitle = {ICONIP},
  year = {2021},
  url = {https://openreview.net/forum?id=9PgnK-vf2iu},
}
Figure