Cyclic perturbations encode memories in trained neural networks without loss of performance
Abstract
Many disordered materials exhibit a remarkable form of memory: they retain information about the history of cyclic perturbations.
Whether this phenomenon also occurs in artificial neural networks, whose mathematical structure and dynamics share many similarities with disordered physical systems, is unknown.
Here we show that cyclically perturbing a trained, overparameterized deep neural network encodes information in the structure of the weights that can subsequently be retrieved, thus retaining memory of the perturbation history.
During each write cycle, all weights are displaced, after which the network relaxes through gradient descent.
Repeated cycles organise the neural network into a state that is reversible for perturbations up to the write amplitude, allowing the encoded value to be read from the onset of irreversible weight motion.
Multiple memories can also be encoded, although under deterministic writing only the largest persists at long times.
Inspired by cyclically sheared suspensions, we introduce a novel noisy-write protocol that preserves all encoded memories at long times.
Remarkably, neither deterministic nor noisy memory writing measurably affects the network's performance on unseen data from its original learning task.
Our results establish cyclic memory as a phenomenon shared by disordered physical systems and deep neural networks, and show that networks can exploit as yet unexplored memory capabilities without compromising their original function.