Regularization, early-stopping and dreaming: a Hopfield-like setup to address generalization and overfitting
Elena Agliari, Francesco Alemanno, Miriam Aquaro, Alberto Fachechi
TL;DR
The paper reframes Hopfield-like attractor networks as gradient-based learners operating under a regularized loss over the interaction matrix $\boldsymbol{J}$, revealing that optimal couplings are dreaming Hebbian kernels produced by unlearning quantified by the dreaming time $t_d$ (with $t_d=\epsilon_J^{-1}$). The stationary, fully trained solution yields $\boldsymbol{J}^{(D)}$, while unregularized training stopped at $t^*$ reproduces the dreaming kernel, establishing an equivalence between dreaming and early stopping. Analytical results on random datasets, complemented by numerical experiments on structureless and structured data (e.g., MNIST), uncover regimes of failure, generalization, and overfitting, and highlight the role of spurious intra-class states in enabling robust generalization. The proposed mechanism—coalescence of attractors around ground truths yielding wide, class-centered minima—offers a principled way to set regularization/training-time parameters and points to extensions to structured data and a statistical-mechanics interpretation. Overall, the work connects dreaming/unlearning dynamics, regularization, and early stopping to explain and optimize generalization in Hopfield-like networks.
Abstract
In this work we approach attractor neural networks from a machine learning perspective: we look for optimal network parameters by applying a gradient descent over a regularized loss function. Within this framework, the optimal neuron-interaction matrices turn out to be a class of matrices which correspond to Hebbian kernels revised by a reiterated unlearning protocol. Remarkably, the extent of such unlearning is proved to be related to the regularization hyperparameter of the loss function and to the training time. Thus, we can design strategies to avoid overfitting that are formulated in terms of regularization and early-stopping tuning. The generalization capabilities of these attractor networks are also investigated: analytical results are obtained for random synthetic datasets, next, the emerging picture is corroborated by numerical experiments that highlight the existence of several regimes (i.e., overfitting, failure and success) as the dataset parameters are varied.
