Abstract
Recent work in continual learning has highlighted the beneficial effect of resampling weights in the last layer of a neural network ("zapping"). Although empirical results demonstrate the effectiveness of this approach, the underlying mechanisms that drive these improvements remain unclear. In this work, we investigate in detail the pattern of learning and forgetting that take place inside a convolutional neural network when trained in challenging settings such as continual learning and few-shot transfer learning, with handwritten characters and natural images. Our experiments show that models that have undergone zapping during training more quickly recover from the shock of transferring to a new domain. Furthermore, to better observe the effect of continual learning in a multi-task setting we measure how each individual task is affected. This shows that, not only zapping, but the choice of optimizer can also deeply affect the dynamics of learning and forgetting, causing complex patterns of synergy/interference between tasks to emerge when the model learns sequentially at transfer time.
Introduction
Deep learning models are notoriously brittle when transitioned between tasks. Two primary obstacles hinder the development of "lifelong learning" systems: transfer-shock and catastrophic forgetting. Transfer-shock occurs when moving a model to a new domain and resetting its last layer—a standard practice that can inadvertently degrade useful features in earlier layers. Catastrophic forgetting describes the abrupt loss of previously learned information when a model is trained on new data sequentially.
While recent research suggests that "zapping" (repeatedly resampling weights during pre-training) improves performance, the mechanics behind this benefit and the influence of optimizer choice (e.g., SGD vs. Adam) on multi-task learning dynamics have remained poorly understood.
Methods and Experimental Protocol
To dissect these dynamics, the researchers employed several training modalities and a novel measurement protocol:
- Zapping Modalities: The study compared standard IID pre-training with "Zapped-IID" (resampling the last layer every epoch) and Alternating Sequential and Batch (ASB) learning. They also tested Meta-ASB, which uses second-order gradients to optimize initial weights for superior transfer.
- Zap-Divergence Protocol: To visualize internal dynamics, they created "control" and "treatment" (zapped) versions of the same model and measured how their layers re-aligned or diverged over time using cosine similarity.
- Per-Task Tracking: Instead of average accuracy alone, the authors monitored the individual loss of 100 different tasks simultaneously to observe real-time interference and synergy.
Experiments were conducted on Omniglot (handwritten characters) and Omni-image (natural images), both designed to test few-shot and continual learning capabilities.
Zapping as "Shock Absorption"
Results indicate that zapping acts as a form of "shock absorption" for neural networks. Models that undergo zapping during pre-training develop lower-layer features that are less sensitive to drastic changes in the final layer.
As shown in the Zap-Divergence analysis, zapped models recover and re-align their weights much faster than non-zapped controls after a weight shock. This suggests that zapping encourages the model to settle into wider, more stable loss basins, making the convolutional layers more robust to domain shifts.
Transfer Performance and the Adam Advantage
The performance gains from zapping are substantial. On the challenging Omni-image dataset, Meta-ASB combined with zapping achieved a transfer accuracy of 30.5%, nearly doubling the 16.3% of standard IID pre-training without zapping.
Beyond zapping, the choice of optimizer plays a critical role. Contrary to the common preference for SGD in continual learning, Adam demonstrated a significant advantage due to its ability to facilitate "backward transfer." By tracking squared gradients (second-moment information), Adam allows a model to continue optimizing previous tasks even while focused on new ones. In a 100-task sequential setup, Adam reached 85.8% accuracy after three epochs, compared to SGD's 76.7%.
Conclusion
This study reveals that zapping and optimizer choice are fundamental drivers of learning dynamics. Zapping builds models resilient to transfer-shock by stabilizing internal features, while Adam’s gradient memory enables a unique form of task synergy. Future research will focus on scaling these insights to larger architectures and designing optimizers specifically tuned to maximize backward transfer while minimizing the plasticity-stability dilemma.
Summary updated