<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>A sensory–motor theory of the neocortex</title></titleStmt>
			<publicationStmt>
				<publisher>Nature Publishing Group</publisher>
				<date>07/01/2024</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10559110</idno>
					<idno type="doi">10.1038/s41593-024-01673-9</idno>
					<title level='j'>Nature Neuroscience</title>
<idno>1097-6256</idno>
<biblScope unit="volume">27</biblScope>
<biblScope unit="issue">7</biblScope>					

					<author>Rajesh P N Rao</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Recent neurophysiological and neuroanatomical studies suggest a close interaction between sensory and motor processes across the neocortex. Here, I propose that the neocortex implements active predictive coding (APC): each cortical area estimates both latent sensory states and actions (including potentially abstract actions internal to the cortex), and the cortex as a whole predicts the consequences of actions at multiple hierarchical levels. Feedback from higher areas modulates the dynamics of state and action networks in lower areas. I show how the same APC architecture can explain (1) how we recognize an object and its parts using eye movements, (2) why perception seems stable despite eye movements, (3) how we learn compositional representations, for example, part-whole hierarchies, (4) how complex actions can be planned using simpler actions, and (5) how we form episodic memories of sensory-motor experiences and learn abstract concepts such as a family tree. I postulate a mapping of the APC model to the laminar architecture of the cortex and suggest possible roles for corticocortical and cortico-subcortical pathways.</p><p>The predictive coding theory of cortical function, proposed in this journal in 1999 by the author and Ballard 1 , has been the subject of increasing attention in recent years <ref type="bibr">[2]</ref><ref type="bibr">[3]</ref><ref type="bibr">[4]</ref> . However, as originally proposed, the theory ignored a fundamental aspect of perception, namely, that perception is action based: we move our eyes about three times a second to recognize objects in a scene, orient our heads to localize sounds, use our fingers to identify objects by touch and navigate ourselves in our environment to solve tasks that satisfy our needs. Away from experimentally imposed constraints in the laboratory, perception, in its natural state, can best be viewed as an action-based hypothesis-testing process (also called active sensing, active perception and active inference) <ref type="bibr">[5]</ref><ref type="bibr">[6]</ref><ref type="bibr">[7]</ref><ref type="bibr">[8]</ref> .</p><p>Recent studies have highlighted the important influence of impending actions across almost all cortical areas (Fig. <ref type="figure">1</ref>). For example, in mice solving a visual discrimination task using forepaws to rotate a wheel, Zatka-Haas et al. <ref type="bibr">9</ref> observed, using widefield calcium imaging, extensive bilateral activity across cortical areas preceding movements on choice trials (left or right action selected) but not on 'NoGo' trials (no action is selected) (Fig. <ref type="figure">1a</ref>, left). They further showed that impending movement could be decoded from cortical activity in most imaged regions by 25 ms before movement (Fig. <ref type="figure">1a</ref>, right). In the same task, Steinmetz et al. <ref type="bibr">10</ref> used Neuropixels probes to record spiking activity from thousands of neurons and showed that, not only does activity in the visual cortex get updated after movement (Fig. <ref type="figure">1b</ref>, left), but almost all recorded cortical areas had neurons with activities that were predictive of upcoming movements (Fig. <ref type="figure">1b</ref>, right). Similarly, Stringer et al. <ref type="bibr">11</ref> found that about a third of the population activity of ~10,000 neurons in the visual cortex of awake mice could be predicted from motor actions derived from a video of the mouse's facial movements (Fig. <ref type="figure">1c</ref>), suggesting that sensory-motor integration occurs even in the primary sensory cortex (the lack of a similar result in monkeys <ref type="bibr">12</ref> could be due to the increased functional specialization of primate visual cortical areas compared to that of the rodent cortex).</p><p>Actions may be integrated differently across the different layers of a cortical area. For example, Jordan and Keller <ref type="bibr">13</ref> showed that both layer 2/3 and layer 5/6 neurons in the mouse primary visual cortex (V1) undergo depolarization before locomotion onset (Fig. <ref type="figure">1d</ref>, left and middle). While layer 2/3 neurons appear to be computing a difference between motor-related input and bottom-up visual flow input, layer 5/6 responses were consistent with positive integration of visuomotor inputs (Fig. <ref type="figure">1d</ref>, right). These results complement well-known earlier results on predictive activity in a range of cortical areas such as the visual cortex <ref type="bibr">14</ref> , the parietal cortex <ref type="bibr">15</ref> and frontal eye fields <ref type="bibr">16</ref> that anticipate the visual consequences of impending eye movements. consisting of a state-prediction network and an action-prediction network, both implemented within each cortical area. 'State' here denotes hidden (or 'latent') aspects of the world inferred from sensory inputs, for example, parts of an object to be recognized or one's location in a building. 'Action' refers to not just motor commands but also abstract actions, for example, 'go to the maternal grandmother node' in a family tree or 'perform multiplication' on two given numbers. APC postulates that feedback from higher cortical areas modulates the dynamics of both state and action networks in lower areas, changing the functions they compute on the fly to suit the needs of the current task. This leads to representations that operate at multiple levels of sensory and motor abstraction, as observed in cortical hierarchies implicated in perception and action <ref type="bibr">[27]</ref><ref type="bibr">[28]</ref><ref type="bibr">[29]</ref><ref type="bibr">[30]</ref> . In the following sections, I present computational and neurobiological aspects of APC, comparing emerging studies and experimental results with the model's predictions. I present simulations chosen to showcase the explanatory breadth of APC. While we have previously investigated APC in the context of machine learning (ML) and artificial intelligence (AI) <ref type="bibr">[31]</ref><ref type="bibr">[32]</ref><ref type="bibr">[33]</ref> , here I explore APC as a model of cortical function.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>APC</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Neuroanatomical and physiological motivation</head><p>The axonal outputs of layer 5 neurons in almost all cortical areas target subcortical motor centers <ref type="bibr">19</ref> . Even in V1, outputs from layer 5 neurons target the superior colliculus <ref type="bibr">34</ref> , which is involved in eye movements (aside from other motor behaviors). Similarly, layer 5 neurons in the primary auditory cortex (A1) send outputs to the inferior colliculus <ref type="bibr">35</ref> , which is involved in orienting and defensive motor behaviors <ref type="bibr">36</ref> , while</p><p>The emerging view, as suggested by the studies above, is that almost all cortical areas update their representations on the basis of 'efference copies' of upcoming actions ('corollary discharges' (ref. 17)) as well as the results of executed actions. Such a view harmonizes well with the anatomical observation that all areas of the neocortex (henceforth, the 'cortex'), including areas traditionally labeled as sensory cortices, send outputs to subcortical motor regions (refs. 18,19  and references therein) and receive input from these regions. Indeed, Vernon Mountcastle, in his prescient article in 1978 (ref. 20), put forth the hypothesis that a single unifying computational principle might be operating across the entire cortex, proposing the 'cortical column' as a modular information-processing unit of the cortex (see also refs. 21-23 for related ideas). This hypothesis is supported by the remarkable anatomical similarities in laminar connectivity patterns across cortical areas <ref type="bibr">24,</ref><ref type="bibr">25</ref> , even though the density of cells within laminae may vary across areas. Additional evidence for this hypothesis comes from experiments in which inputs from the optic nerve were diverted via the auditory thalamus to the auditory cortex, causing the auditory cortex to develop visual receptive field properties <ref type="bibr">26</ref> .</p><p>If there is indeed a common computational principle operating across the cortex, it must be versatile enough to explain capabilities as diverse as (1) learning to recognize an object from multiple visual glimpses through eye and head movements or from multiple tactile sensations through finger movements, (2) solving a complex spatial navigation task using simpler movement sequences and (3) understanding abstract concepts (such as a family tree).</p><p>In this Perspective, I suggest APC as a unifying sensory-motor theory of the cortex. APC hypothesizes a canonical cortical module as principal-component (PC) analysis of a video of a mouse's facial movements (left, example frames t, t + 1; middle, top three principal components) accurately predicted (using reduced-rank regression) about a third of the population activity of ~10,000 neurons (raster representations on the right) measured using two-photon calcium imaging of the visual cortex of awake mice (adapted with permission from ref. 11, AAAS). 1D, one dimensional. d, Intracellular recordings in V1 of mice on a spherical treadmill with locomotion coupled to visual flow feedback. Visual flow was halted at random times to generate visuomotor mismatch events. Left, heatmap of average responses before and after locomotion onset across all layer 5/6 neurons. Baseline activity was subtracted from responses by using the average membrane potential in the 2.5 s before locomotion onset before averaging. Middle, average response before and after locomotion onset across all layer 5/6 (L5/6) neurons (black, 14 neurons) compared with all layer 2/3 (L2/3) neurons (gray, 32 neurons). Right, average mismatch responses of layer 2/3 and layer 5/6 neurons (adapted with permission from ref. 13, Elsevier).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Perspective</head><p><ref type="url">https://doi.org/10.1038/s41593-024-01673-9</ref> layer 5 neurons in the primary somatosensory cortex send outputs to the spinal cord <ref type="bibr">37</ref> , which controls body movements. On the other hand, layer 5 neurons in the primary motor cortex (or M1) (such as Betz cells) have long been implicated in motor function via their axonal projections to the spinal cord <ref type="bibr">38</ref> , but the middle and upper layers of traditional 'motor' cortical areas such as M1 are involved in sensory processing of feedback from subcortical and cortical sources <ref type="bibr">39,</ref><ref type="bibr">40</ref> : for example, layer 2/3 neurons in mouse M1 respond to unexpected sensory perturbations in a visually guided motor task <ref type="bibr">41</ref> , while neurons in mouse M2 encode auditory sensation and expectation <ref type="bibr">42</ref> . Thus, despite well-known differences in the laminar densities of neurons in different cortical areas (for example, V1 versus M1), the sensory-motor nature of the cortex is retained. This motivates the idea of a 'sensory-motor cortical module' as a canonical feature of the cortex (described further in the section APC module and neuroanatomical implementation).</p><p>The figure in Box 1 (panel a) depicts the laminar structure of a typical cortical column and its connectivity (based on refs. 18,24,43). Inputs from a sensory region or a lower cortical area target layer 4 neurons, the outputs of which are then conveyed to the superficial layer 2/3 neurons. These neurons in turn send their axons to the deeper layers, Box 1</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Canonical APC module</head><p>The canonical APC module is motivated by the laminar structure of the cortex (figure in Box 1, panel a) and consists of the following components:</p><p>State-transition function. The state-transition function f s models the physics of the environment and the agent, and predicts the next state s t , given the previous state s t-1 and action a t-1 (figure in Box 1, panel b). In general, states and actions are vectors. By learning an approximation fs of f s from interactions with the world, the agent can learn an 'internal model' of the world <ref type="bibr">81,</ref><ref type="bibr">87,</ref><ref type="bibr">88,</ref><ref type="bibr">94</ref> (also called a 'world model', forward model or generative model) and use it to run simulations of the world, imagine new scenarios, explore what happens when particular actions are executed and plan actions that lead to desirable states. Biologically, the function fs can be implemented by a recurrently connected network of neurons, with the network activity at time t denoting an estimate &#349;t of the state s t (figure in Box 1, panel c). Neural population activity in visual, auditory and somatosensory cortices, for instance, after processing a sensory stimulus (or more generally, after sequential sampling of the stimulus), can be regarded as the estimated &#349;t for that stimulus computed by the cortical region.</p><p>Policy function. An internal model (such as fs above) can be used to plan actions by unrolling the model into the future to explore the consequences of various action choices, but this mode of selecting actions requires considerable effort and deliberation ('system 2' thinking <ref type="bibr">68</ref> ). A more efficient way to select actions ('system 1' thinking 68 ) is to have a state-to-action 'policy' (ref. 44) fa , which maps the current estimated state &#349;t directly to an action &#226; t to achieve the current goal (figure in Box 1, panel c). Biologically, the policy fa can be implemented by a recurrent network of neurons with activity at time t denoting &#226; t .</p><p>Coupling perception and action. Given a policy fa for a particular task or goal, the agent can execute an action &#226; t from the policy while simultaneously sending &#226; t as an 'efference copy' (or 'corollary discharge' (ref. 17)) to the learned model fs to predict the sensory consequences of each action. The agent can then correct its prediction of the new state of the world based on the new sensory observation that resulted from taking the action, using prediction errors as prescribed by predictive coding theory 1 . The corrected state estimate &#349;t can in turn be fed as input to the policy fa to generate the next action for the task, continuing until the goal is achieved or the task times out. A biological implementation of this idea involves coupling the state and policy recurrent networks within the laminar structure of a cortical area, as depicted in the figure in Box 1 (panel c).</p><p>b Action/goal/coordinates Input a 1 2/3 a t-1 a t s t-1 s t s t a t-1 f s f a 4 5 6 D Lower-order thalamus Higher-order thalamus Motor centers &#226; t-1 &#226; t &#349; t-1 &#226; t-1 &#349; t f s f a D c Lower-order thalamus Higher-order thalamus 1 2/3 4 5 6 State feedback Action feedback Motor centers Canonical APC module. a, Depiction of the six-layered laminar structure of a cortical column, showing some of the major connections between layers and with the thalamus (not all connections are shown) (based on refs. 18,24,43). b, Canonical APC generative model. The dashed arrow denotes a delay of one time step. D denotes a decoder converting state to input. c, One possible implementation of inference in a canonical APC module for the generative model in b. Perspective <ref type="url">https://doi.org/10.1038/s41593-024-01673-9</ref> Box 2</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>State and action networks in the cortex</head><p>State network f f fs s s and sensory-motor prediction in the cortex. The APC model predicts that cortical networks implementing the state-prediction function fs should learn to anticipate the sensory consequences of actions (by predicting latent sensory states) and exhibit anticipatory activity before movement. A study by Audette et al. <ref type="bibr">93</ref> found such anticipatory activity in the primary auditory cortex (figure in Box 2, panel a): mice were trained to push a lever with their forelimb, which produced a pure tone at a fixed position early in each movement; after training, omission of this learned movement-associated sound (figure in Box 2, panel a, top left) revealed a large population of auditory cortex neurons firing roughly 200 ms before movement onset, with this activity peaking around the time of the expected tone (figure in Box 2, panel a, top middle and right). The study also found prediction error-like suppression of neural activity for anticipated sounds, consistent with the use of errors in predictive coding for state inference (figure in Box 2, panel a, bottom). Predictive activity anticipating the visual consequences of an upcoming eye movement has been observed across the cortex including the visual cortex <ref type="bibr">14</ref> , the parietal cortex <ref type="bibr">15</ref> and the frontal cortex <ref type="bibr">16</ref> (figure in Box 2, panel b, left, middle and right, respectively). Other types of movement, such as locomotion, can also predictively activate cortical neurons, for example, in V1 (ref. 13 and Fig. <ref type="figure">1d</ref>). These results are consistent with the APC model's use of a state network fs to learn the sensory consequences of actions.</p><p>Action network f f fa a a and cortical motor dynamics. The APC model assumes that the network within a cortical area implementing the action-prediction function fa is a recurrent network (figure in Box 1, panel c) for which the outputs, in the case of the motor cortex, encode the dynamics of movement. There is now considerable neurophysiological evidence that, when an animal is performing a movement (for example, reaching toward a goal), the activities of neurons in the motor cortex are well described by a dynamical system of the form &#551; = f(a, u) where u is an external input 95 .</p><p>b c a d Omission 10 Movement 0 Passive n = 377 Visual cortex (V3A) Eye movement onset Frontal cortex (FEF) Eye movement onset 200 ms FP1 FP2 Stim Parietal cortex V eye H eye Stim H V FP2 FP2 FP1 Stim FP1 Eye movement onset Stimulus onset Auditory cortex Frequency (Hz) Time (s) Motor cortex Monkey B Projection onto jPC 2 (AU) Projection onto jPC 1 (AU) Projection onto jPC 1 (AU) Projection onto jPC 1 (AU) Lift -100 ms Lift -100 ms Lift +350 ms Lift Lift Lift +350 ms Neural population trajectory, thalamus Neural population trajectory, cortex PC1 PC2 PC3 PC1 PC2 PC3 Lift Population trajectory, cortex Population trajectory, thalamus Single-trial population trajectories, cortex and thalamus P C 1 P C 1 PC 2 PC 2 PC3 PC3 Monkey J-array Monkey N-array 6 5 Hz 100 ms 100 ms 50 ms 100 2 -0.4 0 0.4 0.4 0 30 0 0.4</p><p>State and action networks in the cortex. a, Top left, schematic of the omission of an expected sound during a lever-press movement (black curve) in a self-generated sound task in mice <ref type="bibr">93</ref> . a, Top middle and right, neural activity in the auditory cortex aligned to six positions (colored dots) along the lever-press movement: peak firing always corresponded to the time of the expected sound (occurring on average 36 ms after movement onset), with the activity starting roughly 200 ms before movement onset (as reported in ref. 93). a, Bottom, heatmaps (left) of responses for all recorded neurons and the average response (right) for 377 of those neurons responding above a threshold to the sound when it was self-generated by a lever press ('movement') and when it was not self-generated ('passive'). Note the greater suppression (green) for self-generated sounds (adapted from ref. 93, Elsevier). b, Predictive activity anticipating the visual consequences of an upcoming eye movement in the visual cortex (left) (adapted with permission from ref. 14, National Academy of Sciences, USA), the parietal cortex (middle) (adapted with permission from ref. 15, AAAS) and the frontal cortex (right) (adapted with permission from ref. 16, American Physiological Society). FP, fixation point; H, horizontal eye movement; V, vertical eye movement; FEF, frontal eye fields. c, Two-dimensional projection (using jPCA <ref type="bibr">95</ref> ) of population activity of motor cortex neurons in three monkeys performing straight and curved reaching movements, showing rotation of the neural state. Traces are colored from green to red based on the preparatory neural state (circles) for each reach condition (adapted from ref. 95, Springer Nature Limited). jPC 1 and jPC 2 , first and second dimensions, respectively, of jPCA space; AU, arbitrary units. d, Results from simultaneous population recordings of the motor thalamus and the motor cortex in mice performing reach-to-grasp movements <ref type="bibr">97</ref> . Left, neural population trajectories for the thalamus (left, green) and the cortex (right, magenta) obtained using trial-averaged PCA. Right, single-trial population activity in the thalamus (top) and the cortex (bottom) (adapted from ref. 97, Springer Nature Limited).</p><p>predominantly targeting layer 5 neurons. One class of layer 5 neurons (with thick tufted apical dendrites and firing in bursts) send their axons to subcortical motor centers such as the superior colliculus and other parts of the brainstem <ref type="bibr">19,</ref><ref type="bibr">34,</ref><ref type="bibr">43</ref> . Other layer 5 neurons, which do not fire in bursts and have slender apical dendrites, project to the striatum and other cortical regions <ref type="bibr">34,</ref><ref type="bibr">43</ref> . There is also a substantial axonal projection from layer 5 back to layer 2/3, signifying recurrent feedback within a cortical column. There are additional projections from layer 5 to layer 6, and layer 6 in turn sends outputs to the parts of the thalamus that send inputs to layer 4.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Computational motivation</head><p>Computational considerations point to maintaining a close link between actions and their sensory consequences. In model-based reinforcement learning <ref type="bibr">44</ref> and, more generally, in the framework of partially observable Markov decision processes <ref type="bibr">45,</ref><ref type="bibr">46</ref> , an intelligent 'agent' interacts with the world by executing an action a t-1 at time t - 1, and this causes the agent's 'state' to change from s t-1 to s t ; this change is governed by the state-transition function f s (s t-1 , a t-1 ), which generates a new state s t according to a probability distribution P(s t |s t-1 , a t-1 ). When the agent executes an action based on a policy f a , for example, moving its body by walking or making an eye movement, the hidden state changes to the next state s t (a new location in a building being navigated or a new part of a scene being recognized) according to f s (s t-1 , a t-1 ). Inferring these hidden states as the agent makes movements is the essence of perception <ref type="bibr">47,</ref><ref type="bibr">48</ref> .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>APC module and neuroanatomical implementation</head><p>The above computational considerations motivate the canonical APC generative model shown in the figure in Box 1 (panel b). The corresponding model for inference and learning, referred to as the canonical APC module, is described in Box 1 and shown in the figure in Box 1 (panel c). This figure also suggests one possible functional mapping of APC's computational elements onto the cortical laminar structure in the figure in Box 1 (panel a), which builds on previous proposals mapping predictive coding to cortical laminae <ref type="bibr">49,</ref><ref type="bibr">50</ref> .</p><p>As shown in the figure in Box 1 (panel c), the superficial layer cortical neurons, which receive the filtered sensory inputs from layer 4 and are recurrently connected to each other, are well suited to implementing the state-transition function fs . The motor output layer 5 neurons, which are also recurrently connected to each other, fit the role of neurons computing the action-policy function fa . The other class of layer 5 neurons, which convey information to other cortical areas and the striatum, could maintain the current state estimate &#349;t by integrating the state prediction from layer 2/3 and correcting it with prediction errors from the feedforward thalamic inputs to layers 4 and 5/6 (ref. 1). Layer 6 neurons receiving inputs from these state-estimating layer 5 neurons are well placed to compute the prediction for a lower-level area: at the lowest level, layer 6 neurons predict sensory input &#298; t for the input I t (layer 6 neurons at a higher level would predict the cortical state at a lower level; for more details, see the section Hierarchical APC and cortical feedback).</p><p>Layer 5 motor output neurons, for example, those sending outputs to the superior colliculus, send axon collaterals to higher-order thalamic nuclei <ref type="bibr">18,</ref><ref type="bibr">19</ref> and receive motor information from subcortical motor centers such as the superior colliculus regarding actions executed. These thalamic nuclei are therefore in an ideal position to compare the actual executed action a t (from the superior colliculus or other motor center) and the cortical prediction &#226; t . The resulting action feedback (for example, in the form of action-prediction errors), in addition to sensory feedback (in the form of sensory-prediction errors), can be conveyed by the thalamus back to the cortex to enable the state-transition network fs to correct its state prediction and the action network fa to correct its action prediction. Indeed, it is known that higher-order nuclei such as the pulvinar receive cortical layer 5 inputs and information from the superior colliculus and send axons to superficial layers of area V1, explaining the response of V1 neurons to saccadic eye movements <ref type="bibr">51</ref> .</p><p>The implementation suggested above is consistent with growing experimental data on predictive coding in the cortex <ref type="bibr">2,</ref><ref type="bibr">4</ref> , with prediction error-like activity reported in superficial layers <ref type="bibr">13,</ref><ref type="bibr">52</ref> and predictive activity observed in deeper layers <ref type="bibr">53</ref> and in cortico-cortical interactions <ref type="bibr">54,</ref><ref type="bibr">55</ref> . The implementation above also shares similarities with previous canonical circuits for predictive coding <ref type="bibr">49</ref> in specifying laminar roles for state estimates and prediction errors but differs in the use of both actions and states to generate predictions, rather than being limited to hidden causes <ref type="bibr">49</ref> . Evidence for state and action networks in the cortex is summarized in Box 2.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Hierarchical APC and cortical feedback</head><p>A characteristic feature of the cortex is the reciprocal nature of connections between cortical areas 27 : 'feedforward' connections from a cortical area A (originating in the superficial layers) to a cortical area B (terminating in layer 4) are invariably reciprocated by anatomically defined 'feedback' (or descending) connections from area B to area A (originating in the deeper (and sometimes superficial) layers of B to superficial and deep layers of A). Why are cortical areas reciprocally connected and organized in an approximate hierarchy <ref type="bibr">27,</ref><ref type="bibr">56</ref> ?</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Computational motivation</head><p>Consider the problem of going to the grocery store from one's house. As shown in Fig. <ref type="figure">2a</ref>, the complexity of the problem can be substantially reduced by dividing the task into subtasks (or 'subgoals'), dividing each subtask into 'sub-subtasks', and so on. Reducing a complex problem to a sequence of easier-to-solve components and reusing these components to solve new problems gets to the heart of compositionality, which is thought to form the basis for cognitive flexibility and fast generalization in humans <ref type="bibr">57,</ref><ref type="bibr">58</ref> .</p><p>A complex problem can be characterized by its (typically high-dimensional) state-transition function, which governs how the The figure in Box 2 (panel c) illustrates these motor cortical dynamics in monkeys performing reach movements. Such dynamics can be learned and implemented by a recurrent neural network <ref type="bibr">96</ref> , which in the APC model is the action network fa . The APC action network receives as input not only local recurrent activity but also the current state estimate &#349; (figure in Box 1, panel c), which is updated using sensory feedback from other brain regions such as the thalamus. The APC model therefore predicts a close interaction between thalamic inputs and motor cortical outputs of the action network fa . A recent study by Sauerbrei et al. <ref type="bibr">97</ref> confirmed the importance of this tight sensory-motor loop in cortical pattern generation in mice performing dextrous movements. They showed that time-varying thalamic inputs are required for cortical pattern generation. The neural population activity in both the thalamus and the cortex exhibited strong co-modulation in trial-averaged (figure in Box 2, panel d, left) and single-trial (figure in Box 2, panel d, right) activity. Inactivating the thalamus perturbed cortical activity and disrupted limb kinematics 97 , implying that both local dynamics and sensory-derived state contribute to generating cortical motor patterns (see inputs to fa in the figure in Box 1, panel c). (continued from previous page) Nature Neuroscience Perspective <ref type="url">https://doi.org/10.1038/s41593-024-01673-9</ref> </p><p>state of the environment changes when one applies an action. Fortunately, in the natural world, the consequences of most actions are local, and these local dynamics tend to be shared across many environments and objects, allowing complex problems to be modeled in terms of simpler lower-dimensional state-transition functions. This is illustrated in the example in Fig. <ref type="figure">2b</ref>, a simplification of the 'go to the grocery store' problem: here, a maze-like environment is modeled using simpler components (yellow-and red-outlined rooms), each composed of even simpler components (corridors). Interestingly, the same concept can also be applied to visual perception. As illustrated in Fig. <ref type="figure">2c</ref>, a visual object can be compositionally defined in terms of parts and their locations within the object's reference frame <ref type="bibr">59</ref> ; the parts can in turn be decomposed into simpler parts within their respective reference frames. Nested compositional representations of objects and environments offer substantial combinatorial flexibility for solving complex problems in terms of simpler, reusable components. The fact that the world we live in and the problems we seek to solve are amenable to compositional solutions makes such an approach attractive, from both a computational and an evolutionary perspective.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>The hierarchical APC model</head><p>Box 3 describes the APC model's hierarchical architecture and its neural implementation. The figure in Box 3 (panel e) shows two levels of the model, implemented using top-down 'contextual inputs' to connect the higher level to the lower level (see Box 3 for an alternate implementation based on gain modulation).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>State inference using predictive coding and compositional learning.</head><p>As shown in the figure in Box 3 (panel e, left), the higher-level state neurons maintain an estimate for the state s (i+1) t at time t and modulate the lower-level state network via top-down feedback given by</p><p>). The lower-level state neurons maintain an estimate for s i t,&#964; , where &#964; denotes a time step at the lower level within the higher-level time interval given by t. The lowest-level state makes a prediction of the input via a 'decoder' network D (figure in Box 1, panel b). If D is a linear matrix U, this lowest level of APC is equivalent to the generative model in sparse coding (I = Us, where s is sparse <ref type="bibr">60</ref> ). At each time step, the network predicts the next input as a function of previous state and action. Feedforward pathways convey prediction errors to update state estimates 1 , while descending pathways convey topdown modulation as described above (see ref. 61 for an example). Prediction errors are also used to learn the weights of the state networks at all levels using predictive coding-based self-supervised learning <ref type="bibr">1,</ref><ref type="bibr">32,</ref><ref type="bibr">61</ref> . Such learning approximates error backpropagation, the workhorse of contemporary deep learning, in a biologically plausible manner <ref type="bibr">62</ref> . , top-down feedback given by the embedding input</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Action inference through planning</head><p>) modulates the lower-level action network and instantiates the goal-specific policy f (i) a , which produces lower-level actions a i t,&#964; . The hierarchical action networks in the APC model can be trained in multiple ways: (1) planning: the state-transition networks can be used to search for sequences of actions, starting from the highest abstraction level, that are likely to result in states with the highest cumulative reward or closest to the goal (see also active inference <ref type="bibr">8</ref> , planning by inference <ref type="bibr">[63]</ref><ref type="bibr">[64]</ref><ref type="bibr">[65]</ref> and model predictive control <ref type="bibr">66</ref> ; see the section Illustrative examples of diverse computational capabilities). Successful actions can be used as 'labels' in supervised learning to train the policy networks</p><p>(2) reinforcement learning: hierarchical reinforcement learning <ref type="bibr">67</ref> can be used to train action networks at each level to maximize the total expected reward according to a reward function that may be specific to that level (details in the section Illustrative examples of diverse computational capabilities); (3) policies providing priors for planning: action networks f (i) a at each level predict a distribution over actions, which can serve as a prior, in a Bayesian sense, for guiding the search for actions in planning. Thus, predicted actions for new tasks will have high uncertainty, requiring effort and deliberation in planning ('system 2 thinking' (ref. 68)), while, for frequently encountered tasks, action networks are well trained and will predict actions with high confidence ('system 1 thinking' (ref. 68)).</p><p>An advantage of continuous-valued state s (i+1) and action a (i+1) vectors is that interpolating or sampling in the neighborhood of learned s (i+1) and a (i+1) generates, on the fly, new state-transition functions</p><p>s and new policy functions</p><p>a , opening the door to fast generalization and transfer of knowledge to new tasks. The alternative to continuous states is to use discrete states, as in previous models of predictive coding based on belief propagation or variational message passing (for example, Fig. <ref type="figure">10</ref> in ref. 69). Aside from the possibility of fast generalization and transfer, APC's use of continuous states also allows explicit representation of prediction errors, which in turn allow local optimization of dynamics and learning (under Gaussian assumptions) <ref type="bibr">1</ref> .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Proposed neuroanatomical implementation</head><p>I propose that neural populations in a higher cortical area A representing current state and action vectors &#349;(i+1) and &#226; (i+1) modulate the state and action networks f Note that the rate of change is faster at the lower levels than at the higher levels, leading naturally to a temporal hierarchy. b, A navigation problem in a maze-like building environment with corridors (black) and walls (gray). Blue dot, current location; green square, desired goal location. The structure of the environment (pathways and walls) can be understood in terms of the building's state-transition dynamics, which in turn can be divided into the simpler transition dynamics of its compositional elements, namely, the two rooms outlined in yellow and red that appear at several different locations within the reference frame of the environment. These simpler elements can be further decomposed into horizontal and vertical corridors shown on the right that appear at different locations within the local reference frame of each room. c, An object (such as a handwritten digit '8') can be divided into parts (loops and curves at the middle level), each of which can be divided into subparts (strokes, lines, smaller curves at the lower level). Each part and subpart is associated with its coordinates (location and transformation) within a local reference frame.</p><p>Box 3</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Hierarchical APC model and its neural implementation</head><p>In the hierarchical APC model (figure in Box 3, panel a), a state s (i+1) and an action a (i+1) at abstraction level i + 1 generate, respectively, a state-transition function f</p><p>s and a policy function f</p><p>a ('option' (ref. 44)) at the lower level i. These functions interact with each other to generate lower-level states and actions (figure in Box 3, panel a). Each such state and action in turn generates transition and policy functions at an even lower level of abstraction. A lower-level sequence executes for a period of time until a condition is met (for example, a subgoal is reached, a task is completed or times out or there is an irreconcilable error at that level). Control then returns to the higher level, which transitions to a new higher-level state (via f (i+1) s</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>) and action (via f (i+1) a</head><p>). Such a model captures both the dynamics of states (the 'physics' of the world) and actions ('policies') at different time scales, allowing hierarchical problem solving (Fig. <ref type="figure">2</ref>). Biologically, the recurrent networks implementing s and f a are governed by specific decay time constants, but differences in recurrent excitation can allow a hierarchy of time scales, as observed across the cortex <ref type="bibr">98</ref> . Hierarchical dynamics in predictive coding was previously explored in ref. 3 for perception and production of birdsong, with lower-level dynamics contextualized by slowly varying control parameters supplied by a higher level.</p><p>Can the hierarchical model in the figure in Box 3 (panel a) be implemented in networks of neurons? More specifically, how can a population of neurons, representing, for example, the higher-level state vector s (i+1) (or action vector a (i+1) ), generate a whole function f Gain modulation in the cortex. There is considerable evidence for 'gain modulation' in cortical networks <ref type="bibr">[99]</ref><ref type="bibr">[100]</ref><ref type="bibr">[101]</ref><ref type="bibr">[102]</ref> , implemented computationally by multiplying the synaptic weights or outputs of neurons by a gain factor. Evidence for gain modulation ranges from multiplicative modulation of tuning curves of visual cortical neurons during attention <ref type="bibr">103</ref>  </p><p>a t,&#964;-1 (i) 256 Recurrent units Fixation output Response 1 360&#176;0 &#176;20 1 360&#176;0 &#176;0 1,000 Time (ms) Rule inputs Stimulus mod 2 Stimulus mod 1 Fixation input</p><p>Hierarchical APC model. a, Two levels (levels i + 1 and i) of a hierarchical APC generative model. Each level has a state-transition function f s capturing the dynamics of the world at a particular level of abstraction and a policy function f a specifying that level's actions, goals and coordinates (conditioned on the current highest-level goal or task). Higher-level state and action vectors at time t generate, via top-down networks H s and H a , lower-level state-transition and policy functions, allowing the higher level to compose a sequence of states and actions at the lower level to accomplish a goal. b, As depicted here for a single pyramidal neuron, I hypothesize that top-down inputs</p><p>) from a higher cortical area to the apical dendrites of lower-area neurons modulate the dynamics of a network of such neurons (for example, via gain modulation <ref type="bibr">100,</ref><ref type="bibr">101</ref> ), allowing the higher area to change the functions f s and f a at the lower level. c, Top, multiplicative gain modulation (for example, due to top-down inputs) in the input-output function of neurons in a recurrent network allows the network to generate a rich set of motor cortical dynamics matching experimental data <ref type="bibr">102</ref>  ) and</p><p>), respectively.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Nature Neuroscience</head><p>Perspective <ref type="url">https://doi.org/10.1038/s41593-024-01673-9</ref> ing connections that target the superficial and deep layers of area B <ref type="bibr">27</ref> . Feedforward connections that target layer 4 of area A arise from the lower area B and from the higher-order thalamic region receiving 'driver input' from area B <ref type="bibr">18,</ref><ref type="bibr">27</ref> . I propose that these feedforward connections carry the state and action feedback (for example, prediction errors) that enable the higher area A to correct its abstract state and action estimates. Such a neural implementation is consistent with studies reporting prediction error-like responses in superficial layers and state-estimation-like responses in deeper layers of the cortex <ref type="bibr">2,</ref><ref type="bibr">13</ref> .</p><p>A key difference from previous formulations of hierarchical predictive coding <ref type="bibr">1,</ref><ref type="bibr">2,</ref><ref type="bibr">49,</ref><ref type="bibr">50</ref> is that APC places subcortical (thalamic) populations center stage in the evaluation of state-and action-prediction errors and their broadcasting to superficial pyramidal cells in the cortex <ref type="bibr">70</ref> . Additionally, in APC, descending connections from higher to lower cortical areas change the function being computed in the lower area (through top-down modulation), rather than only conveying lower-level state predictions as in traditional predictive coding 1 . Higher-area neurons representing action a</p><p>a in a lower area, changing the policy function that this lower-level network is computing. Neurophysiological evidence for such compositional representations has recently emerged in the premotor cortex <ref type="bibr">71</ref> . Computational models have demonstrated compositionality for task transfer using the embedding space of a</p><p>Hierarchical representations found in the visual <ref type="bibr">27,</ref><ref type="bibr">29</ref> and motor systems <ref type="bibr">30</ref> are also consistent with the hierarchical compositional approach espoused by the APC model. Finally, the compositional representations in the cortex postulated by the APC model align well with recent hypotheses regarding compositional hippocampal replay <ref type="bibr">73</ref> .</p><p>After the state and action networks have been learned for a set of tasks (as described in the section The hierarchical APC model), given a particular task, the topmost state vector in the hierarchy is first inferred from sensory inputs. This vector produces (via that level's action network fa ) the topmost action vector specifying a 'goal' or option for the task; I hypothesize that this vector is maintained in the prefrontal cortex. Some of the pre-movement anticipatory activity in Fig. <ref type="figure">1a</ref> may well reflect such a 'cognitive' decision. This abstract action vector is decomposed hierarchically all the way down to elemental actions (for example, muscle control signals in M1). When a sequence of elemental actions is executed and a subgoal is reached, control is returned back to the level above to generate a new subgoal (see the sections Active visual percep-tion and part-whole learning and Planning and navigation using hierarchical world models for examples) and similarly for all levels. I postulate that such coordination between hierarchical levels for action selection occurs via cortex-basal ganglia-thalamus-cortex loops; I leave the important problem of working out the implementation details in these loops to future research.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Illustrative examples of diverse computational capabilities</head><p>The architecture of the APC model was inspired by the hypothesis that evolution may have replicated a common computational principle across the cortex <ref type="bibr">[20]</ref><ref type="bibr">[21]</ref><ref type="bibr">[22]</ref><ref type="bibr">[23]</ref> . If that is the case, one would expect the same architecture to be able to solve a diverse set of problems. Inspired by this observation, I provide here examples illustrating the APC model's diverse capabilities.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Active visual perception and part-whole learning</head><p>Human vision can be viewed as an active sensory-motor process that employs eye movements to move the high-resolution fovea to appropriate locations in a scene, gathering evidence for or against competing visual hypotheses <ref type="bibr">7,</ref><ref type="bibr">48</ref> . The APC architecture is well suited to modeling such a sensory-motor process, given its integrated state and action networks. To illustrate this capability, we simulated <ref type="bibr">31,</ref><ref type="bibr">32</ref> a two-level APC model (figure in Box 3, panel e) in which the lower-level actions emulated eye movements by moving a fovea ('glimpse sensor' (ref. 74)) to extract high-resolution information about a small part of the input image within a larger reference frame selected by the higher-level action.</p><p>The lower-level action also predicts a new state vector s t,&#964;+1 , which generates, via a trained decoder, a prediction for the glimpse image expected after the 'eye movement'. The resulting prediction error was used for state inference and learning. The state networks at both levels were trained to minimize image-prediction errors, while the action networks were trained using reinforcement learning for the task of image reconstruction (for image classification as the task, see ref. 31).</p><p>Fig. <ref type="figure">3a</ref> shows an example of a learned parsing strategy by the two-level APC model. The higher level learned to select actions that cover the input image sufficiently, avoiding blank regions, while the lower level learned to parse subparts inside the reference frame computed by the higher level. Fig. <ref type="figure">3a</ref> also suggests a potential explanation for why human perception can appear stable despite dramatic changes plausibly, the gain parameters) for another neural network (called the 'primary network'). In the APC model, I propose that the higher-level state vector s (i+1) is fed as input to a top-down feedback network H (i) s , which produces the gain values to modulate the lower-level state network f Contextual inputs in the cortex. Aside from gain modulation, higher cortical areas can also change the function being computed by lower cortical networks using top-down contextual inputs. For example, Yang et al. <ref type="bibr">72</ref> showed that, by feeding a top-down contextual input ('rule input') as a nonchanging input to a recurrent network (in addition to its usual recurrent and external inputs), one can change the input-output function that the network computes, allowing the same network to solve different tasks (figure in Box 3, panel d; see also the model of Eliasmith and colleagues <ref type="bibr">105</ref> ). This is known in ML as the 'embedding approach' and can be shown to be equivalent in computational function to hypernetworks <ref type="bibr">106</ref> . In the case of APC, the higher-level state vector s (i+1) (and action vector a (i+1) ) can be fed as input to a top-down feedback network</p><p>a ) that produces an embedding vector, which acts as a contextual input to a lower-level cortical network that computes f Box 3, panel e). The higher level can therefore control the function being computed at the lower level by changing the embedding vector (contextual input).</p><p>The APC model acknowledges the existence of both gain modulation and contextual inputs in the cortex and postulates that either or both of these mechanisms are used for changing the functions f</p><p>a at the lower level according to the current higher-level state vector s (i+1) and the action vector a (i+1) . The examples described in the section Illustrative examples of diverse computational capabilities were implemented using the method of contextual inputs. The reader is referred to ref. 61  in our retinal images due to eye movements: the model maintains a stable visual hypothesis that is gradually refined without exhibiting the rapid changes seen in the sampled image regions (Fig. <ref type="figure">3a</ref>, actual glimpses). This 'perceptual' stability is enabled by the model's ability to predict the expected glimpses for each planned 'eye movement' (Fig. <ref type="figure">3a</ref>, predicted glimpses), similar to predictive activity observed in the visual cortex before eye movements (figure in Box 2, panel b) <ref type="bibr">[14]</ref><ref type="bibr">[15]</ref><ref type="bibr">[16]</ref> .</p><p>Fig. <ref type="figure">3b</ref> shows a learned part-whole hierarchy for a digit in terms of strokes and mini-strokes along with their locations within nested reference frames. The model learns different parsing strategies for different classes of objects (Fig. <ref type="figure">3c</ref>). Setting the image-prediction error input to the network to zero forces the model to predict the next sequence of parts and 'complete' an object <ref type="bibr">32</ref> . Finally, compositional learning in the APC model facilitates transfer of learned knowledge to new objects (Fig. <ref type="figure">3d</ref>).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Planning and navigation using hierarchical world models</head><p>Interestingly, the same APC framework used above for active vision can also be used for planning hierarchical actions for tasks such as navigation. Consider the problem of navigating from any starting location to any goal location in a large 'multi-room' building environment such as the one in Fig. <ref type="figure">4a</ref>  parts and subparts can potentially be reused at other locations and with other transformations to compose new digits. c, Higher-level part locations selected by a trained APC model for a particular class of clothing items in the Fashion-MNIST dataset (red, green and blue dots show the average sampled locations fixated in the following order: first, red; second, green; third, blue). Note the differences in the model's fixation strategies between vertically symmetric items (shirts, trousers, bags) and footwear (sandals, sneakers, boots). d, An APC model trained on the Omniglot handwritten characters dataset (from 50 different alphabets) can transfer its learned knowledge to predict parts of previously unseen character classes. First column, input image from a new character class. Middle column, APC model's reconstruction of the input. Last column, parts predicted by the model (d, adapted with permission from ref. 32, MIT Press).</p><p>Perspective <ref type="url">https://doi.org/10.1038/s41593-024-01673-9</ref> location; green square, current goal location). Here, the lower-level states of the APC model are locations in the grid, and lower-level actions are going north, east, south or west, with a large reward at the goal location and smaller negative rewards for each action to encourage shorter paths. Just as an object consists of parts at different locations, the building environment in Fig. <ref type="figure">4a</ref> is composed of smaller elements (two 3 &#215; 3 'room types', S1 (red) and S2 (yellow)) at different locations in the global reference frame of the building. The higher-level states of the APC model are defined by state-embedding vectors S1 and S2, trained to generate, via the top-down network H s (figure in Box 3, panel a), the lower-level transition functions fs for rooms S1 and S2, respectively.</p><p>Similar to how the APC vision model reconstructed an image in the section Active visual perception and part-whole learning by composing parts from subparts, the APC model for planning computes higher-level action embedding vectors A i (option vectors) that generate, via the top-down network H a (figure in Box 3, panel a), lower-level policies fa that produce primitive actions (north, east, south or west) from any location in the local reference frame (S1 or S2) to reach a local goal i within that frame. Fig. <ref type="figure">4a</ref> (right) illustrates two of the eight A i , each trained using reinforcement learning to reach one of the four corners of S1 or S2 (see ref. 32 for details). Defining these policies to operate within the local reference frame of the higher-level state S1 or S2 (regardless of global location in the building) allows the same policy to be reused at multiple locations.</p><p>The higher-level state network was trained to predict the next higher-level state. This trained higher-level network was used for planning (using model predictive control 66 ): random state-action trajectories of length 4 were generated using the higher-level state network by starting from the current higher-level state and picking at random one of the four higher-level actions A i for each next higher-level state. The action sequence with the highest total reward was selected, and its first action was executed. This process was repeated. Fig. <ref type="figure">4b</ref>,<ref type="figure">c</ref> illustrates this high-level planning process using the trained APC model. Fig. <ref type="figure">4d</ref> illustrates the efficacy of the APC model's high-level planning compared to lower-level planning using primitive actions (see ref. 32 for details): the APC model takes significantly fewer planning steps and can reuse its learned higher-level actions in new combinations to quickly solve new tasks (for example, when the goal is changed; Fig. <ref type="figure">4e</ref>), similar to a recent study in mice <ref type="bibr">75</ref> (Fig. <ref type="figure">4f</ref>). </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Perspective</head><p><ref type="url">https://doi.org/10.1038/s41593-024-01673-9</ref> </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Episodic memories and cortical-hippocampal binding</head><p>Each level of the APC hierarchy learns generic 'basis functions' for representing states and actions based on interactions with the environment. For example, the basis functions learned by the lowest-level state network when the inputs are natural videos comprise oriented spatiotemporal Gabor filters coding for edges and bars moving at different orientations <ref type="bibr">61</ref> . The neural activity vector is a specific activation pattern coding for the current video segment in terms of the learned Box 4</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Model flexibility and predictions</head><p>The APC model appears to be flexible enough to perform a diverse set of functions such as: (1) parsing images and learning part-whole hierarchies: the model uses eye movements to parse images and learn hierarchical representations of parts and subparts of objects (details in the section Active visual perception and part-whole learning); (2) invariant perception: learned representations of objects and sequences are transformed by the APC generative model to match current inputs and remain invariant to different types of transformations (translations were considered in the section Active visual perception and part-whole learning, other transformations such as rotations and scaling are included in ref. 33); (3) perceptual stability: inference in the APC model naturally leads to integration of information across actions such as eye movements, leading to perceptual stability (examples in the section Active visual perception and part-whole learning; see also refs. 23,59,74); (4) compositionality and fast transfer of knowledge: by learning compositional representations, the model can compose and generate new objects and action sequences, leading to fast generalization to new inputs and goals (examples in the sections Active visual perception and part-whole learning and Planning and navigation using hierarchical world models); (5) efficient planning: hierarchical state networks in the APC model can be used to solve tasks efficiently (for example, navigating in a large environment) by planning using hierarchical actions (details in the section Planning and navigation using hierarchical world models; see also ref. 107); ( <ref type="formula">6</ref>) habit formation: successful plans can be used to learn new policies ('habits'; see the section Planning and navigation using hierarchical world models); alternately, the APC model also allows policies to be learned using hierarchical reinforcement learning (see the section Active visual perception and part-whole learning); (7)  reference frames and temporal hierarchies: the APC model provides a neural implementation of nested reference frames <ref type="bibr">23</ref> and offers an explanation for object-centered parts-based representations in the cortex <ref type="bibr">108</ref> as well as cortical temporal hierarchies <ref type="bibr">28,</ref><ref type="bibr">29</ref> ; (8) prediction and postdiction: because the model maintains a temporally stable higher-level state (a 'timeline' (ref. 76)) encoding an entire sequence (past, present and future), the update of this representation during prediction error minimization explains both predictive and postdictive phenomena in perception (for example, flash lag and color phi effects; see ref. 61 for details); (9) generating 'schemas' or 'programs' for solving new tasks: the APC model suggests a neural mechanism (via top-down inputs and/or gain modulation) for generating new sensory-motor 'programs' or 'schemas' on the fly to solve new tasks (Box 3 and ref. 109); (10) binding and episodic memories of perception-action sequences: when coupled with a hippocampus-like associative memory, the model binds multimodal cortical activations at the highest level into an episodic memory, allowing activity recall, prediction based on episodic context and cortical consolidation for fast generalization and learning, as discussed in the section Episodic memories and corticalhippocampal binding; (11) language and symbolic representations: making state and action representations categorical (for example, ref. 78) and using cortical-hippocampal binding may allow the APC model to bind sensory and symbolic representations for language processing and cognitive tasks such as arithmetic (see the section Learning abstract concepts and ref. 58); (12) learning abstract concepts: the same sensory-motor architecture used for perception and planning can also be used to model abstract concepts such as family trees (details in the section Learning abstract concepts and ref. 77). The APC model makes the following predictions: &#8226; The laminar implementation proposed in the figure in Box 1 (panel c) predicts that, in each cortical area, neurons representing the sensory-derived latent state will exhibit predictive activity, representing the output of the state-transition function fs , as a function of both sensory inputs and deeper-layer 'action' inputs; experimental manipulation of deeper-layer activity should allow control of this predictive activity and change this activity similar to how the predicted glimpses change in Fig. 3a as a function of action inputs to fs . &#8226; In each cortical area (including traditional 'sensory' areas), the model predicts a population of neurons in layer 5 representing 'actions', either motor outputs (for example, in M1 or the primary somatosensory cortex) or abstract actions or goals (for example, in the parietal or prefrontal cortex); this action-related population activity in layer 5 should change in a coordinated manner across cortical areas whenever the goal or task is changed, similar to how the lower-and higher-level actions change in the APC model whenever the goal location is changed in Fig. 4a. &#8226; As depicted in the figure in Box 3 (panels a,e), feedback from a higher cortical area should originate from two separate populations (higher-level state-and action-representing neurons) and specifically target two separate populations in the lower area (lower-level state-and action-representing neurons, respectively); this feedback should be modulatory and capable of changing the functional connectivity of their target populations, emulating the effects of the 'hypernetworks' H (i) s and H (i) a in the figure in Box 3 (panels a,e). Experimental manipulation of this feedback should selectively change the lower-level functions f (i) s and f (i)</p><p>a being computed, with the effects becoming apparent in the state predictions being generated by fs (see predicted glimpses in Fig. <ref type="figure">3a</ref>) and the actions being output by fa (see primitive actions in Fig. <ref type="figure">4c</ref> (bottom)), respectively.</p><p>&#8226; APC's hierarchical arrangement predicts the existence of both state and action representations in higher-order cortical areas that encode information over longer time scales than lower areas <ref type="bibr">28,</ref><ref type="bibr">29,</ref><ref type="bibr">61,</ref><ref type="bibr">80,</ref><ref type="bibr">98,</ref><ref type="bibr">110</ref> ; furthermore, the model predicts that a substantial population-level activity change in the superficial layers of a higher area, denoting a higher-level state change triggered by a subgoal being achieved by the lower area, would cause a large population-level activity change in layer 5, signifying a new high-level action or subgoal being generated (for example, the high-level action leading to macro-step 2 or macro-step 3 in Fig. <ref type="figure">3a</ref> or a subgoal that reaches the lower yellow square in Fig. <ref type="figure">4c</ref> (top)). Perspective <ref type="url">https://doi.org/10.1038/s41593-024-01673-9</ref> spatiotemporal filters. At the highest level N of the APC model, the specific activation patterns &#349;(N) and &#226; (N) together represent (figure in Box 3, panel e, with i + 1 = N) an entire sequence (or timeline <ref type="bibr">76</ref> ) corresponding to the current episode of interaction with the environment, for example, the sequence of glimpses of an object as in Fig. <ref type="figure">3a</ref> or the sequence of locations visited during navigation as in Fig. <ref type="figure">4c</ref> (bottom). By 'binding' these highest-level neural activation patterns &#349;(N) and &#226; (N)</p><p>(assumed to correspond to entorhinal cortex activity in the APC model) in a hippocampus-like associative memory, one can store the current sequence of experienced sensations (vision, touch, sound, smell, rewards, etc.), locations (or coordinates within a reference frame) and actions as an episodic memory vector m (ref. 61).</p><p>The projection from the hippocampus back to the entorhinal cortex implies that the fused multimodal information in the current episodic memory vector m is fed back to enable better prediction (m plays a role similar to context windows in transformers in AI) and to influence state and action estimation in cortical areas down the hierarchy to the lowest levels. Particularly salient episodic memory vectors may be stored and later compositionally recombined <ref type="bibr">73</ref> or recalled for replay in the cortex when given an internal or external cue, for example, a location where the episode occurred, a sound or smell associated with the episode or a partial visual input marking the beginning of the episode (see ref. 61 for an example).</p><p>In summary, the APC model suggests that the cortex encodes generic semantic knowledge about the world within state and action networks that implement nested reference frames. Any particular instantiation of this knowledge invoked by, for example, an interaction with a person or an object, is stored temporarily as an episodic memory vector m in the hippocampus. This instantiation could be used for reasoning about the current situation or for planning and, if deemed important, could be consolidated within the cortex by updating cortical networks via replay during inactivity or sleep. The idea of fast binding of specific instances ('fillers') with generic semantic 'roles' is gaining currency in both AI <ref type="bibr">58</ref> and hippocampal modeling (for example, the Tolman-Eichenbaum machine <ref type="bibr">77</ref> ; see also ref. 73). The benefits of such a representation, including fast transfer of knowledge and zero-shot learning, can be expected to also accrue to the memory-augmented APC model.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Learning abstract concepts</head><p>I briefly sketch here how the same sensory-motor architecture used for perception and planning above could also be potentially used to model abstract concepts. Take, for example, modeling the concept of a family tree. The state-action representations in the APC model can be made categorical (for example, as in ref. 78), allowing states and actions to represent symbols. The states can then represent abstract categories such as father, mother, daughter, uncle, etc., while abstract actions (up, down, etc.) can be used to traverse and define a family tree sequentially. The notion of 'fast binding' of cortical representations in hippocampal memory discussed above could be used to bind specific persons to their roles (father, mother, etc.).</p><p>Results along these lines were obtained using the Tolman-Eichenbaum machine model <ref type="bibr">77</ref> , in which a recurrent neural network (similar to the state-transition network in the APC model but for a single level) was used in conjunction with an associative memory to learn the structure of family trees from examples. Extending these ideas to abstract state-action networks for symbolic reasoning in a hierarchical APC model may offer new insights into understanding how cortical-hippocampal networks represent language and solve abstract cognitive tasks such as arithmetic.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Discussion</head><p>Inspired by recent results highlighting the influence of actions across most areas of the cortex, I suggested APC as a sensory-motor theory of cortical function. APC proposes that (1) each cortical area implements both a state-transition network for state prediction and an action network for action (or goal) prediction, and (2) higher-area neurons representing more abstract states and actions modulate lower-area state and action networks via top-down modulatory control to change the functions they are computing, leading to nested reference frames and hierarchical representations of objects, states and actions. A possible neuroanatomical mapping of the APC model to cortical laminar structure was suggested in the section APC module and neuroanatomical implementation.</p><p>The APC model lends support to the hypothesis <ref type="bibr">[20]</ref><ref type="bibr">[21]</ref><ref type="bibr">[22]</ref><ref type="bibr">[23]</ref> that there may be a unifying computational principle operating across the cortex by showing how the same basic APC architecture can perform a diverse range of computations (see Box 4 for a summary). The APC model shares broad similarities with a number of other models advocating prediction and hierarchy as core aspects of brain function <ref type="bibr">1,</ref><ref type="bibr">3,</ref><ref type="bibr">22,</ref><ref type="bibr">23,</ref><ref type="bibr">[79]</ref><ref type="bibr">[80]</ref><ref type="bibr">[81]</ref><ref type="bibr">[82]</ref><ref type="bibr">[83]</ref> , going back to the seminal early work of MacKay 84 and Albus <ref type="bibr">85</ref> . The goal of putting action on an equal footing with perception in terms of Bayesian inference and prediction error minimization is in keeping with the theories of free energy minimization proposed by Friston and others <ref type="bibr">3,</ref><ref type="bibr">8,</ref><ref type="bibr">69</ref> . In its current formulation, APC addresses action selection via reinforcement learning (see the section Active visual perception and part-whole learning) and planning via model predictive control (as described in the section Planning and navigation using hierarchical world models). The latter is related to planning as inference methods <ref type="bibr">[63]</ref><ref type="bibr">[64]</ref><ref type="bibr">[65]</ref> and active inference schemes that optimize expected information gain plus expected value <ref type="bibr">8,</ref><ref type="bibr">69</ref> .</p><p>Compositionality and the representation of sensory-motor information in cortical columns are also central tenets of the 'thousand brains' theory <ref type="bibr">23,</ref><ref type="bibr">59</ref> . The close interaction between state-estimation networks and action-computing networks in the APC model is consistent with theories of optimal motor control <ref type="bibr">86</ref> , especially theories highlighting the importance of internal models in solving the inverse problem of computing optimal motor commands to solve a task <ref type="bibr">81,</ref><ref type="bibr">87,</ref><ref type="bibr">88</ref> . However, based on recent evidence pointing to outputs from layer 5 in essentially all cortical areas to subcortical motor centers <ref type="bibr">19,</ref><ref type="bibr">34,</ref><ref type="bibr">35,</ref><ref type="bibr">37</ref> , the APC model proposes that all cortical areas include both state-estimation and policy components. M1 is often cited as a uniquely 'motor' cortical area missing the sensory input layer 4, with damage to M1 in primates causing permanent loss of distal (although not proximal) movements <ref type="bibr">89</ref> . However, even M1 receives sensory information from other cortical and subcortical areas <ref type="bibr">90</ref> , especially in its superficial layers <ref type="bibr">39,</ref><ref type="bibr">40</ref> , and could therefore, as suggested by the APC model, predict and estimate state (for example, proprioceptive state) and compute actions based on these state estimates <ref type="bibr">91</ref> .</p><p>The APC generative model in the figure in Box 3 (panel a) focuses on hierarchical structure and does not account for cross-modal (sensory to sensory) or hierarchically 'horizontal' connections in the neocortex (for example, ref. 92). However, it is possible to extend APC's generative model to allow cross-modal influences and horizontal interactions to enable more accurate state prediction and estimation. For example, consider a generative model evolved for use by an animal foraging in the forest: the hidden state denoting, for example, a tiger, can generate both a visual cue (stripes) and an auditory cue (rustling sound). In the extended APC model employing such a generative model, the state network in a sensory area (for example, V1) would leverage information from other sensory modalities (for example, from the auditory cortex) via horizontal cortical connections to derive an accurate estimate of the current state of the world. Extending the APC model to account for such cross-modal and horizontal cortico-cortical connections is an important direction for future work.</p><p>A large number of unknowns remain such as the exact physiological mechanisms underlying the modulatory interactions between higher-order and lower-order cortical areas across multiple time scales, the role of alpha, beta, theta and gamma oscillations in such interactions and the representation of uncertainty in the cortex.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_0"><p>https://doi.org/10.1038/s41593-024-01673-9</p></note>
		</body>
		</text>
</TEI>
