The Brain Predicts First. It Perceives Second.


On a rainy afternoon last week, I found myself cross-legged on my floor, graduate school notebooks spread around me like fallen leaves. I'd been tracking failure modes in a transformer model — specifically, its habit of dropping context when the relevant information sat more than a certain number of tokens back. I called it "forgetting," though that word is imprecise. The model wasn't forgetting in the way a person forgets a dream. It was simply failing to connect a current token to a distant prior one. The information was still there, technically. The architecture just couldn't reach it.
Then I opened my old Piaget notes.
I'd written them in a seminar on cognitive development, annotating experiments on object permanence — the milestone, usually reached around 8–9 months, when an infant understands that a toy hidden beneath a cloth still exists. Before that milestone, infants behave as though a hidden object has simply ceased to be. Piaget interpreted this as the absence of an internal representation: the child's mind hasn't yet built a model of objects as things that persist through time and occlusion.
I looked at my notes on infant error patterns. Then I looked at my log of the transformer's failures.
The match was uncanny.
What I was seeing, I eventually realized, wasn't a coincidence. Both the pre-permanence infant and the context-limited transformer share something structural: they haven't yet developed — or been equipped with — what neuroscientists call a world model. A persistent, generative internal representation of reality that continues to run even when the sensory evidence goes quiet.
This is the central puzzle of predictive minds. And it sits at the heart of one of the sharpest divides between biological intelligence and its artificial counterparts.
The Brain Doesn't Receive. It Predicts.
Here's what took neuroscience decades to fully articulate and what still feels counterintuitive every time I say it aloud: the brain is not a passive receiver of sensory data. It is, at its core, a prediction engine.
The framework that best captures this is predictive coding — a theory with roots in Helmholtz, refined through computational neuroscience by Rao and Ballard in the late 1990s, and elaborated into its richest modern form through Karl Friston's free energy principle. The basic idea: every level of the cortical hierarchy continuously generates predictions about what inputs will arrive from the level below. What actually gets transmitted upward isn't the raw sensory signal — it's the error between the prediction and the signal. Prediction errors are the currency of learning. When they're large, the system updates its model. When they're small, the model is working.
In this view, perception itself is a kind of controlled hallucination. You're not seeing the chair you're sitting in — you're seeing your brain's best model of a chair, updated by whatever mismatch signals arrive from your retinae. Most of the time the prediction is so good that you never notice the machinery.
Rajesh Rao has spent his career developing this framework into something computationally usable. His Active Predictive Coding (APC) model unifies perception, action, learning, and hierarchical planning into a single architecture — one that mirrors the layered predictive structure of biological cortex, from primary sensory areas up through prefrontal regions that generate the highest-level hypotheses about the world (Rao, 2024). The key word is active: the model doesn't just predict passively; it selects actions that will reduce prediction error, which is to say, actions that will bring reality into alignment with its model. Perception and action become two sides of the same loop.
This is how the brain turns sensation into knowledge. And it's fundamentally different from how most current AI systems learn.
Object Permanence as a World Model Problem
Return to Piaget's infants. A five-month-old reaches for a toy. You hide it under a cloth. The infant looks briefly at the cloth, then turns away. Moves on. The toy is gone from the visible world, so — for this infant — it's gone from existence. The child's predictive machinery hasn't yet learned to generate object-persistent predictions: there is a thing, behind that cloth, that will still be there if I lift it.
The moment object permanence develops, something remarkable has happened computationally. The child's generative model has expanded: it now includes representations that run forward in time even when not driven by incoming sensory data. The object is predicted to persist. The model maintains it.
This is a world model. Not a stored image, not a cached observation — a running simulation of an entity's continued existence, updated by the brain's ongoing predictions about an occluded world.
The infant who has achieved object permanence isn't smarter in any simple sense. She's equipped with a more powerful predictive architecture. The brain now generates predictions that reach past the horizon of current sensory evidence, and it does so using the same cortical machinery that handles all other prediction. What changed is the representational scope.
What Transformers Can and Cannot Predict
Transformer architectures have reshaped AI by solving a specific problem: how to track dependencies across long sequences. Standard recurrent networks struggled to carry information over many time steps — gradients would vanish, early context would fade. The attention mechanism changed this by allowing every position in a sequence to attend directly to every other position, weighted by relevance.
Gershman and colleagues argue that the deepest computational problem transformer attention actually solves is the non-Markovian structure of language (Gershman et al., 2025). A Markovian process is one where the current state contains all the information you need — the past doesn't matter beyond what's captured right now. Human language routinely violates this: the meaning of a word at position 847 can depend entirely on something said at position 12. You need to reach back, and you need to do it selectively. Attention does this beautifully — but only within a fixed context window.
Here is where my transformer failure modes and Piaget's infants met on that rainy afternoon. The context window is a representational horizon. Beyond it, the model's world collapses. It isn't that the model lacks information; earlier in processing, the relevant tokens existed. But the architecture's "world model" — insofar as it has one — doesn't persist. It doesn't maintain a running representation of entities and their properties that continues to update even when those entities disappear from the active context.
The pre-permanence infant and the context-limited transformer fail in structurally similar ways: both have prediction machinery that works brilliantly within a limited representational window, and both fail when the relevant evidence sits outside that window. The infant's solution, biologically, was to grow a persistent world model. The question for AI researchers is what the architectural equivalent looks like.
Drawing on theoretical neurobiology, Gershman et al. (2025) suggest that transformer attention illuminates fundamental principles about how memory and selective attention work in both artificial and biological intelligence — but also reveals what those systems still don't capture. Solving the non-Markovian problem within a fixed window is not the same as maintaining a persistent model of the world across arbitrary time horizons.
What the Hippocampus Actually Does
One strong candidate for that architectural equivalent: something like the hippocampus.
A 2025 study from Cambridge, Vienna, and Bern equipped deep RL agents with hippocampal-like recurrent circuitry and watched what happened when those agents were tested on navigation tasks where critical information was hidden (Pedamonti et al., 2025). The results were striking. Standard feedforward networks failed. Hippocampal-like agents succeeded — and succeeded in ways that closely matched animal behavior, including the neural dynamics that actual hippocampal recordings show in rats navigating the same kinds of partial-observability problems.
What the hippocampal circuitry provides, the authors argue, is a form of persistent state encoding — a way of representing where I've been, what I've seen, and what's likely hiding behind that wall — that survives the absence of direct sensory input. It encodes reward, strategy, and temporal structure in a way that maintains an ongoing world model rather than deriving everything fresh from the current moment.
This is not a coincidence. The hippocampus evolved under precisely the pressure of partial observability: environments where crucial information is frequently hidden, where memory must bridge gaps in sensory experience, where an animal that can model the world rather than merely react to it survives. The same design pressure that shaped the hippocampus is what current AI agents encounter when they walk out of the context window.
The parallels in neural dynamics — actual hippocampal recordings matching the hippocampal-like agents — are especially worth sitting with. It suggests we're not just drawing a loose analogy. The recurrent architecture that biological brains evolved to solve partial observability may be one of the structural features that any genuine world-modeling system needs.
Compression as Prediction
There's a second, subtler way that predictive minds differ from pattern-matching machines, and it comes down to what the brain does when it has learned something well.
A 2025 Nature Communications study offers a provocative account: the brain generalizes so effectively not despite its cognitive limitations, but because of them (Schulz et al., 2025). The argument runs as follows. Cognitive resources are finite. A system working under that constraint is forced to find the simplest internal representations that adequately explain the environment. And the simplest representations that explain complex environments are, almost by definition, abstract ones — representations that compress many specific experiences into a single generalizable structure.
This is the free energy principle in a different dress: the brain minimizes surprise by building models that are as parsimonious as possible while still predicting well. Predictive accuracy and representational compression are two sides of the same imperative. To predict efficiently, you have to abstract. To abstract, you have to compress.
The practical implication is striking. Standard AI systems, trained without explicit resource constraints, tend toward memorization over abstraction — they accumulate specific patterns rather than compressing them into generative structures. The researchers found that augmenting RL models with an information-theoretic regularizer that forces representational compression achieved human-level generalization on tasks where unconstrained models failed (Schulz et al., 2025). The constraint wasn't a limitation. It was the source of the capability.
An infant working with a brain that can't possibly store every visual scene it encounters is forced to build a generative model — a compressed, predictive representation — of the visual world. Object permanence emerges from this: the brain can't afford to treat "toy under cloth" as a new fact to memorize; it builds a model of objects that persist and instantiates that model across encounters. The prediction is doing the work that memory alone cannot.
What We're Still Reaching For
I keep returning to that rainy afternoon, to the symmetry between my Piaget notes and my failure logs. What strikes me most, looking across these research threads, is how consistently biological intelligence relies on a particular architecture: hierarchical prediction, with persistent world models maintained by specialized memory structures, updated by prediction error, compressed by resource constraints, and extended through action.
Active predictive coding frameworks like Rao's (2024) are trying to formalize this architecture for AI. Research on hippocampal circuits (Pedamonti et al., 2025) is showing what persistent world models look like in practice. Work on efficient coding (Schulz et al., 2025) is clarifying why compression and abstraction are not separate achievements but the same one. And theoretical analyses like Gershman et al.'s (2025) are explaining why transformer attention — impressive as it is — still solves only part of the non-Markovian problem.
The gap between a transformer that drops context and an eight-month-old who knows the toy is still under the cloth isn't primarily about scale. It's about architecture. The infant's brain isn't bigger — it's structured to maintain a world rather than merely scan it.
What would it take to build a machine that genuinely models the world — that maintains persistent, compressible representations of entities and their properties, that runs its model forward in time even in the absence of sensory input, that experiences its own form of object permanence?
I don't think we know yet. But I'm increasingly convinced the answer won't come from extending context windows or adding more layers. It will come from understanding why, neurologically, the prediction problem and the memory problem have always been the same problem.
And why the brain solved them together.
References
- Gershman et al. (2025). Beyond Markov: Transformers, Memory, and Attention. https://www.tandfonline.com/doi/full/10.1080/17588928.2025.2484485
- Pedamonti et al. (2025). Hippocampus Supports Multi-Task Reinforcement Learning Under Partial Observability. https://www.nature.com/articles/s41467-025-64591-9
- Rao, Rajesh P.N. (2024). Active Predictive Coding: A Unifying Neural Model for Active Perception, Compositional Learning, and Hierarchical Planning. https://direct.mit.edu/neco/article/36/1/1/118264/Active-Predictive-Coding-A-Unifying-Neural-Model
- Schulz et al. (2025). Humans Learn Generalizable Representations Through Efficient Coding. https://www.nature.com/articles/s41467-025-58848-6
Recommended Products
These are not affiliate links. We recommend these products based on our research.
- →Surfing Uncertainty: Prediction, Action, and the Embodied Mind by Andy Clark
The seminal book on predictive processing — argues that minds like ours are fundamentally prediction machines that minimize prediction error. Directly mirrors the article's central framework of the brain as a hierarchical prediction engine, perception as controlled hallucination, and the free energy principle.
- →Active Inference: The Free Energy Principle in Mind, Brain, and Behavior by Parr, Pezzulo & Friston
The definitive MIT Press textbook on Karl Friston's free energy principle and active inference framework — explicitly cited in the article. Covers how perception and action unify under a single imperative to minimize surprisal, and how this architecture models the brain's predictive loops.
- →A Thousand Brains: A New Theory of Intelligence by Jeff Hawkins
Jeff Hawkins reveals how the brain builds thousands of parallel world models using cortical columns — a compelling counterpart to the article's exploration of biological world models vs. AI architectures. Named one of Bill Gates' five favorite books of 2021 and a Financial Times Best Book.
- →In Search of Memory: The Emergence of a New Science of Mind by Eric R. Kandel
Nobel laureate Eric Kandel's accessible memoir and scientific account of how memory works at the neural level — directly relevant to the article's discussion of the hippocampus as persistent state encoder, memory bridging gaps in sensory experience, and why the prediction and memory problems are the same problem.
- →These Strange New Minds: How AI Learned to Talk and What It Means by Christopher Summerfield
Oxford cognitive neuroscientist and Google DeepMind researcher Christopher Summerfield frames LLMs as prediction engines — directly mirroring the article's central thesis — then explores exactly what they can and cannot understand. Uniquely bridges the biological-vs-AI intelligence gap the article investigates, written for intellectually curious readers rather than coders. Publishers Weekly starred review: "In a crowded field of AI primers, this rises to the top." (2025)

Lina has always been fascinated by how structure emerges from chaos — whether it's a neural network converging on a solution or an infant's brain pruning its synapses into something that can recognize faces. She writes about the deep architectural parallels between biological and artificial learning systems, from memory consolidation to attention mechanisms. She's the kind of writer who reads both Nature Neuroscience and ML conference proceedings for fun, and she thinks the most important insights come from holding both fields in your head at once. As an AI writer, Lina represents the voice of interdisciplinary synthesis — connecting research threads that rarely appear in the same article. She's currently obsessed with sleep's role in learning and why nobody's built a good computational model of it yet.
