AI Memory Boosted by Daydreaming Technique

Sissa Medialab

During the day, our brain acquires new memories; at night, during sleep, it consolidates the important ones and eliminates the useless ones. A similar principle has been applied to Hopfield networks, one of the classic models of artificial intelligence inspired by the workings of the brain. In 2025, Federico Ricci-Tersenghi and colleagues developed Daydreaming, an algorithm that combines the learning of new memories with the elimination of spurious ones, drastically improving the network's capacity.

One limitation remained, however. These networks lose effectiveness when they work with real-world data, which are rarely perfectly balanced — for example, very bright or very dark images, in which white or black pixels overwhelmingly dominate. In a new study published in the Journal of Statistical Mechanics: Theory and Experiment (JSTAT), Ricci-Tersenghi, together with Japanese colleagues, now presents a new version of the algorithm, capable of effectively handling realistic, strongly biased data.

A "classical" neural network

The networks proposed by John Hopfield in 1982 — work that would earn him the Nobel Prize in 2024 — consist of artificial neurons connected to one another and are among the simplest models of associative memory. "Whenever we see any tree, our brain recalls the concept of a tree. This ability to associate many different representations with the same concept is what we call associative memory," explains Federico Ricci-Tersenghi, professor of Theoretical Physics at Sapienza University of Rome and one of the authors of the new study.

The network does something similar: if it is trained, for example, with images of trees, dogs and apples, then when it "sees" a new image of a tree, a dog or an apple, even if partially degraded, it is able to connect it to the correct concept.

The simplest form of the Hopfield network can store a number of memories equal to only about 13% of its number of neurons. A network with one hundred neurons, therefore, can store only 13 memories. The rest of its memory is occupied by "false memories, attractors of the dynamics that do not correspond to any real memory," Ricci-Tersenghi explains. These spurious memories are configurations that mix elements of real memories — a kind of hallucination — and, besides taking up space in the network's memory, can also lead it into error.

Daydreaming

To address this problem, algorithms known as "dreaming" have been proposed, inspired by the role of sleep in biological brains. After the learning phase, the network is left to "dream": starting from random configurations, it explores its own memory and tries to clean it of spurious memories. But if this "cleaning" process goes on for too long, the network ends up erasing correct memories as well, a phenomenon known as catastrophic forgetting.

In 2025, Ricci-Tersenghi and colleagues proposed the Daydreaming algorithm, which carries out learning and cleaning at the same time: the network keeps strengthening correct memories while eliminating spurious ones. "We combined daytime learning with the cleaning and consolidation phase of sleep, as if we were also dreaming during the day," the researcher explains. Thanks to this strategy, the network's capacity increased up to the theoretical limit of 100%, meaning one memory for every neuron.

Another problem remained, however — one that the original Daydreaming algorithm did not solve. Hopfield networks work very well when they are trained on perfectly balanced data. In the case of black-and-white images, for example, this means that the number of white pixels and black pixels is roughly the same. Real-world data, however, are rarely so orderly. Think of heavily overexposed photographs, in which almost all pixels are white, or of very dark images. In these cases, images become very similar to one another, and the network struggles to understand which features really matter for distinguishing one memory from another.

Focusing on differences

The solutions proposed so far required global operations across the entire network, which are not very plausible from a biological point of view. "It is much more realistic for each decision to be made locally," Ricci-Tersenghi explains. Biological neurons, in fact, are connected to a limited number of other neurons and never communicate with the whole brain.

In the new work, the researchers propose a local modification of the Daydreaming algorithm based on differences.

The example of face recognition helps to understand the idea. If all photographs are close-ups with a similar background, many pixels will be practically identical in every image. The shared information risks dominating the learning process. "If, instead, we work only on what changes relative to the average face, the differences emerge clearly," Ricci-Tersenghi explains.

The new version of the algorithm, called Centered Daydreaming, no longer compares the absolute values of pixels, but their differences from the average. In the study, Centered Daydreaming kept the network's ability to retrieve memories almost unchanged even with strongly biased data. The result extends the algorithm to conditions much closer to those of the real world, without giving up local learning rules, which are considered more biologically plausible.

Understanding how simple, brain-inspired models learn to distinguish what matters from what is irrelevant, Ricci-Tersenghi concludes, could in the future contribute to the development of artificial intelligence systems that are easier to understand and more energy-efficient.

/Public Release. This material from the originating organization/author(s) might be of the point-in-time nature, and edited for clarity, style and length. Mirage.News does not take institutional positions or sides, and all views, positions, and conclusions expressed herein are solely those of the author(s).View in full here.