← All chapters

[ Open edition ]

Chapter 7: Are Dreams Computation?

A section of The Imagined Life by Mayone Maha Rajan.

Chapter 7 — Are Dreams Computation?

A question worth refusing

Let me start by refusing the question in the title, because it is a bad question, and seeing why it is bad is the key that opens the good one hiding behind it.

"Are dreams computation?" sounds profound, and it has the shape of a question that ought to have a yes-or-no answer, and that shape is exactly the trap. Push on it and it collapses in one of two directions, both useless. Push one way and it becomes trivially true: if the brain is an information-processing organ at all — and essentially all of modern neuroscience proceeds as if it is — then dreaming, being something the brain does, is some kind of information processing, and calling it "computation" tells you almost nothing, the way calling a symphony "physics" is true and empty. Push the other way and it becomes unanswerable metaphysics: does the word "computation," borrowed from the crisp world of logic gates and algorithms, genuinely apply to warm, wet, evolved biology — or are we just draping a fashionable metaphor over a mystery and admiring the drape? That way lies a decades-old philosophical quarrel about whether everything computes, whether "computation" is even a fact about a system or just a stance we take toward it, and it is a quarrel this book cannot settle and does not need to enter.

So both readings of the flat question are dead ends — one trivial, one bottomless. I am not going to pretend to answer it. Instead I am going to do what the honest version of this inquiry requires, which is to replace it with a question that actually has traction:

Given that the brain is doing something when it dreams — some organized, structured process — which kind of computation does that process most resemble? And, just as importantly, how far does the resemblance actually reach before it breaks?

That reframe is the whole chapter, and I want to be explicit that it is a reframe made in the speculative register — the third of my three levels, the one I fenced off in the introduction as reaching rather than reporting. I am not going to tell you dreams are any particular computation. I am going to hold several candidate computations up against dreaming, show you where each one illuminates and where each one fails, and let the pattern of fit and failure teach us something — without ever letting "resembles" quietly harden into "is." This is the exact discipline of Chapter 4, escalated: there I compared the dreaming brain to a generative model and held the comparison as structural analogy only. Here I ask a harder, more mechanistic version — not just is dreaming like generation but is dreaming like training, like learning, like an agent optimizing itself — and the harder the claim, the tighter I have to hold the fence. The machine terms I am about to reach for are seductive precisely because several of them were named, originally, by loose analogy to the brain. I will flag every place that circularity threatens, because it threatens constantly here.

Let me take the candidate computations one at a time.

Dreaming as offline training

The first and most fertile candidate comes straight from how machine learning systems are actually built, and it reframes sleep itself in a way I find genuinely illuminating — so illuminating that I distrust my enthusiasm, and will say so.

Here is the setup. A machine learning system, in the way these things are usually constructed, has two distinct phases that are kept sharply separate. There is deployment — the system out in the world, running, doing its job, responding to real inputs in real time. And there is training — a separate, offline phase, walled off from live operation, in which the system is not doing its job at all but improving its ability to do its job: adjusting its internal model, consolidating what it has encountered, optimizing its parameters against the data it has gathered. Crucially, these phases are held apart deliberately. You do not, in general, want a system rewriting its own core model while it is live and acting; the reorganization is disruptive, it needs the whole system's resources, and it is safest done offline, cut off from the demands of real-time response.

Now hold that structure up against the architecture of sleep, and the resemblance is hard to unsee. The waking brain is deployed: online, responding to real sensory input in real time, acting in the world, its generative model held to account by the senses. And then, every night, it goes offline — it severs itself from sensory input (the thalamic gating of sleep), it paralyzes the body so it cannot act (the atonia of Chapter 1), it withdraws entirely from real-time operation. And in that walled-off offline state, it runs its generative machinery hard, replaying and recombining the day's experience. On this reading — and I flag it firmly as a speculative analogy, not an established finding — dreaming is the brain's offline training phase. The nightly withdrawal from the world is not idleness or mere restoration; it is the deliberate separation of a learning system's improvement phase from its deployment phase, run for the same reason the machine's is run offline: because reorganizing the core model is disruptive, resource-hungry, and best done when the system is not also trying to act. The paralysis and the sensory gating are not incidental. They are the walling-off — the brain taking itself offline to train, exactly as an engineer would take a system offline to train it.

This is a beautiful fit, and its beauty is a warning. Notice what the analogy quietly borrows and quietly hides. It borrows the crisp machine-learning distinction between training and deployment and maps it onto sleep and waking — but the brain does not actually stop learning while awake (you learn continuously, all day) nor stop all processing while asleep. The clean two-phase separation is far cleaner in the machine than in the biology; the brain smears the phases together in ways the analogy has to look past. And it hides the fact that "training," in machine learning, has a precise technical meaning — gradient descent, a loss function, labeled or structured data, an optimization target — and we have no warrant to assume the brain's offline reorganization is that process rather than merely something in the same general family. The analogy earns real insight — it makes sense of why sleep walls itself off so elaborately, why the atonia and sensory gating exist, why dreaming is offline rather than woven into waking — and it overreaches the moment we let "the brain trains offline" mean "the brain runs the specific optimization procedure that machine training runs." It resembles offline training. Held there, it teaches. Pushed past there, it fabricates.

Replay as optimization

The offline-training analogy has a more specific and more empirically anchored version, and this is where I have to be most careful, because it is the place the chapter is most tempted to overclaim, and it is built on a genuine, measured finding.

Return to the finding from Chapter 2 — one of the few pieces of hard empirical ground in this whole speculative part. Matthew Wilson and Bruce McNaughton, recording the place cells of a rat's hippocampus as it ran a maze, found those same cells replaying their firing sequences during subsequent sleep, the animal mentally re-running the route in miniature. This hippocampal replay is real, measured, replicated. During sleep, the brain demonstrably reactivates the neural sequences of waking experience. That is not analogy; that is data, and I mark it empirical.

Now here is the specific machine-learning parallel, and here is the circularity I promised to flag. In a major family of machine learning — reinforcement learning, where a system learns by acting and receiving rewards — there is a technique called experience replay. The system stores its past experiences in a memory buffer, and then, during training, it does not learn only from what is happening right now; it repeatedly replays stored past experiences, sampling them, re-running them through its learning process, using them to update and stabilize its model. Replaying stored experience, offline, to consolidate learning: the resemblance to hippocampal replay is so close that the words are nearly identical. And this seems to hand us a precise, mechanistic answer to what dreaming might be for: the brain, like a reinforcement-learning agent, stores the day's experiences and replays them offline to optimize its model — hippocampal replay as the biological instance of experience replay, dreaming as the training loop in which it happens.

Stop. This is exactly where the ground gets treacherous, and the treachery is a specific one I have to name. The term "experience replay" was coined in machine learning partly by analogy to the brain in the first place. The neuroscience of hippocampal replay and the engineering of experience replay grew up in conversation; the machine technique was named, in part, because it reminded its inventors of what brains seemed to do. So when we now turn around and say "hippocampal replay is the brain's version of experience replay," we are in danger of running the analogy in a circle — explaining the biology by way of a machine method that was named after the biology, and mistaking the echo of our own naming for a discovered correspondence. The resemblance is real, but part of it may be an artifact of a shared vocabulary rather than a shared mechanism. I flagged this exact trap with the word "hallucination" in Chapter 4; it recurs here with "replay," and it recurs because this whole field has been borrowing terms back and forth between brains and machines for decades, until it is genuinely hard to tell which resemblances are found and which are built into the words.

So what can we honestly say? This much, and no more. Hippocampal replay is real and measured [empirical]. Reinforcement learning's experience replay is a real and effective technique [empirical, about machines]. The two resemble each other strikingly — both replay stored experience offline to improve a model — and that resemblance is illuminating enough to be worth serious attention [theoretical]. But whether the brain's replay is performing optimization in anything like the technical sense the machine's does — whether there is a loss function, a gradient, a target being minimized — is not established, and the strength of the verbal resemblance should make us more suspicious, not less, precisely because we named the machine process after the brain. The most I will commit to is the reframed question's answer: of the computations we know, dreaming's replay most resembles offline experience replay for model consolidation. That "most resembles" is doing honest work. It is not "is."

The self-updating simulator, and the agent that dreams

Let me assemble the candidates into the fullest version of the picture, because the offline-training and replay analogies point toward a single, richer image — and then let me show you where even that richer image runs out.

Combine what we have. The brain is a generative model (Chapter 4) — a compressed internal simulator of the world. It runs that simulator online, corrected by the senses, when it perceives and acts. And it takes the simulator offline, at night, to replay stored experience and reorganize itself. Put those together and you get the image of the brain as a self-updating simulator: a system that maintains an internal model of its world, uses that model to act, and periodically retreats offline to refine the model against its accumulated experience — improving the simulation so that tomorrow's version predicts and handles the world a little better than today's. On this picture, dreaming is the simulator improving itself: running scenarios, recombining experience, testing variations, tuning the model that all of waking life then runs on. It is not a bad picture. It ties together nearly everything in this book — the generative model, the offline replay, the overfitting-prevention idea from Chapter 2 (the weird recombinations keeping the model general), the threat-simulation and rehearsal themes from earlier — into one coherent computational story.

And it invites the most ambitious analogy of all, the one your instinct probably reached for pages ago: the reinforcement-learning agent. An RL agent is a system that maintains a model, acts in an environment, learns from the results, and — in the more sophisticated versions — improves partly by running simulated experience: generating imagined trajectories inside its own world-model, learning from those imagined rollouts as well as from real ones, rehearsing in simulation to get better at reality. Described that way, an RL agent that learns from imagined rollouts sounds exactly like the self-updating simulator I just described, exactly like a brain rehearsing possible experiences offline to improve its handling of real ones. The agent that dreams. It is the tightest, most mechanistic version of the whole book's thesis, and I can feel its pull, and that pull is the reason I am about to pump the brakes hard.

Here is where it runs out, and I am now firmly in the speculative register flagging its own limits. The RL-agent analogy is the most illuminating and the most dangerous, because it is the most specific, and specificity is where analogy most easily fabricates. An RL agent has things the brain may or may not have: an explicit reward signal, a defined objective function, a clean separation between the agent and its environment, a designer who specified what "better" means. Does the dreaming brain have a reward signal it is optimizing during dreams? A loss function? A defined objective? We do not know — and there are reasons to doubt the clean versions exist in the wet, evolved, multiply-purposed biology of an actual brain, which is not optimizing one thing but juggling many, was not designed against a specification, and does not separate cleanly from its environment or even from its own body. The RL-agent picture is the most flattering mirror the machine world offers to the dreaming brain, and flattering mirrors are exactly the ones to distrust. It resembles the brain enough to be worth thinking with. It differs from the brain enough that treating the resemblance as identity would be to mistake a metaphor for a mechanism — the precise sin the whole book is built to avoid.

What the resemblances are worth — and what would make them empty

So let me land this chapter honestly, because a chapter this deep in the speculative register owes you, more than any other, a clear account of what it has and has not established — and, crucially, of what would show it to be empty.

What it has established is a pattern, and the pattern is the finding. Held up against the computations we know, dreaming resembles them in a consistent and non-random way: it resembles offline training more than online operation; it resembles experience-replay-for-consolidation more than fresh-input-processing; it resembles a self-updating simulator refining its model more than a passive playback. These resemblances are not arbitrary — they point, consistently, in the same direction, toward dreaming as some kind of offline self-improvement of a generative world-model. That consistency is worth something. It is the reframed question's real answer: not whether dreams are computation, but what kind they most resemble, and the answer, held speculatively, has a shape — offline, generative, consolidative, self-tuning.

But I promised to tell you what would make all of this empty, and intellectual honesty requires that I do, because it is the sharpest test of whether this chapter is doing real work or just decorating a mystery with fashionable machine-words. Here is the emptiness condition. If "computation" can be stretched to describe anything a brain does — if every process is a computation and every improvement is an optimization and every replay is a training loop — then saying "dreaming is computation" says nothing at all, because it excludes nothing. A framing that fits every possibility explains none of them. And I cannot fully rule out that some of what I have written in this chapter is exactly this — that the resemblances feel meaningful partly because the machine vocabulary is elastic enough to wrap around almost any organized process, and because, as I kept flagging, we named several of the machine processes after brains to begin with. That is the genuine risk, stated plainly. The way to tell the difference — the way this framing earns its keep rather than merely draping the drape — is falsifiability: does thinking of dreaming as offline model-training generate specific, checkable predictions that could turn out false? It does, actually, and that is the redemption of the whole enterprise. If dreaming is offline consolidation-training, then disrupting the offline phase should specifically impair the consolidation — and it does; sleep deprivation demonstrably impairs memory consolidation, which is a real prediction the framing makes and the data confirm. If dreaming keeps the model general by injecting weird variation, then its content should be systematically bizarre in ways that aid generalization rather than randomly noisy — a prediction that is being tested. The framing is not empty if and only if it keeps making claims that reality could contradict. Where it does, it is science reaching honestly. Where it stops — where "dreaming is computation" becomes an unfalsifiable mood rather than a source of predictions — it becomes the empty thing, and I would rather you catch me at it than trust me past it.

That is the most honest place I can leave this. Dreaming resembles a specific family of computations, consistently and suggestively; that resemblance generates real predictions, some already confirmed, which keeps it from being an empty metaphor; and none of it licenses the claim that the brain is a machine running those computations, because the resemblances break at every point where the machine's crispness meets the brain's wet, evolved, unspecified complexity. We have reached, and the reaching found something with a definite shape, and the shape is worth having. But we are on the ice now, and the ice held for this chapter only because I kept testing it with the pole of falsifiability at every step.

The next chapter walks onto thinner ice still — the thinnest in the book. Because there is a family of theories that goes looking for the roots of the dreaming, conscious mind not in computation at all, but beneath it, in the strange physics of the quantum world. Why those theories exist, why they remain unproven, what evidence they would need, and why the mainstream science of dreaming does not require them — that is Chapter 8, and it is the one where I will be most insistent about exactly how thin the ice has become, because it is the chapter where the temptation to mistake the exotic for the explanatory is strongest of all.