1. Home
  2. Glossary
  3. Predictive coding
Biocomputing glossary

What is predictive coding? How the brain may compute with predictions and errors

Predictive coding says the brain sends predictions down and prediction errors up. The Rao and Ballard model, the evidence, and why it matters for OI.

By Organoid Programming6 min readHow we source and fact-check

Definition

Predictive coding: Predictive coding is a theory of neural computation in which higher brain areas continuously predict the activity of lower areas, and only the mismatch, the prediction error, is passed forward. Formalized for visual cortex by Rao and Ballard in 1999, it explains perception as inference that minimizes prediction error and is closely tied to the free energy principle.

Also known as: predictive processing, prediction error coding, hierarchical predictive coding

Predictive coding is a theory of brain function in which higher areas continuously predict the activity of lower areas, and only the unpredicted part of the signal, the prediction error, is sent forward. The brain refines its predictions to reduce these errors. Formalized for visual cortex by Rao and Ballard in 1999, predictive coding frames perception as inference.

Key takeaways

  • In predictive coding, feedback connections carry predictions and feedforward connections carry prediction errors.
  • Rao and Ballard’s 1999 model in Nature Neuroscience reproduced puzzling visual responses, such as end-stopping, as consequences of prediction.
  • Under the free energy principle, minimizing free energy can reduce to minimizing precision-weighted prediction error, which links the two theories.
  • Evidence such as responses to unexpected stimuli is consistent with predictive coding, but alternative explanations remain and the theory is actively debated.
  • For organoid intelligence, predictive coding suggests that predictability of input can act as a training signal, and that expected-versus-unexpected responses can test what a culture has learned.

What is predictive coding and where did it come from?

The idea that perception involves inference is old. In the 19th century, Hermann von Helmholtz described perception as unconscious inference: the brain infers the most likely causes of its sensations. Predictive coding turns that idea into a concrete scheme for how neurons might do it.

An early application came from the retina. Srinivasan, Laughlin and Dubs (1982, Proceedings of the Royal Society B) proposed that inhibition in the retina subtracts a prediction of a point’s brightness, based on its neighbors, so that only the unpredictable part is transmitted. This removes redundancy and makes efficient use of limited signaling capacity.

The cortical version was set out by Rajesh Rao and Dana Ballard in Nature Neuroscience (1999). They built a hierarchical model of visual cortex in which each level tries to predict the activity of the level below through feedback connections. Each lower level compares the prediction with its actual input and sends the residual error forward. When trained on natural images, the model reproduced extra-classical receptive field effects, such as end-stopping, in which a neuron’s response falls when a line extends beyond its receptive field. In the model, a long, continuous line is well predicted by the higher level, so little error remains to be signaled.

How does predictive coding work?

A predictive coding hierarchy has two kinds of signal moving in opposite directions.

  1. Predictions flow down. Each level holds a representation of the likely causes of its input and uses it to predict activity in the level below.
  2. Errors flow up. Each level computes the difference between the prediction and what it receives, and passes that error to the level above.
  3. Representations update. Higher levels adjust their representations to explain away the errors. This happens quickly, during perception.
  4. Connections learn. Over longer timescales, synaptic weights change to make future predictions better, which corresponds to learning.

Precision: how much to trust an error

Not every error deserves equal weight. A prediction error from a noisy, unreliable input should count for less than one from a clear input. Friston (2005, Philosophical Transactions of the Royal Society B) placed predictive coding within a broader account of cortical responses, and later work framed this weighting as precision. Precision-weighting is often linked to attention and neuromodulation, and it is one of the bridges to active inference, where the same machinery is extended to action.

A cortical circuit for predictions and errors

Bastos et al. (2012, Neuron) proposed how predictive coding might map onto the layered structure of cortex. In their account, superficial pyramidal cells encode prediction errors and send them forward, while deep pyramidal cells encode predictions and send them back. They linked forward signaling to faster gamma-band rhythms and backward signaling to slower alpha and beta rhythms. This canonical microcircuit hypothesis has guided many experiments, though the details remain under investigation.

What is the evidence for predictive coding?

Keller and Mrsic-Flogel (2018, Neuron) reviewed evidence that predictive processing may be a canonical computation across cortex. Commonly cited lines of evidence include:

  • Extra-classical receptive field effects, such as end-stopping and surround suppression, which predictive coding models reproduce.
  • Repetition suppression, the reduced response to a stimulus that has become predictable through repetition.
  • Mismatch responses, including the mismatch negativity measured with EEG when an expected sound is replaced by a different one.
  • Sensorimotor mismatch neurons, cells in mouse visual cortex that respond when visual flow does not match the animal’s own running.
Observation Predictive coding explanation Alternative explanations
End-stopping Long lines are predicted by higher areas, so error is small Local inhibitory surround circuits
Repetition suppression Repeated stimuli become predicted Neuronal fatigue or adaptation
Mismatch negativity Deviant sounds generate prediction error Adaptation of neurons tuned to the standard sound
Visuomotor mismatch Error between predicted and actual visual flow Mixed sensory and motor tuning

The table shows why the debate continues. Most observations are consistent with predictive coding, but simpler mechanisms such as adaptation can explain some of them. Experiments that separately manipulate expectation and repetition are one way researchers try to tell these apart.

How does predictive coding relate to machine learning?

Predictive coding has become a topic in machine learning in its own right. Whittington and Bogacz (2017, Neural Computation) showed that a predictive coding network using only local, Hebbian-like plasticity can approximate the error backpropagation algorithm used to train deep networks. Each synapse only needs information available at that synapse, which is closer to how biological synaptic plasticity works than backpropagation’s global error signal.

Property Predictive coding network Backpropagation in deep learning
Learning signal Local prediction errors at each layer Global error propagated backward
Information needed per synapse Local activity and local error Gradients computed through the whole network
Inference Iterative settling of activity Single forward pass
Biological plausibility Higher Lower

This makes predictive coding attractive for brain-inspired hardware such as neuromorphic computing and models based on spiking neural networks, where local learning rules are easier to implement.

What are the debates and limitations?

  • Where are the error neurons? Predictive coding predicts distinct populations encoding predictions and errors. Evidence exists in some areas, but a clean separation is not established everywhere.
  • Flexibility. Like the free energy principle, predictive coding can be adapted to fit many results, which critics argue makes it hard to falsify. Specific circuit models are more testable.
  • Is it the whole story? Some researchers treat predictive coding as one computation among several in cortex rather than a single unifying principle.
  • Hierarchy required. The classic model assumes a hierarchy of areas with forward and feedback connections, which simpler tissues may not have.

Why does predictive coding matter for organoid intelligence?

Brain organoids and cultured networks lack the clear hierarchy of visual areas assumed by the Rao and Ballard model, so it would be a mistake to expect full cortical predictive coding in a dish. The more relevant question is whether living networks show the basic signatures, such as reduced responses to predictable input and enhanced responses to violations, and whether those can be used for training.

Some experiments have already used this logic. In DishBrain, Kagan et al. (2022, Neuron) gave cultured neurons predictable stimulation after successful paddle hits and unpredictable stimulation after misses, and reported improved performance over time. That design is motivated by the free energy principle, of which predictive coding is the perceptual side. Practical implications for experiment design include:

  • Use oddball-style probes. Present a regular sequence of stimuli through a microelectrode array, insert occasional deviants, and test whether responses differ.
  • Separate prediction from adaptation. Control for simple repetition effects so a reduced response is not mistaken for learning.
  • Decode the model. Use neural encoding and decoding to test whether network activity carries information about upcoming, not only current, stimuli.
  • Close the loop. Closed-loop stimulation can make the predictability of feedback depend on the network’s output.

The experiments in how neurons learn in a dish show how these ideas have been put into practice. Making expectation-and-violation protocols, their controls and their analysis reproducible across cultures is part of what we are building at Organoid Programming.

Conclusion

Predictive coding proposes that the brain works by predicting its inputs and passing forward only what it failed to predict. From the retina in 1982 to Rao and Ballard’s cortical model and today’s canonical microcircuit hypotheses, it has become one of the most influential theories of perception, with real evidence and real open questions. For living biocomputers, predictive coding offers both a design principle for feedback and a set of measurable signatures of learning.

Frequently asked questions

What is predictive coding in simple terms?

Predictive coding is the idea that the brain is constantly guessing what it is about to sense. Higher areas send predictions down to lower areas, and lower areas send back only the part of the signal that was not predicted, the prediction error. The brain then adjusts its guesses to shrink those errors. Perception, in this view, is the brain’s best current explanation of its inputs.

Who proposed predictive coding?

Related ideas go back to Hermann von Helmholtz’s notion of perception as unconscious inference, and Srinivasan, Laughlin and Dubs applied predictive coding to the retina in 1982. The best-known cortical model is Rao and Ballard’s 1999 paper in Nature Neuroscience, in which feedback connections carry predictions and feedforward connections carry residual errors through a hierarchy of visual areas.

What is the difference between predictive coding and the free energy principle?

Predictive coding is a specific scheme for perception: a hierarchy of predictions and prediction errors. The free energy principle is a broader claim that self-organizing systems minimize variational free energy. Under certain assumptions, minimizing free energy reduces to minimizing precision-weighted prediction error, so predictive coding can be seen as one way the perceptual part of the free energy principle might be implemented.

What evidence supports predictive coding?

Evidence includes extra-classical receptive field effects such as end-stopping, which Rao and Ballard’s model reproduced; reduced responses to repeated, predictable stimuli; enhanced responses to unexpected stimuli, such as the mismatch negativity in EEG; and neurons in mouse visual cortex that respond to mismatches between movement and visual feedback. Much of this evidence is consistent with predictive coding but can also be explained by other models.

Does predictive coding relate to machine learning?

Yes. Predictive coding networks are a class of models trained by minimizing prediction errors using local learning rules. Whittington and Bogacz (Neural Computation, 2017) showed that such a network with local Hebbian-like plasticity can approximate the error backpropagation algorithm. This makes predictive coding interesting as a biologically plausible alternative to backpropagation and as a design principle for brain-inspired hardware.

Why does predictive coding matter for organoid intelligence?

If neural tissue naturally works to reduce prediction error, then the predictability of stimulation may itself be a lever for training. Experiments with cultured neurons, including DishBrain, have used predictable versus unpredictable feedback with this logic in mind. Predictive coding also suggests readouts, such as responses to expected versus unexpected stimuli, that could test whether a living network has learned a model of its inputs.

Sources

  1. Rao & Ballard (1999). Predictive coding in the visual cortex: a functional interpretation of some extra-classical receptive-field effects. Nature Neuroscience.
  2. Srinivasan, Laughlin & Dubs (1982). Predictive coding: a fresh view of inhibition in the retina. Proceedings of the Royal Society of London. Series B.
  3. Friston (2005). A theory of cortical responses. Philosophical Transactions of the Royal Society B.
  4. Bastos, Usrey, Adams, Mangun, Fries & Friston (2012). Canonical microcircuits for predictive coding. Neuron.
  5. Keller & Mrsic-Flogel (2018). Predictive processing: a canonical cortical computation. Neuron.
  6. Whittington & Bogacz (2017). An approximation of the error backpropagation algorithm in a predictive coding network with local Hebbian synaptic plasticity. Neural Computation.
  7. Kagan et al. (2022). In vitro neurons learn and exhibit sentience when embodied in a simulated game-world. Neuron.