NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Pseudo-Rehearsal for Continual Learning with Normalizing Flows

Jary Pomponi, Simone Scardapane, Aurelio UnciniarXiv 2020

Abstract: Catastrophic forgetting (CF) happens whenever a neural network overwrites past knowledge while being trained on new tasks. Common techniques to handle CF include regularization of the weights (using, e.g., their importance on past tasks), and rehearsal strategies, where the network is constantly re-trained on past data. Generative models have also been applied for the latter, in order to have endless sources of data. In this paper, we propose a novel method that combines the strengths of regularization and generative-based rehearsal approaches. Our generative model consists of a normalizing flow (NF), a probabilistic and invertible neural network, trained on the internal embeddings of the network. By keeping a single NF conditioned on the task, we show that our memory overhead remains constant. In addition, exploiting the invertibility of the NF, we propose a simple approach to regularize the network's embeddings with respect to past tasks. We show that our method performs favorably with respect to state-of-the-art approaches in the literature, with bounded computational power and memory overheads.

Introduction

Deep neural networks excel at learning from static datasets but struggle with sequential learning. When exposed to a stream of tasks, they suffer from Catastrophic Forgetting (CF), where learning new information leads to the abrupt loss of previously acquired knowledge. Existing mitigation strategies generally fall into two categories: rehearsal-based methods, which store or generate past data to refresh the model's memory, and regularization-based methods, which constrain weight updates to preserve important parameters. While effective, rehearsal methods often suffer from linear memory growth, and regularization methods can be overly restrictive.

This paper introduces PRER (Pseudo-Rehearsal Embedding Regularization), a hybrid approach that leverages Normalizing Flows (NFs) to model the distribution of internal embeddings. By performing pseudo-rehearsal in the latent space rather than the pixel space, PRER achieves state-of-the-art performance with a memory footprint that remains constant regardless of the number of tasks learned.

Methodology

The PRER framework operates in a three-phase training cycle for each new task, integrating an autoencoder, a task-conditioned Normalizing Flow, and task-specific classification heads.

The PRER training architecture, illustrating the interaction between the encoder, decoder, normalizing flow, and classification heads during the training step.
  1. Autoencoder Training and Regularization: The system first trains an encoder to map inputs to a latent embedding space and a decoder to reconstruct them. To prevent forgetting, the model uses the NF to sample embeddings from previous tasks. These are passed through the decoder to generate "pseudo-data," which is then used to regularize the current encoder, ensuring that the mapping of past task distributions remains stable.
  2. Generative Model Training: A single Normalizing Flow is trained to capture the distribution of the current task's embeddings. NFs are particularly suited for this because they are invertible and provide exact density estimation. By conditioning the NF on a task ID, the model can represent multiple task distributions within a fixed parameter budget.
  3. Classifier Training: Finally, a task-specific classification "head" is trained on the embeddings produced by the encoder to perform the actual classification.

By training the NF on embeddings—which are lower-dimensional and more structured than raw pixels—the generative task becomes significantly easier and more stable than traditional image-based pseudo-rehearsal.

Experimental Results

The authors evaluated PRER on four standard benchmarks for continual learning: MNIST, KMNIST, SVHN, and CIFAR10. Each dataset was partitioned into five consecutive tasks (two classes per task) to simulate a lifelong learning scenario. PRER was compared against established baselines such as Elastic Weight Consolidation (EWC), Gradient Episodic Memory (GEM), and Experience Replay (ER).

Comparison of Backward Transfer (BWT) and Accuracy across four benchmarks. PRER consistently achieves the best (least negative) BWT scores while maintaining competitive accuracy.

As shown in the results, PRER demonstrates exceptional resilience to forgetting. It achieved the highest Backward Transfer (BWT) scores—meaning the least amount of forgetting—across nearly all datasets. For instance, on MNIST, PRER reached a BWT of -0.14, significantly outperforming ER (-0.36) and GEM (-0.60). Furthermore, PRER maintained classification accuracy that was either superior or highly competitive with state-of-the-art methods while requiring significantly less storage than memory-heavy approaches like GEM on complex datasets.

Conclusion

PRER offers a scalable and efficient solution for continual learning by shifting the focus of pseudo-rehearsal from complex image generation to structured embedding modeling. The use of Normalizing Flows provides a stable, invertible mechanism for memory retention that does not scale linearly with the number of tasks. Future work will focus on extending this approach to higher-resolution datasets and exploring task-agnostic scenarios where task boundaries are not explicitly provided.

Summary updated

BibTeX
@misc{pomponi2020pseudo,
  author = {Jary Pomponi and Simone Scardapane and Aurelio Uncini},
  title = {{Pseudo-Rehearsal for Continual Learning with Normalizing Flows}},
  year = {2020},
  eprint = {2007.02443},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2007.02443},
}
Figure