In neuroscience, psychology and cognitive science, predictive coding (also known as predictive processing) is a theory of brain function which postulates that the brain is constantly generating and updating a "mental model" of the environment. According to the theory, such a mental model is used to predict input signals from the senses that are then compared with the actual input signals from those senses. Predictive coding is one member of a wider set of theories that follow the Bayesian brain hypothesis.

Origins Theoretical ancestors to predictive coding date back as early as 1860 with Helmholtz's concept of unconscious inference. Unconscious inference refers to the idea that the human brain fills in visual information to make sense of a scene. For example, if something is relatively smaller than another object in the visual field, the brain uses that information as a likely cue of depth, such that the perceiver ultimately (and involuntarily) experiences depth. The understanding of perception as the interaction between sensory stimuli (bottom-up) and conceptual knowledge (top-down) continued to be established by Jerome Bruner who, starting in the 1940s, studied the ways in which needs, motivations and expectations influence perception, research that came to be known as 'New Look' psychology. In 1981, McClelland and Rumelhart examined the interaction between processing features (lines and contours) which form letters, which in turn form words. While the features suggest the presence of a word, they found that when letters were situated in the context of a word, people were able to identify them faster than when they were situated in a non-word without semantic context. McClelland and Rumelhart's parallel processing model describes perception as the meeting of top-down (conceptual) and bottom-up (sensory) elements.

In the late 1990s, the idea of top-down and bottom-up processing was translated into a computational model of vision by Rao and Ballard. Their paper demonstrated that there could be a generative model of a scene (top-down processing), which would receive feedback via error signals (how much the visual input varied from the prediction), which would subsequently lead to updating the prediction. The computational model was able to replicate well-established receptive field effects, as well as less understood extra-classical receptive field effects such as end-stopping.

In 2004, Rick Grush proposed a model of neural perceptual processing, the emulation theory of representation, according to which the brain constantly generates predictions based on a generative model (what Grush called an ‘emulator’) and compares that prediction to the actual sensory input. The difference, or ‘sensory residual’, would then be used to update the model so as to produce a more accurate estimate of the perceived domain. On Grush’s account, the top-down and bottom-up signals would be combined in a way sensitive to the expected noise (aka uncertainty) in the bottom-up signal, so that in situations in which the sensory signal was known to be less trustworthy, the top-down prediction would be given greater weight, and vice versa. The emulation framework was also shown to be hierarchical, with modality-specific emulators providing top-down expectations for sensory signals as well as higher-level emulators providing expectations of the distal causes of those signals. Grush applied the theory to visual perception, visual and motor imagery, language, and theory of mind phenomena.

General framework

Predictive coding was initially developed as a model of the sensory system, where the brain solves the problem of modelling distal causes of sensory input through a version of Bayesian inference. It assumes that the brain maintains active internal representations of the distal causes, which enable it to predict the sensory inputs. A comparison between predictions and sensory input yields a difference measure (e.g. prediction error, free energy, or surprise) which, if it is sufficiently large beyond the levels of expected statistical noise, will cause the internal model to update so that it better predicts sensory input in the future.

If, instead, the model accurately predicts driving sensory signals, activity at higher levels cancels out activity at lower levels, and the internal model remains unchanged. Thus, predictive coding inverts the conventional view of perception as a mostly bottom-up process, suggesting that it is largely constrained by prior predictions, where signals from the external world only shape perception to the extent that they are propagated up the cortical hierarchy in the form of prediction error.

Prediction errors can not only be used for inferring distal causes, but also for learning them via neural plasticity. Here the idea is that the representations learned by cortical neurons reflect the statistical regularities in the sensory data. This idea is also present in many other theories of neural learning, such as sparse coding, with the central difference being that in predictive coding not only the connections to sensory inputs are learned (i.e., the receptive field), but also top-down predictive connections from higher-level representations. This makes predictive coding similar to some other models of hierarchical learning, such as Helmholtz machines and Deep belief networks, which however employ different learning algorithms. Thus, the dual use of prediction errors for both inference and learning is one of the defining features of predictive coding.

Precision weighting

The precision of incoming sensory input is their predictability based on signal noise and other factors. Estimates of the precision are crucial for effectively minimizing prediction error, as it allows to weight sensory inputs and predictions according to their reliability. For instance, the noise in the visual signal varies between dawn and dusk, such that greater conditional confidence is assigned to sensory prediction errors in broad daylight than at nightfall. Similar approaches are successfully used in other algorithms performing Bayesian inference, e.g., for Bayesian filtering in the Kalman filter.

It has also been proposed that such weighting of prediction errors in proportion to their estimated precision is, in essence, attention, and that the process of devoting attention may be neurobiologically accomplished by ascending reticular activating systems (ARAS) optimizing the “gain” of prediction error units. However, it has also been argued that precision weighting can only explain “endogenous spatial attention”, but not other forms of attention.Ransom M. & Fazelpour S (2015). Three Problems for the Predictive Coding Theory of Attention. http://mindsonline.philosophyofbrains.com/2015/session4/three-problems-for-the-predictive-coding-theory-of-attention/

Active inference The same principle of prediction error minimization has been used to provide an account of behavior in which motor actions are not commands but descending proprioceptive predictions. In this scheme of active inference, classical reflex arcs are coordinated so as to selectively sample sensory input in ways that better fulfill predictions, thereby minimizing proprioceptive prediction errors. Indeed, Adams et al. (2013) review evidence suggesting that this view of hierarchical predictive coding in the motor system provides a principled and neurally plausible framework for explaining the agranular organization of the motor cortex. This view suggests that “perceptual and motor systems should not be regarded as separate but instead as a single active inference machine that tries to predict its sensory input in all domains: visual, auditory, somatosensory, interoceptive and, in the case of the motor system, proprioceptive.”

Dual process theory The dual process theory of automatic and conscious cognitive processes lays the groundwork of understanding the operation of the human mind in psychology. Ideas related to dual process theories can be traced to William James’s work in 1890, which distinguished between habitual processes, based on automatic associations formed through experience, and voluntary processes, involving more effortful, conscious reasoning. It reflects a more hierarchical and conscious reasoning that represents a more willful process. These initial concepts of automatic and voluntary cognitive processes map onto modern dual process theory, conceptualized by many psychologists.

Some researchers have drawn parallels between dual process theories and predictive coding. In this view, automatic processing (often termed “system 1”) is compared to the initial processing of sensory information, whereas deliberate processing (“system 2”) is compared to the active maintenance of internal representations and the comparison between those representations and sensory input. Specifically, as noted by Jonathan Evans, system 2 of the dual process theory, which is characterized by a reflective process that allows an individual to override the intuitive process (i.e., initial perception of the input), closely aligns with the computation of the prediction error (i.e., discrepancy between expected value and the actual outcome).  Although the process of active maintenance of internal representation, the constant monitoring of the conflict between new experiences and the internal representation, and the shifting of the posterior (i.e., updated belief after combining the prior belief and the actual evidence) is not uniquely differentiated in the dual-process model, the shared mechanism that requires a more deliberate and effortful cognitive process is captured by System 2.

Mental representation Representation in the field of cognitive psychology and philosophy refers to the mental encoding of external stimuli. Specifically, it is defined as a hypothetical internal cognitive symbol that represents external reality or its abstractions (for more information about representation, see Mental Representation). In the field of philosophy, mental representation is treated as a mediator between the real world and the observer (for more information, see Philosophy of Mind). The field of cognitive psychology has attempted to test this concept by using neuroimaging methods, with the most common methods being functional magnetic resonance imaging (fMRI). This method involves looking at people’s brain activity related to external stimuli (such as showing them a picture).

In computational neuroscience, active predictive coding models typically include representations of visual stimuli as well as representations of goal-directed behavior. These representations interact to adapt to and learn new concepts. Some work has attempted to link findings in neuroscience and cognitive psychology by examining how prediction errors change over time. Changes in prediction error have been interpreted as evidence that internal representations are constantly adjusted in response to new sensory input, so that they better match events in the external world.

Neural theory in predictive coding

Much of the early work that applied a predictive coding framework to neural mechanisms came from sensory processing, particularly in the visual cortex. These theories assume that the cortical architecture can be divided into hierarchically stacked levels, which correspond to different cortical regions. Every level is thought to house (at least) two types of neurons: “prediction neurons”, which aim to predict the bottom-up inputs to the current level, and "error neurons", which signal the difference between input and prediction. These neurons are thought to be mainly non-superficial and superficial pyramidal neurons, while interneurons take up different functions.