Predictive Coding | How Do Brains and AI Predict the World?

What is the Predictive Coding Theory?

What is Predictive Coding in the brain?

Predictive coding is a theory in neuroscience that suggests the brain does not passively process sensory information as it arrives. Instead, it actively predicts this information. Based on prior experiences and established knowledge, the brain constructs an internal model of the world and generates predictions about the causes of sensory input. For instance, when you see a tennis ball flying towards you, your brain predicts its trajectory, speed, and expected impact. This prediction is sent down from higher-level cortical areas to lower-level sensory areas. The sensory areas then compare this top-down prediction with the actual bottom-up sensory data. The difference between the prediction and the reality is called "prediction error." If there is a significant error—for example, the ball suddenly changes direction—this new information is prioritized and sent back up the cortical hierarchy to update the internal model. This process ensures that the brain is constantly refining its understanding of the world, making it a highly efficient and adaptive processing system.
notion image

How does this process save the brain's energy?

The primary advantage of predictive coding is its metabolic efficiency. The brain consumes about 20% of the body's energy despite being only 2% of its weight, so energy conservation is critical. Instead of processing the entire stream of sensory data from our environment—which is vast and constant—the brain only needs to process the prediction errors, or the "surprises." When the world behaves as expected, minimal information needs to be transmitted and processed. Only the unexpected elements capture the brain's full attention and computational resources. This is analogous to a video compression algorithm that only stores the changes between frames rather than encoding each full frame. By minimizing the amount of information that needs to be actively processed, predictive coding significantly reduces the brain's energy expenditure and allows it to allocate resources to other vital cognitive functions.

Predictive Coding in Brains vs. AI

Do current AI models use Predictive Coding?

Yes, principles analogous to predictive coding are central to many modern AI architectures. Machine learning models, particularly generative models like Variational Autoencoders (VAEs) and Generative Pre-trained Transformers (GPT), operate on a similar foundation. These systems are trained to build an internal representation (or model) of data. They then use this model to predict outputs, such as the next word in a sentence or missing parts of an image. The training process involves minimizing a "loss function," which is mathematically equivalent to the "prediction error" in the brain. By adjusting its internal parameters to reduce this error, the AI refines its model to better match the structure of the training data. This makes the AI proficient at generating new, realistic data that conforms to the patterns it has learned.
notion image

What's the main difference between the brain's prediction and AI's?

The fundamental difference lies in complexity and integration. The brain's predictive coding is a deeply embodied process, seamlessly integrated with our motor system, emotions, and consciousness. It operates in real-time across multiple sensory modalities to guide our actions and shape our subjective reality. In contrast, AI's prediction mechanisms are typically specialized for specific tasks and datasets. While powerful, they lack the brain's holistic integration and adaptability. The brain's internal models are flexible and constantly updated by lifelong learning and experience, whereas an AI's model is generally fixed after its training phase is complete. Furthermore, the brain's prediction errors have subjective consequences, such as feelings of surprise or curiosity, which drive learning in a way that AI has not yet replicated.

Implications of Predictive Coding

Can failures in predictive coding lead to mental health conditions?

There is strong evidence that dysfunctions in the predictive coding system are linked to various psychiatric and neurological conditions. For example, in anxiety disorders, the brain may be biased towards predicting threat, generating persistent prediction errors that signal danger even in safe environments. This leads to a state of chronic hyper-arousal. In schizophrenia, a failure to properly weigh prediction errors might explain symptoms like hallucinations and delusions. An individual might perceive inner thoughts as external voices because the brain fails to cancel out the self-generated sensory predictions. Similarly, in autism spectrum disorder, it is hypothesized that the brain may under-weigh prior beliefs and over-weigh sensory prediction errors. This could lead to a world that feels overwhelmingly intense and unpredictable, as every minor sensory detail is treated as a major surprise. Understanding these links is opening new avenues for targeted therapies aimed at recalibrating the brain's predictive machinery.
notion image