[Paper Review] Memory-based Parameter Adaptation
Memory-based Parameter Adaptation (MbPA) enhances deep neural networks by storing input-output pairs in a memory module and using context-based retrieval to locally adapt network weights at inference time. This enables fast, stable adaptation to new data—especially rare or out-of-distribution examples—achieving significant performance gains in continual learning and language modeling, including a 15.9-point drop in perplexity on WikiText-2 when combined with a neural cache.
Deep neural networks have excelled on a wide range of problems, from vision to language and game playing. Neural networks very gradually incorporate information into weights as they process data, requiring very low learning rates. If the training distribution shifts, the network is slow to adapt, and when it does adapt, it typically performs badly on the training distribution before the shift. Our method, Memory-based Parameter Adaptation, stores examples in memory and then uses a context-based lookup to directly modify the weights of a neural network. Much higher learning rates can be used for this local adaptation, reneging the need for many iterations over similar data before good predictions can be made. As our method is memory-based, it alleviates several shortcomings of neural networks, such as catastrophic forgetting, fast, stable acquisition of new knowledge, learning with an imbalanced class labels, and fast learning during evaluation. We demonstrate this on a range of supervised tasks: large-scale image classification and language modelling.
Motivation & Objective
- To address catastrophic forgetting and slow adaptation in deep neural networks during continual or incremental learning.
- To enable rapid acquisition of new knowledge from few or rare examples without retraining.
- To improve performance on data distribution shifts, particularly in language modeling with rare or out-of-vocabulary words.
- To combine the generalization strength of parametric models with the fast, local adaptation of non-parametric memory.
- To provide a principled, regularized method for contextual parameter adaptation using attention-like retrieval and Bayesian interpretation.
Proposed method
- The model uses a parametric neural network (with parameters θ) for generalization and a non-parametric memory module (M) storing key-value pairs (h_i, v_i) from past inputs.
- Keys h_i are embeddings from an input x_j via a learned embedding network f_γ, and values v_i are the corresponding targets y_j (e.g., class labels or regression targets).
- During inference, the model retrieves K-nearest neighbors in memory using Euclidean distance between the current input embedding and stored keys.
- The retrieved context is used to compute a local, context-dependent update to the output network's parameters (θ), which is applied before prediction.
- The adaptation is transient: updates are discarded after inference, preserving long-term generalization and avoiding overfitting.
- The method is grounded in a Bayesian interpretation, enabling principled regularization through uncertainty-aware memory retrieval.
Experimental results
Research questions
- RQ1Can memory-augmented parameter adaptation enable fast, stable learning of new classes without catastrophic forgetting?
- RQ2How does MbPA improve performance on data distribution shifts, particularly in language modeling with rare or unseen words?
- RQ3Can MbPA outperform or complement existing methods like elastic weight consolidation (EWC) and neural cache in continual learning settings?
- RQ4Does the use of a non-parametric memory allow for effective adaptation to imbalanced class distributions?
- RQ5To what extent can MbPA improve generalization and performance in low-data or few-shot scenarios?
Key findings
- On the Penn Treebank dataset, MbPA improved the LSTM baseline by 5.3 perplexity points, outperforming the neural cache alone (4.3-point improvement).
- On WikiText-2, MbPA achieved a 9.9-point perplexity reduction over the LSTM baseline, and a 16.5-point improvement when combined with a neural cache.
- The combination of MbPA and neural cache reduced test perplexity by 15.9 points on WikiText-2, significantly outperforming the baseline and prior state-of-the-art models.
- MbPA showed particular gains on rare words in language modeling, as confirmed by word-by-word analysis in Figure 8.
- In image classification, MbPA enabled rapid adaptation to previously unseen classes in ImageNet, demonstrating effectiveness in few-shot and long-tailed learning scenarios.
- The method effectively mitigated catastrophic forgetting and improved performance on imbalanced data, where some classes were underrepresented during training.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.