Neural networks are notoriously "forgetful." When you train a model on Task A and then move to Task B, the weights shift to accommodate the new data, often overwriting the patterns learned for Task A. This phenomenon, known as Catastrophic Forgetting (CF), is the primary hurdle in the field of Continual Learning (CL).
In a recent paper, researchers from Sapienza University of Rome propose a clever hybrid solution called PRER (Pseudo-Rehearsal Embedding Regularization). By combining the strengths of generative modeling and latent space regularization, they’ve developed a method that remembers the past without needing a massive, ever-growing storage bin of old data.
TL;DR
PRER is a novel continual learning method that uses a Normalizing Flow (NF) to model the distribution of a network's internal embeddings. Instead of storing old images, it generates "synthetic" past embeddings and uses them to regularize the network, achieving state-of-the-art performance with a constant, low memory footprint.
What Problem Does This Paper Address?
The two most common ways to fight forgetting are Regularization (penalizing changes to "important" weights) and Rehearsal (keeping a buffer of old images to retrain on).
Both have flaws. Regularization often becomes too restrictive as more tasks are added, eventually preventing the model from learning anything new. Rehearsal works well but requires storing thousands of images, which is a privacy nightmare and scales poorly with memory. "Pseudo-rehearsal"—using a generative model like a GAN to create fake old data—is a promising alternative, but training GANs to produce high-quality, diverse images for every new task is notoriously difficult and unstable.
Methods
The authors introduce PRER, which sidesteps the difficulty of generating raw pixels by working in the embedding space (the high-level features just before the final classification layer).
The architecture consists of four main parts:
- Encoder ($E$): Extracts features from the input.
- Projection Heads ($f_c, f_r$): Split the features into a classification path and a reconstruction path.
- Decoder ($D$): Reconstructs the original image from the embedding.
- Normalizing Flow (NF): A specific type of generative model that is probabilistic and fully invertible.
The Workflow: When a new task arrives, the NF learns the "shape" of the current task's embeddings. Because NFs are invertible, they can perform exact density estimation, making them much more stable to train than GANs.
To prevent forgetting during the next task, the model samples a point from the NF, uses the Decoder to turn it into a "pseudo-image," and then forces the current Encoder to produce an embedding for that pseudo-image that matches the original "remembered" embedding. This is the Embedding Regularization step: it anchors the latent space so that old concepts don't drift away.
Datasets
The authors evaluated PRER on four standard benchmarks in a "multi-head" configuration (where the model knows which task it is currently performing):
- MNIST: Handwritten digits.
- SVHN: Street View House Numbers.
- CIFAR-10: 10 classes of common objects/animals.
- CIFAR-100: 100 classes, split into 10 sequential tasks.
Key Insights and Ideas
- Embeddings are easier than Pixels: Modeling the distribution of 100-dimensional vectors (embeddings) is significantly easier for a generative model than modeling the complex, high-dimensional space of raw images. This allows the NF to be relatively small and efficient.
- Normalizing Flows vs. GANs: The authors chose NFs because they provide a tractable likelihood and are invertible. This means the NF can be trained efficiently without the "adversarial" instability that plagues GANs in continual learning settings.
- The Power of Conditioning: The paper explores whether the NF or the Decoder should be "conditioned" (told which class to generate). Interestingly, they found that conditioning only the Decoder worked best. Forcing the NF to learn class-specific distributions actually caused it to "collapse" and lose the diversity needed for effective regularization.
- Constant Memory: Unlike standard rehearsal methods where the memory buffer grows with every task, PRER’s memory overhead (the size of the NF and Decoder) remains constant regardless of how many tasks are learned.
Key Results
PRER performed favorably against heavyweights like GEM (Gradient Episodic Memory) and ER (Embedding Regularization):
- Accuracy: On CIFAR-10, PRER achieved 88.25% accuracy, outperforming standard Replay (85.14%) and EWC (80.88%).
- Backward Transfer (BWT): This measures how much the model forgets. On MNIST and SVHN, PRER showed near-zero forgetting (BWT of -0.11 and -0.38 respectively), meaning it almost perfectly preserved past knowledge.
- Efficiency: As shown in the paper's "Memory Comparison" experiments, PRER reaches peak performance with far fewer parameters than it would take to store the equivalent number of raw images needed for standard rehearsal.
Limitations and Future Work
While PRER excels in the "multi-head" scenario (where the task ID is provided), the authors acknowledge that class-incremental learning (where the model must distinguish between all classes across all tasks without a task ID) is a much harder challenge.
Future work involves scaling PRER to even more complex, high-resolution datasets and investigating how to adapt the generative components to handle the "task-agnostic" setting where boundaries between tasks are blurred or unknown.
Paper Citation: Pomponi, J., Scardapane, S., & Uncini, A. (2022). Continual Learning with Invertible Generative Models. arXiv:2202.05694v2 [cs.LG].
Summary updated