Your Brain Has a Real Estate Problem, and Dreams Might Be the Solution
What a strange theory about REM sleep tells us about building AI that doesn’t quietly fall apart
Your Brain Has a Real Estate Problem, and Dreams Might Be the Solution
What a strange theory about REM sleep tells us about building AI that doesn’t quietly fall apart
Put a blindfold on a sighted adult and stick them in an fMRI scanner. Get them to feel some textured surfaces with their fingers. Then watch what happens in their visual cortex, the part of the brain that is supposed to be doing absolutely nothing in the dark. It lights up. Not after weeks, not after days, but after about forty-five minutes.
That finding, which has been replicated in various forms since the early 2000s, is one of the more unsettling results in modern neuroscience. The visual cortex is not a quiet, dormant region waiting patiently for the lights to come back on. The moment you stop using it for vision, the neighbours start moving in. Touch first, then hearing. Within an hour, real estate that was supposed to be reserved for processing photons is being repurposed for something else entirely.

Image generated using MidJourney
This raises an obvious and slightly alarming question. If your visual cortex starts getting taken over within an hour of going dark, what happens every single night when you close your eyes for eight hours?
A neuroscientist named David Eagleman thinks he has the answer, and it is one of the more interesting hypotheses about why we dream that has come along in a while. He calls it the defensive activation theory, and once you understand it, you start seeing the same pattern everywhere, including in some surprisingly broken corners of how we currently build AI.
The territorial brain
Before we get to the dreams, we need to get the brain part right, because the underlying mechanism is genuinely strange.
Your cortex is not a fixed map of regions with permanent assignments. It is more like a city under continuous, low-grade redistricting. Every region is defending its territory against its neighbours, all the time. The currency of that defence is activity. As long as a region is being used, it holds its ground. As soon as it falls quiet, the boundaries start to shift.
We have known this for a long time in extreme cases. People who lose their sight early in life end up with occipital cortex that is no longer doing visual work. It gets recruited for hearing, for touch, for reading Braille. There is a well-documented phenomenon where blind people develop genuinely superior hearing, not through some mystical compensation but through a fairly mechanical reallocation of cortical resources.
What was new, and what changes the picture, is the speed. Researchers expected this kind of takeover to be a slow developmental process, the kind of thing that requires months or years. What they found, when they actually measured it, was that you can detect the shift in well under an hour. The wiring was not being built from scratch. It was already there, latent, masked, waiting. Take away the dominant signal and the latent connections come to life almost immediately.
If you have ever moved out of a shared house and come back a week later to find your room turned into a home gym, you have the right intuition. Cortical squatters work fast.
Why we might dream
Now think about what this means for an animal that lives on a rotating planet.
Half the day, the lights are off. For your hearing, your sense of touch, your sense of smell, this changes nothing. The crying baby still cries. The bug crawling on your arm still crawls. The smoke from the living room fire still smells like smoke. These senses get continuous input around the clock, so their cortical territory is never undefended.
Vision is different. The moment darkness falls, the visual system goes quiet. Eight hours of quiet, every single night, for an entire lifetime. If the brain is as territorial as the evidence suggests, the visual cortex should be getting eaten alive by its neighbours.
Eagleman’s hypothesis is that dreams are the defence. Specifically, that REM sleep exists to fire up the visual cortex from inside, on a roughly ninety-minute cycle through the night, so that when you wake up your visual system is still your visual system rather than an annexed colony of your auditory and somatosensory cortex.
This is why dreams are overwhelmingly visual rather than, say, olfactory or tactile. Your nose did not need defending tonight. Your eyes did.
The supporting evidence is circumstantial but consistent. Across primate species, the proportion of REM sleep correlates with the degree of cortical plasticity. As humans age, both REM sleep and neuroplasticity decline together. People who go blind after the age of seven retain visual content in their dreams; people who go blind earlier do not, and their occipital cortex shows more takeover by other senses.
It is not a closed case. The theory is hard to test directly, and there are competing explanations for REM sleep that have their own evidence. But as a hypothesis it has the virtue of explaining why dreams have the specific properties they do, which is more than most theories of dreaming manage.
What I find genuinely interesting, though, is not the dream part. It is the architectural principle underneath it.
A principle that should make engineers uncomfortable
Strip the biology out and what you are left with is this:
A complex system with reconfigurable resources will silently lose capability in any subsystem that is not regularly exercised, even if no one is actively trying to take that capability away.
That is not a statement about brains. That is a statement about a class of systems. And once you start looking, you find it everywhere.
Muscles atrophy under disuse. Bones lose density when the load goes away. Capillary beds prune themselves out of unused tissue. Skills you do not practise fade. Languages you stop speaking get harder to recall. Code you do not run breaks in ways you only discover when you finally try to run it.
In every case, the same dynamic. The system is not standing still. It is continuously redistributing finite resources toward whatever is being used right now. Stop using something and the resources flow elsewhere, often before you notice.
The brain’s response to this dynamic, if Eagleman is right, is one of the more elegant pieces of biological engineering you could ask for. It does not try to freeze the architecture. It does not try to disable the reallocation mechanism. It just keeps the threatened subsystem active enough to hold its ground, using internally generated activity when external input is unavailable. Dreaming is not a side effect of sleep. Dreaming is subsystem maintenance.
What this looks like in AI, or rather, what it doesn’t
Modern machine learning has a concept called catastrophic forgetting. The classic version goes like this. You train a model to recognise cats. It does well on cats. Then you train it to recognise dogs. It does well on dogs. Then you check how it does on cats and discover, to your horror, that it can no longer recognise a cat to save its life. The new training has overwritten the parameters that supported the old capability.
There is an entire literature on how to mitigate this. Replay buffers that mix old training data into new training. Regularisation techniques that try to protect the parameters most important for previous tasks. Adapter modules that isolate new learning into separate weights. Mixture-of-experts architectures that route different inputs to different specialist subnetworks. All of these are addressing the active overwriting case. Something is being trained, and we want to make sure it does not erase what was already there.
In a brain, the threat is not just active overwriting. It is passive disuse. A subsystem that is not being exercised loses its territory even when nothing is actively trying to displace it.
In a standard machine learning model, this is not a thing, because inference is read-only. You can ignore a subnetwork for a year and the weights will be exactly where you left them (you do get model drift, but that is the world moving, not the weights, and it is a story for another article). So the problem does not arise.
But the moment you step outside that comfortable assumption, it starts arising in some very practical places. Consider a few examples.
A robotics system with multiple sensor modalities. A delivery robot has cameras, lidar, ultrasonics, and microphones. In bright daylight on a clear pavement, the cameras dominate. The ultrasonic processing pipeline gets used much less. If any part of that system supports online adaptation, even just a slowly-updating router that learns which sensor to trust in which conditions, the underused pipeline will quietly degrade. By the time you genuinely need ultrasonics, in heavy fog or at night, you may discover that the system has effectively forgotten how to weigh that signal properly.
A mixture-of-experts language model in production. These models work by routing each input to a small subset of specialist subnetworks. If your traffic pattern is dominated by a few common request types, the experts that handle those will get most of the activity. If the model is being fine-tuned in production, even gently, the rarely-routed experts can quietly atrophy. When an unusual request finally arrives, the expert that should handle it may not be in great shape.
Any agent that learns continuously from its environment. A reinforcement learning system in a warehouse, or a recommendation system that updates online, or any kind of long-running adaptive agent. The capabilities it does not exercise are not just sitting safely on a shelf. In a system with continuous parameter updates, everything is being slowly overwritten by everything else, all the time. Capabilities you stop using get gradually scribbled over.
The thing is, none of this is news to people who run these systems in production. Anyone who has watched a model drift over six months knows that capabilities decay in ways that are hard to predict and harder to debug. What is missing is a principled framework for thinking about it. We treat each instance as a one-off engineering problem to be patched. The brain treats it as the basic operating reality and builds an entire subsystem dedicated to addressing it.
Dreaming for machines
Imagine that every long-running AI system, instead of going idle when it has no work to do, spent its idle cycles running maintenance passes over its own internal subsystems. Not retraining. Not learning anything new. Just exercising the parts of itself that have not seen action recently, the way a body builder maintains muscle groups that are not part of this week’s training plan. In some places we have stumbled into something like this without quite naming it.
Generative replay is a technique where a continual learning system uses a generative model to fabricate examples from past tasks, then trains on those alongside new data to preserve old capabilities. This is usually framed as a memory technique, a way of remembering the old training distribution. But it is mechanistically very close to dreaming under Eagleman’s theory: the system generates internally-driven activity to keep underused pathways alive.
The DAT lens reframes this. It is not really about memory. It is about territorial maintenance of subsystems that would otherwise quietly fade. And once you see it that way, some practical design choices fall out.
Replay should be driven by utilisation telemetry, not by schedule. A maintenance pass should be triggered by detecting that a subsystem has not been active for some threshold period, the same way the brain’s PGO waves appear to fire when the visual cortex’s external drive drops, not when the clock hits a certain hour. Schedule-driven replay treats every subsystem the same. Telemetry-driven replay defends what actually needs defending.
The replay content does not need to be realistic. Dreams are famously bizarre, fragmentary, surreal. If their job is to maintain the visual cortex’s structural integrity rather than to recall accurate experiences, this makes perfect sense. The activity matters, not the semantics. Translated to AI, this means a maintenance pass over an underused module does not necessarily need carefully curated training data. It needs plausible activation patterns, which can often be generated cheaply from internal sources.
Maintenance is a distinct subsystem from learning or inference. This is the architectural lesson that most matters. Current AI systems have two fundamental modes: training and inference. The brain has at least three: waking activity, deliberate consolidation during slow-wave sleep, and defensive maintenance during REM. The third mode is doing structural work that the other two cannot do, and it has no equivalent in the systems we build.
For embedded and edge systems, where these problems are most acute and the resources are most constrained, the implications are immediate. A low-power microcontroller running a vision pipeline that is rarely used does not need to retrain that pipeline to keep it healthy. It needs to occasionally activate it, on cached inputs or internally generated ones, during cycles where nothing else is happening. That is cheap. It is implementable today. And to my knowledge, almost nobody is doing it, because we have not had the conceptual frame to know that we should.
The bigger lesson
I keep coming back to the framing problem. We talk about AI architectures as if they were buildings: designed once, constructed, then occupied. The brain is not a building. The brain is a city, and every neighbourhood in that city is in a continuous low-grade negotiation with every other neighbourhood about who gets which block.
In that kind of system, doing nothing is not a stable state. Standing still is losing ground. And the only way to hold what you have built is to keep using it.
The defensive activation theory might be wrong. It might turn out that REM sleep is doing something else entirely, and the territorial-maintenance story is just one more interesting hypothesis that didn’t pan out. Even if that happens, the underlying engineering principle is on solid ground, because the cortical takeover phenomenon it is trying to explain is real and well-documented. Whatever is keeping the visual cortex alive at night, something has to be, because the alternative is incompatible with how the system is observed to behave.
The lesson for those of us building artificial systems is that biology has been quietly running an experiment for a few hundred million years on what it takes to maintain a complex, plastic, reconfigurable computational substrate over a long time. The answer it has converged on is not what most of our architectures look like. Our architectures are static where biology is dynamic, fixed where biology is contested, and silent during the very periods when biology is doing some of its most important work. There is probably something to learn from that.
The next time you wake up from a particularly vivid dream and wonder what on earth your brain was doing, consider the possibility that it was not telling you anything. It was not processing your day. It was not working through your subconscious anxieties. It was just defending the neighbourhood.
My first book, Embedded AI, is published later this year by No Starch Press. It includes 25 hands-on hardware projects deploying machine learning on microcontrollers. Sign up for launch updates and bonus material! To support my writing here, please show your appreciation by following me, or subscribe to get an email whenever I publish a new article.
메타데이터
- post_id
- cac67894bbf2
- slug
- your-brain-has-a-real-estate-problem-and-dreams-might-be-the-solution-cac67894bbf2
- url
- https://medium.com/embedded-ai/your-brain-has-a-real-estate-problem-and-dreams-might-be-the-solution-cac67894bbf2
- canonical_url
- https://medium.com/embedded-ai/your-brain-has-a-real-estate-problem-and-dreams-might-be-the-solution-cac67894bbf2
- author_url
- https://medium.com/@reefwing
- status
- ok
- fetched_at
- 2026-06-09 15:37:30