New 'Daydreaming' Algorithm Boosts AI Memory Capacity to Handle Real-World Data

The network keeps strengthening correct memories while eliminating spurious ones.
How the Daydreaming algorithm consolidates memory by learning and cleaning simultaneously, mimicking sleep's role in the biological brain.

Each night, the human brain performs a quiet miracle — sorting experience into memory, discarding what does not serve. Researchers at Sapienza University of Rome and their Japanese collaborators have brought machines closer to this same discipline, refining an algorithm called Centered Daydreaming that allows artificial neural networks to consolidate genuine memories while purging false ones, even when trained on the messy, unbalanced data that characterizes the real world. The advance builds on Hopfield networks — systems honored by a Nobel Prize in 2024 — and suggests that the oldest lessons about intelligence may still be the most instructive: pay attention not to what is, but to what changes.

  • Classical Hopfield networks could store only 13% of their potential memories, with the rest corrupted by phantom configurations that led the system astray.
  • Real-world data — overexposed photos, night images, skewed pixel distributions — broke earlier solutions, exposing a gap between laboratory elegance and practical use.
  • The original Daydreaming algorithm closed the capacity gap dramatically by learning and cleaning simultaneously, but it still demanded unrealistically balanced input data.
  • Centered Daydreaming solves this by measuring pixel differences from the average rather than absolute values, letting the network focus on what actually varies between memories.
  • The new approach is biologically plausible — mimicking how real neurons respond only to local signals — and the algorithm now holds up under conditions that mirror the world as it actually is.

The human brain consolidates memory during sleep, keeping what matters and releasing the rest. Researchers have now brought artificial systems meaningfully closer to this process — and in doing so, resolved a long-standing limitation in how AI handles real-world information.

Hopfield networks, whose creator John Hopfield received the Nobel Prize in 2024, are among the simplest models for associative memory: show the network a tree or a face, and it should recognize a degraded version of that same image later. But classical versions of these networks could store only about 13% as many memories as they had neurons. The remainder filled with spurious memories — false configurations blending elements of real ones, a kind of structural hallucination.

In 2025, Federico Ricci-Tersenghi and colleagues at Sapienza University of Rome proposed Daydreaming, an algorithm inspired by sleep consolidation. Rather than separating learning from cleanup, it did both simultaneously — strengthening real memories while eliminating false ones. Network capacity climbed toward the theoretical 100% limit.

One problem persisted: the algorithm required balanced data, where pixel values were roughly equal across images. Real photographs rarely cooperate. Overexposed or dark images skew heavily toward one value, making memories too similar for the network to distinguish what actually matters.

The solution, now published in the Journal of Statistical Mechanics, is called Centered Daydreaming. Instead of comparing absolute pixel values, the algorithm compares each pixel's difference from the average — focusing on what changes rather than what simply is. A face recognition system, for instance, ignores shared backgrounds and lighting, attending only to the features that vary. This principle mirrors how biological neurons actually operate: locally, responding to relative signals rather than global absolutes.

In testing, Centered Daydreaming maintained reliable memory retrieval even under strongly biased conditions. Ricci-Tersenghi suggests the work points toward AI systems that are not only more capable but more interpretable and energy-efficient — machines that learn, in a meaningful sense, the way brains do.

The human brain does something elegant at night that artificial intelligence has struggled to replicate: it sorts through the day's experiences, keeping what matters and discarding the rest. Sleep consolidates memory. Now researchers have taught machines to do something similar, and in doing so, they've cracked a problem that has limited AI systems working with real-world data.

The story begins with Hopfield networks, a class of artificial neural networks named after John Hopfield, whose work on these systems earned him the Nobel Prize in 2024. These networks are among the simplest models we have for building associative memory—the ability to recognize a concept even when you encounter it in a new form. Show the network a tree, a dog, an apple. Later, show it a degraded image of any of those things, and it should recognize what it is. The network works by connecting artificial neurons to one another, mimicking how biological brains link different representations to the same idea.

But there's a catch. A classical Hopfield network can store only about 13 percent as many memories as it has neurons. A network with 100 neurons can hold only 13 memories. The rest of its storage fills with what researchers call spurious memories—false attractors that don't correspond to anything real. These are hallucinations, in a sense: configurations that mix elements of real memories together. They waste space and can lead the network astray.

In 2025, Federico Ricci-Tersenghi and colleagues at Sapienza University of Rome proposed an algorithm called Daydreaming, inspired by the consolidation that happens during sleep. The insight was elegant: instead of learning new memories during the day and cleaning up false ones only at night, why not do both at once? The network would strengthen correct memories while simultaneously eliminating spurious ones, as if it were dreaming even while awake. The result was dramatic. The network's capacity climbed to nearly 100 percent—one memory for every neuron.

Yet a significant limitation remained. Hopfield networks perform beautifully when trained on perfectly balanced data—images with roughly equal numbers of white and black pixels, for instance. Real-world data rarely cooperate. Overexposed photographs are mostly white. Night shots are mostly black. When pixels are heavily skewed toward one value, images become too similar to one another. The network loses the ability to distinguish which features actually matter for telling one memory from another.

Ricci-Tersenghi and Japanese colleagues have now published a solution in the Journal of Statistical Mechanics: Theory and Experiment. They modified Daydreaming with a principle borrowed from how biological neurons actually work: decisions should be made locally, not globally. A real neuron connects to only a limited number of other neurons; it never communicates with the entire brain. The new algorithm, called Centered Daydreaming, stops comparing the absolute values of pixels and instead compares their differences from the average. In a face recognition task, for example, many pixels might be identical across all photographs—the background, the lighting. By focusing only on what changes relative to the average face, the differences emerge clearly.

In testing, Centered Daydreaming maintained the network's ability to retrieve memories even when data were strongly biased. The algorithm works with conditions much closer to the real world, and it does so using learning rules that are biologically plausible. Ricci-Tersenghi suggests that understanding how simple, brain-inspired models learn to distinguish signal from noise could eventually lead to artificial intelligence systems that are both easier to understand and more energy-efficient—machines that learn the way brains do, without the waste.

We combined daytime learning with the cleaning and consolidation phase of sleep, as if we were also dreaming during the day.
— Federico Ricci-Tersenghi, Sapienza University of Rome
It is much more realistic for each decision to be made locally. Biological neurons are connected to a limited number of other neurons and never communicate with the whole brain.
— Federico Ricci-Tersenghi
The Hearth Conversation Another angle on the story
Inventor

Why does it matter that the algorithm works with biased data? Couldn't you just balance your training data before you start?

Model

In theory, yes. But real-world data don't come pre-sorted. A medical imaging system might receive mostly normal scans with only a few abnormal ones. A security camera sees mostly empty hallways. You can't always engineer your way around imbalance—and if you do, you're throwing away information.

Inventor

So the old Daydreaming algorithm was already a big leap. What was broken about it?

Model

It worked beautifully on clean, balanced data. But the moment you fed it something realistic—overexposed photos, dark images, anything skewed—it started confusing memories. The network couldn't figure out what actually distinguished one thing from another when most of the pixels were the same color.

Inventor

And the fix is to look at differences instead of absolute values?

Model

Exactly. Instead of asking "is this pixel white or black," the network asks "how does this pixel differ from the average pixel in this image?" It's a small shift, but it lets the network focus on what's actually distinctive.

Inventor

Why does it matter that this is done locally, neuron by neuron, rather than globally?

Model

Because it's more like how actual brains work. A real neuron doesn't have access to information from the entire brain. It only talks to its neighbors. If we want AI systems that are truly brain-inspired—and more efficient—we need to respect that constraint.

Inventor

What happens next? Is this ready to use?

Model

The paper shows it works in theory and in testing. But there's always a gap between a journal publication and real-world deployment. The next step is seeing whether this scales to larger, more complex problems, and whether the energy savings Ricci-Tersenghi predicts actually materialize.

Contact Us FAQ