English

ResMem: Learn what you can and memorize the rest

Machine Learning 2023-10-24 v2 Artificial Intelligence Methodology Machine Learning

Abstract

The impressive generalization performance of modern neural networks is attributed in part to their ability to implicitly memorize complex training patterns. Inspired by this, we explore a novel mechanism to improve model generalization via explicit memorization. Specifically, we propose the residual-memorization (ResMem) algorithm, a new method that augments an existing prediction model (e.g. a neural network) by fitting the model's residuals with a kk-nearest neighbor based regressor. The final prediction is then the sum of the original model and the fitted residual regressor. By construction, ResMem can explicitly memorize the training labels. Empirically, we show that ResMem consistently improves the test set generalization of the original prediction model across various standard vision and natural language processing benchmarks. Theoretically, we formulate a stylized linear regression problem and rigorously show that ResMem results in a more favorable test risk over the base predictor.

Keywords

Cite

@article{arxiv.2302.01576,
  title  = {ResMem: Learn what you can and memorize the rest},
  author = {Zitong Yang and Michal Lukasik and Vaishnavh Nagarajan and Zonglin Li and Ankit Singh Rawat and Manzil Zaheer and Aditya Krishna Menon and Sanjiv Kumar},
  journal= {arXiv preprint arXiv:2302.01576},
  year   = {2023}
}
R2 v1 2026-06-28T08:31:05.465Z