The factory of dreams: what your brain builds when no one is watching
Every night the brain runs roughly two hours of pure generative simulation. A look at why dreams are so vivid, why they vanish on waking, and what they might be for.
Start with the fact that quietly rearranges everything: almost everyone dreams for roughly two hours a night. Not just “people who remember their dreams” — everyone, every night. When a sleeper is woken during REM sleep, they report a dream in progress around eight times out of ten, whether or not they consider themselves a dreamer. The difference between someone who remembers and someone who does not is not a difference in production. It is a difference in recording. The problem was never the dreaming. The problem is that the tape does not get written to disk.
That is a strangely hopeful place to begin, because a recorder is something that can be fixed. To see how, it helps to understand what the night actually is.
The night is not a block
Sleep is not a single descent into darkness. It is a loop of roughly ninety minutes that repeats four or five times, threading through very different floors. There is the drift into sleep (stage N1, the hypnagogic state — worth remembering, it returns later), light sleep (N2), deep slow-wave sleep (N3, the stage that does most of the body’s physical repair), and then a climb back up into something genuinely strange: REM sleep, named for the rapid eye movements that give it away. The most vivid, narrative, bizarre dreams live there.
The shape of the night matters. Early on, the deep stages dominate and REM episodes last only a few minutes. By the small hours, those REM episodes stretch to twenty, thirty, sometimes forty-five minutes. The consequence is direct and counterintuitive: cutting an hour off the night does not cost twelve percent of the dreaming — it can cost a third of it. An early alarm amputates precisely the kingdom of dreams, not the restorative deep sleep. The last ninety minutes are the richest, and they are the first thing sacrificed when we get up early.
The paradox of paradoxical sleep
REM is also called paradoxical sleep, and the paradox is worth dwelling on. Look at the brain’s electrical activity during a REM episode and it is almost indistinguishable from waking: fast, desynchronised, intense. The visual cortex lights up, the amygdala runs hot, motor regions fire off commands. Everything says an awake brain, very busy. And yet the body is more inert than in any other stage. A command from the brainstem switches off nearly every muscle — this is muscle atonia. Only the diaphragm survives (breathing continues) and the eyes, which twitch under the lids and lend the stage its name.
Hold the image: during a dream the brain is an engine room running at full power with both the sensors and the motors unplugged. Nothing comes in — the thalamus, the sensory gateway, screens out the external world. Nothing goes out — atonia locks the muscles, which is fortunate, since otherwise dreams would be acted out in the bedroom. All that activity runs in a closed circuit. The question is: a closed circuit running on what?
Dreaming as prediction in open loop
A useful frame comes from predictive processing, the view that the brain is fundamentally a prediction machine. Awake, it continuously generates a simulation of the world, and the senses serve mainly to correct it — only the prediction error travels upward. Perception, on this account, is a “controlled hallucination”: controlled by the sensors.
Now cut the sensors, as REM does. The generator does not stop. It cannot stop; producing the world is its job. But no prediction error arrives to call it to order. The simulation runs in open loop: each image summons the next, with reality never stepping in to say no, that’s not it. A dream, in this view, is the controlled hallucination minus the control. That is why it is fluid, associative, ever-shifting — it is a model of the world feeding on itself, freed from the obligation to match the facts.
And why is it so strange without seeming strange at the time? Two chemical ingredients. During REM, noradrenaline — the neuromodulator of vigilance, the “something is off” signal — falls to its lowest level of the entire day. And the dorsolateral prefrontal cortex, the brain’s internal inspector, the part that doubts and checks, is largely switched off. The critic has left the room. The bus can be driven by a dolphin and no one objects.
The chain in one sentence: sensors cut, generator running, critic asleep — a world invented, lived as real, accepted without argument. Not a malfunction, but a precise configuration the brain elects to enter every night.
Why dreams are forgotten
Here is the part that should reconcile anyone with years of blank mornings. The forgetting of dreams was long assumed to be passive — a lapse of attention, a lazy memory. Recent research tells a different story: the brain actively erases. In the hypothalamus, a population of so-called MCH neurons (named for the hormone they release) fires strongly during REM specifically, and their measured effect is to inhibit the hippocampus — the structure that records new memories. In mice, switching these neurons on during REM degrades memory; switching them off improves it. And the effect exists only during REM: awake or in deep sleep, nothing is lost.
In other words, while the film is being projected, the recorder is deliberately unplugged. Add noradrenaline at the floor — the same chemical that “tags” a memory as important — and it becomes clear why a twenty-minute dream evaporates in ninety seconds. It was never written to disk. It exists only in volatile memory, and the smallest event on waking — moving, thinking about the day, reaching for a phone — overwrites it.
Why would a brain do this? The leading hypothesis is economy. If every night dumped two hours of lived fiction into autobiographical memory, waking life would blur with the invented one; it would become hard to tell what was done from what was dreamt. Forgetting dreams may be the price of the integrity of true memory. But — and this is the crack in the wall — the lock is not absolute. It leaves a window of a few dozen seconds on waking, during which volatile memory is still legible. Catching a dream is the art of exploiting that window before it closes. And that is a skill, not a gift.
What are dreams for?
No one has the definitive answer, but three families of theory hold the field — and read closely, they may be telling the same story from three angles.
The first is emotional triage. Dreams may replay emotionally charged experiences in order to defuse them: by re-running the scene without the chemistry of stress, the memory is gradually separated from its charge. Some recent work even speaks of “dreaming to forget” — the dream as part of memory’s emotional housekeeping.
The second is the threat simulator. In this evolutionary reading, the dream is a flight simulator: a risk-free environment in which to rehearse critical situations — being chased, falling, confronting — so that the response circuits stay sharp. Hence the overwhelming over-representation of threat in the dreams of every human culture.
The third, the newest and boldest, is the overfitted brain hypothesis, proposed by the neuroscientist Erik Hoel. Anyone who has trained a machine-learning model knows the failure mode: a model that learns its training data “too well” loses the ability to generalise — it recites instead of understanding. The engineer’s remedy is to inject noise, corrupt the data, show the model distorted examples. Hoel proposes that dreaming is exactly that, for the brain. Each day teaches the same life, the same rooms, the same routines — a dangerously repetitive dataset. At night, the brain deliberately generates out-of-distribution experiences — warped, improbable, hallucinated — to keep its model of the world from rigidifying. On this reading, the weirdness of dreams is not a bug. The weirdness is the function.
The convergence is striking. In all three cases the dream is a simulation generator that widens the domain of validity of the model — emotional, behavioural, or conceptual. The predictive brain predicts the world; the dream is its generative training session. There is something disquieting about describing sleep in the vocabulary of machine learning, but when biology and engineering independently converge on the same structure, it is often a sign that something real has been touched.
A window, not a vault
The most practical takeaway is also the gentlest. Recall is not about willpower or talent; it is about respecting the window. An intention formed at bedtime — a clear, quiet “tonight I will remember a dream” — is one of the most reliably replicated effects in the whole literature; it orients what the waking mind reaches for first. On waking, stillness is everything: the window lasts a minute or two, and any movement or stray thought of the day overwrites the tape. Starting from whatever fragment remains — often an emotion or a single image — and rewinding from there tends to pull the rest along. And the natural end of the night, when the long REM episodes live, is worth more than any forced waking; the dream that lasts the longest is also the cheapest to lose to an early alarm.
The hypnagogic state at the edge of sleep offers an easier door still. In N1 the amnesic lock is not yet fully engaged, and mini-dreams surface freely. Edison and Dalí famously napped with a steel ball in hand: at the moment of dropping off, the ball fell, the clatter woke them, and they noted whatever the mind had been fabricating. Modern research has validated and instrumented the trick. It is, in effect, a dream-recall training ground in the format of a twenty-minute nap.
What stays with me is the inversion at the centre of all this. We tend to think of dreams as the part of the mind we have lost. But nothing has been lost — two hours of pure generative activity happen every night, exactly on schedule, and the brain takes deliberate care to keep them out of memory. The dream is not the failure of an awake mind. It is what the machine does, on purpose, when no one is watching — including the dreamer.
Further reading
- Erik Hoel, The Overfitted Brain Hypothesis (Patterns, 2021) — the paper that links dreaming to generalisation, written by a neuroscientist fluent in the language of machine learning.
- NIH / NINDS, The brain may actively forget during dream sleep — a clean account of the MCH-neuron work behind “the recorder is unplugged.”