Biomimetic model of corticostriatal micro-assemblies discovers a neural code Authors: Anand Pathak, Scott L Brincat, Haris Organtzidis, Helmut H Strey, Sageanne Senneff, Evan G Antzoulatos, Lilianne R Mujica-Parodi, Earl K Miller, Richard Granger Published: 2025 ABSTRACT AbstractAlthough computational models have deepened our understanding of neuroscience, it is still highly challenging to link actual low-level physiological activity (spiking, field potentials) and biochemistry (transmitters and receptors) directly with high-level cognitive abilities (decision-making, working memory) and associated disorders. Here, we introduce a mechanistically accurate multi-scale model directly generating simulated physiology from which extended neural and cognitive phenomena emerge. The model produces spiking, fields, phase synchronies, and synaptic change, directly generating working memory, decisions, and categorization. These were then validated on extensive experimental macaque data from which the model received no prior training of any kind. Moreover, the simulation uncovered a previously unknown neural code (“incongruent neurons”) that specifically predicts upcoming erroneous behaviors, also subsequently confirmed in empirical data. The biomimetic model thus directly and predictively links decision and reinforcement signals, of computational interest, with spiking and field codes, of neurobiological importance.Subject terms: Neural decoding, Neural encoding Introduction How do collections of neurons somehow produce cognition? How do patterns of physiological activity in cells arranged into anatomical wiring layouts, somehow generate perception, learning, memory, decisions, and behaviors? Beyond its critical role in eliciting cognition, the corticostriatal circuit is implicated across a wide range of common yet devastating psychiatric and neurological disorders broadly related to dopamine, reinforcement learning, conditioning, and reward1–6. Thus, having a way to simulate the corticostriatal circuit in a biologically adherent manner matters not only because it would answer some of our most fundamental questions in neuroscience, but also because it would permit in silico testing of candidate mechanisms for disorders and candidate pharmacological interventions targeting those mechanisms. In recent years, there have been extraordinary breakthroughs in computational neuroscience. However, most of these models have been optimized for either mechanistic accuracy or to elicit emergent cognition, but not both. On the one hand, there are powerful models with biologically-based systems that reproduce extensive physiologies, from single-cell spiking through generation of oscillations and other critical emergent dynamics. Yet, while these can accurately simulate brain-wide phenomena7, such as epileptic seizure genesis and propagation8,9, they are not designed to generate cognitive processes, such as learning. On the other hand, some of the most remarkable cognitive models are those grounded in artificial neural networks and related algorithms10–15. Yet, while this is a class of models that effectively “learn,” they do so without reliance on strictly biologically realistic (biomimetic) mechanisms at the cellular scale. Some influential models optimize for both16–26. These examples illustrate how a set of constraints from not only the machinery of anatomy and physiology but also the emergent trial-level behavior can be incorporated and satisfied into a single unified model across multiple scales. However, it has been an ongoing challenge to construct models that combine biochemical and physiological details with the cognition they produce, which are required to uncover underlying mechanisms of potential clinical importance for biological disorders that present mentally and behaviorally. Of course, in silico “discovery” of new mechanisms and treatments is possible only if models can apply their learned knowledge to novel or unexpected inputs. A computational model’s ability to make predictions or draw conclusions about data that fall outside the distribution of its training set is referred to as out-of-distribution inference. A standard training approach is to train a model from half the data of a particular kind and then test its ability to predict the other half. A far more rigorous standard of generalizability is to ask whether a model built from one kind of data can predict phenomena of a wholly different kind. In the present work, the model is constructed from the broad literature of cell types and physiology, but it is not parameter-fitted on any particular experimental data. The model is then presented with an experimental task, such as visual stimuli and rewards. Separately, animal subjects have also been exposed to this same experimental task. The model has not been presented with any of the animal’s physiological or behavioral data. Instead, the model is presented with the same visual stimuli as the animals, as well as simulated rewards. In response, the model learns the same task, at about the same rate, as the nonhuman primates (NHPs). In doing so, the model produces extended simulated physiological cell firing and synaptic change activity, across multiple separate anatomically modeled brain regions. This activity, which we term “physiological computation,” is then directly compared with corresponding physiological measures from the NHP experiments. In sum, we built a physiological computation model of the corticostriatal circuit designed to be mechanistically accurate across multiple scales, from spiking neurons to local field potentials, informed solely by the physiological literature. This circuit elicits category learning, a complex cognitive process encompassing sensory encoding, perceptual categorization, reinforcement learning, action selection, and working memory; these all are described below in detail. We then validated the model using macaque (NHP) electrophysiology and behavioral data27,28. Intending to start with a minimal circuit model that would incorporate the above functions, we started by modeling a cortical region, worked our way through to the striatal complex (MSNs, TANs, SNc), and continued further to complete a corticostriatal loop by including globus pallidus (GPi and GPe) and thalamus. Each component consists of a specific assembly of simulated neurons arranged according to anatomical circuit layouts. Each of these micro-assemblies had specific internal structure and anatomical connections, and specific physiological activity characteristics, each as informed by the extensive experimental literature, and each such micro-assembly was found to contribute a specific neural computation (biomimetic computational primitives (BCPs)). Crucially, these neural computations were not assigned top-down or in advance, but rather emerged bottom-up from observation of the individual circuit simulations. We initially expected the corticostriatal circuit to exhibit only a few specific outputs, such as accurate behavior and spectral properties of neural activity, yet we surprisingly found that the model exhibited far more complex neuronal phenomena than initially intended. Notably, in addition to replicating known physiological patterns and behaviors, the model predicted previously unknown and unexpected neural encodings, that were then confirmed in the experimental data. Results We developed a generalizable, tractable, biomimetic, multi-scale brain model that categorizes visual stimuli after a delay. The model can be described as carrying out “physiological computation”: bottom-up mechanistic information-processing operations that arise directly from the physiological steps taken by cells within well-defined anatomical circuitry from distinct brain regions. The biomimetic model was not directly designed for any particular task, but responds physiologically to whatever tasks are presented to it. The initial task for this simulation was a well-studied task from the literature, given both to the simulation and to NHPs (macaques)28 (see Experimental Task design in Methods and Fig. S6a, b). Simple visual dot-pattern stimuli (see Methods) were presented to the simulation and to the NHPs, and then, after a delay, the subjects had to decide which of two “categories” the stimulus had been. For NHPs, the decision was signaled by a saccade to the left for one category (A) or to the right for the other (B); the NHPs then either received a reward (for correct category choice) or forced-delay “punishment” (for incorrect choice). The simulation was presented with the same images and delays and produced a corresponding simple simulated left or right motor output, and then received a simulated reward or punishment as in standard reinforcement learning. Over many trials (in which the image is shown, a choice is made, and the corresponding reward is given), well-studied plasticity rules from the literature are used by the simulation to adjust its synaptic weights (see Methods for details). These adjustments lead to improved outcomes over time, and thus learning. Details of the brain model at multiple biological and computational scales The model is multi-scale in that it specifies anatomical structure across the levels of neurons, assemblies, circuit structure, and brain regions, and physiological responses are measured from the levels of individual spikes, synaptic plasticity, local field potentials, sychrony and phase relations across structures. The model simulates electrical activity of individual neurons, connections among groups of neurons within the same brain region ("assemblies”), and anatomically-based long-distance electrochemical connections between regions. The combination of these interactions, the “connectome,” intrinsically generates the synaptic changes that lead to learning. There are many ways of describing such a complex model. We provide extensive details and equations in the Methods; Fig. 1 shows graphically the hierarchical configuration from individual cortical neurons to the whole brain model; and we describe here the main subcircuits that comprise the model. Subcircuits are themselves composed of smaller assemblies of neurons. Many components of the model are contained in more than one subcircuit, so the subcircuits are often defined by their physiology as well as by the emergent input-output effect of these physiological operations, i.e., their physiological computation. A graphical illustration of our model highlighting key elements and connections from individual neurons organized into assemblies and assemblies organized into brain regions. a Multiple neural assemblies (biomimetic computational primitives), all derived directly from anatomical structures and physiological neuron operations; see Methods and Table 1. b Closeup on one primitive: a local-feedback lateral inhibition circuit (L-FLIC). This cortical assembly is composed of four excitatory cells and one inhibitory cell, corresponding with superficial layer anatomy. Time-dependent voltage transients within the cells -- shown as voltage (V) vs. time (t) graphs -- build up over time as a function of the number of active input axons, and the number and weights of connected target dendritic synapses. The overall effect is that the most-activated excitatory cell(s) reach action potential threshold more rapidly than other cells (1); once any excitatory cell spikes, it activates its local inhibitory cell (2), which in turn inhibits all local excitatory cells (3). Thus, only the most-activated excitatory cell(s) can respond. c Multiple simple cortical `columns' in the simulation contain lateral-inhibition sub-circuits, which are sparsely connected with each other as described in Methods, as well as receiving diffuse input from a simulated simple ascending system (ASC1). Cortical and subcortical structures in the simulation are interconnected as described in the anatomical literature. The model posterior ‘visual’ regions are presented with visual stimuli, and the system is presented with simple simulated ‘reward’ signals (‘behavioral feedback’) based on the system’s chosen output (saccade) behavior (see text for detailed description) Other brain circuit components are defined as follows: ANTC anterior cortex, ASC1 ascending system, STR striatum, St striosome, Ma matrisome, SNc substantia nigra pars compacta, TANs tonically-active neurons, GPe globus pallidus pars externa and GPi interna, STN subthalamic nucleus. Connections among brain regions are each associated with simulated biochemical transmitter / receptor pairs: glutamate (Glu, blue arrows), gamma aminobutyric acid (GABA, capped red lines), ascending neuromodulators (ANM, green lines with diamonds), dopamine (DA, orange lines with diamonds), and acetylcholine (ACh, purple lines with diamonds). Illustraions by Alex Driussi, published with permission. We describe our model computationally by considering the biomimetic computational primitives that cannot be further reduced. In computer programming, a primitive is a fundamental irreducible language element that performs a simple task (such as adding two numbers). In the model, primitives are realized as assemblies of small numbers of neurons based on specific anatomical layouts of cell types and interactions, and includes several well-studied emergent primitives of physiological computation, such as action selection, reward prediction, central pattern generation, long-term potentiation/reversal, and exploration/exploitation (see Table 1). Some of these are shown in Fig. 1a as other biomimetic computational primitives. The composition of primitives in turn produces further novel computational operations, allowing for complex behaviors similar to how computer programming primitives can be combined (e.g., in a set of instructions) to perform challenging computations. Table 1Current Blocks for Corticostriatal ModelBiomimetic Computational PrimitivesComputational OperationsRegionsLocal-Feedback Lateral Inhibition Circuit (L-FLIC)Lateral InhibitionAnterior, Posterior NeocortexMatrisomal MSN (MMSN)Action SelectionCaudate, PutamenStriosomal MSN (SMSN)Reward PredictionCaudate, PutamenAscending Type 1 (ASC1)Central Pattern GenerationPons, BrainstemSuperficial Glu − GABA − DA Plasticity (GLTP)Long-Term Potentiation, ReversalCortex, VTACholinergic Tonically Active Neurons (CTAN)Exploration/ExploitationCaudate, Putamen Current Blocks for Corticostriatal Model For the learning task described here, a set of information-processing operations is carried out by a simple, but biologically grounded, small assembly of excitatory and inhibitory cortical cells. This assembly of typically 5-6 neurons is irreducible and can thus be considered to be one functionally primitive element of brain circuitry. The arrangement used here is notably distinct from other approaches that have been used to generate lateral inhibition29–36. It also provides a starting point for investigating how biochemical deviations (e.g., pharmacological blocking or modulation of glutamatergic or GABAergic receptors) could affect both physiological and cognitive processes. The anatomical configuration of this computational primitive is an assembly of excitatory and inhibitory cortical neurons shown in Fig. 1b. These local assemblies of excitatory and inhibitory neurons in simulated superficial cortical layers are anatomically connected such that 1) each glutamatergic input axon (from the simulated visual cortex or any cortico-cortical input) makes contact sparsely with a fixed number of excitatory target dendrites and 2) each excitatory dendrite receives contacts from a separately fixed number of incoming axons37. Furthermore, 3) the excitatory cells densely contact local inhibitory cells (in a ratio of about 5:1), and 4) the inhibitory cells reciprocally make dense contacts with local excitatory cells38–40. Within a local assembly, an activated excitatory neuron will activate the inhibitory neuron, which then inhibits all other excitatory neurons (including the one that activated the inhibition). Thus a very limited subset of target excitatory cells can successfully respond to an input; this “Local-Feedback Lateral Inhibition Circuit” (L-FLIC) primitive bears some correspondence with well-studied neuronal activity patterns of specific kinds of lateral inhibiton competitive circuitry. As a computational primitive, this feedforward excitation - feedback inhibition circuitry has been described in terms of several nonlinear computational functions, including non-linear selection and “soft winner-take-all”; signal restoration; and bistability and multi-stability41. More specifically, lateral inhibition arising from anatomical relations among excitatory pyramidal and local feedback inhibitory cells is conserved across superficial cortical regions42,43, whereas physiological feedback inhibition from multiple subtypes of interneurons is well also studied44,45. Multiple such assemblies are present in the cortical structures (visual regions and anterior cortex) in the model, and they are sparsely interconnected with each other, as briefly illustrated in Fig. 1c, and discussed in Methods. Thus, the local-circuit L-FLIC biology for superficial cortex directly follows a number of known anatomical and physiological details from the literature. (i) There are 4–5 times more excitatory cells than inhibitory cells. (ii) The inhibitory cells roughly tile the span of excitatory cells. (iii) The radial axonal arborization of local feedback inhibitory basket cells is relatively short, spanning a small set of closely neighboring excitatory cells. (iv) Within this abbreviated neighborhood, excitatory connections to inhibitory cells and inhibitory connections to excitatory cells both are dense. (v) The spiking threshold of the inhibitory cells is far lower than for excitatory cells (inhibitory cells are far easier to activate). (vi) The activation of any subset of excitatory cells (e.g., 1–2 cells) will therefore rapidly activate the inhibitory cells, and the inhibitory cells will then rapidly thereafter spike and inhibit the local excitatory cells (including those cells that activated the inhibitory cell). Thus, after activating any excitatory cells, the feedback inhibitory cell will respond and inhibit them. So once some excitatory cells within this local region have been activated, they will be rapidly silenced, and those excitatory cells will thereby be the only cells to survive the feedback lateral inhibition. It is this physiological cascade of activity that is simulated via the L-FLIC primitive. In a separate ongoing work we are considering simpler circuits to determine the criticality of this particular primitive. The evolution of neuronal activity in these assemblies starts with an incoming set of spikes from a simple “visual” cortex region (SVCR). The stimulus (dots on the screen) activates these neurons, with individual connections corresponding to specific pixels on the screen. These neurons induce depolarization via input axons that contact dendritic synapses of neurons in the simulated anterior cortical area (ANTC) as illustrated in Fig. S2. The total voltage over time (illustrated by voltage-time graphs in Fig. 1b) rises at a rate that is dependent on the quantity of input activation at a given target cell (e.g., the brightness of that pixel) and the weights of the receiving synapses. The active synapses of the responding cells will then be increased slightly in weight as determined by the rules from the literature for glutamatergic synaptic plasticity (see Methods). These synaptic increases makes it even more likely that slight variants of an input will activate the same target excitatory cells. As a result, similar inputs will increasingly come to elicit identical, not just similar, cortical responses (Figs. S6–S7). It should be noted that the overall behavioral attainment of category learning uses the L-FLIC circuits and trial-based synaptic changes, in concert with additional physiological elements that include both cyclic striatal-thalamic-cortical acitivity, and synaptic short-term potentiation during a delay period, as well as interaction among striatal components, and reinforcement-related dopamine-modulated striatal synaptic change; these and further components are embedded throughout the corticostriatal circuit system (Fig. 1c). At a larger scale, the simulation incorporates well-studied physiological properties of neurons into three subcircuits (Fig. 1c). The Cortex Subcircuit, comprising the aforementioned Simple Visual Cortical Region (SVCR) and Anterior Cortex (ANTC), is composed of blocks of lateral inhibition assemblies that receive input from an external visual grid input ("Stimulus” in Fig. 1c) with some connections among assemblies. This subcircuit also receives ascending rhythmic inputs (ASC1 in Fig. 1c) modeled as next-generation neural mass models46,47 as described in Methods. The Striatal Subcircuit (which also could be termed the “Basal Ganglia” subcircuit) consists of matrix (matrisome) assemblies, patch (striosome) assemblies, substantia nigra pars compacta (SNc), and tonically active (TAN) neurons. Matrisome and striosome blocks are composed of medium spiny neurons (MSNs) receiving convergent inputs from the cortex (via glutamate), from the Tonically Active Neuron (TAN) structure (via acetylcholine), and from the SNc (via dopamine) while outputting to the pallidum and thalamus. The TAN cells receive inputs from intralaminar thalamic nuclei48 and GABAergic striosomal MSNs. TAN projection synapses co-localize with corticostriatal synapses. It should be noted that neurons in both the Striatal and TAN Subcircuits are not modeled as spiking neural elements but use simplified physiologically-derived “rules” whose equations define their input/output behavior (see Methods). This simplification from assembly of multi-compartmental neuron models to input/output elements is supported by a large body of experimental49–53 and modeling54–56 studies. The Brainstem Subcircuit is a highly simplified ascending system (ASC1 in Fig. 1c). This represents a simulated ascending system (such as locus coeruleus or basal forebrain) that generates oscillatory input, centered around 16 Hz. The resulting rhythmic activity provides input to the ANTC beyond the SVCR input generated by the stimulus. It is modeled using next-generation mean-field neural mass models46,47 and descending signals are not as yet considered. Details on these subcircuits are provided in the Methods and Supplementary Material. The interconnections among these subcircuits support the process of learning. As the model experiences many trials, there are changes to synaptic strength for cortico-cortical, cortico-striatal, and thalamo-cortical contacts that cause changes in behavior. For example, initial trials have significant cholinergic noise from the TAN Subcircuit that increases variance in target matrix MSN responses, which we hypothesize adds exploratory variability to striatal action selection [see ref. 57]. As learning progresses, corticostriatal synapses to striosomes are strengthened, which increases their ability to inhibit TANs, which decreases variability as associations are effectively learned in the corticostriatal system. Thus, the TAN subcircuit is a crucial part of toggling from “exploration” to “exploitation” (see Fig. S3). The model succeeded in categorical learning at a rate similar to NHPs while replicating cortico-striatal synchrony effects The simulation is intended to characterize phenomena that currently cut across multiple levels of description. For example, in real brains, spiking neurons give rise to waves, yet waves in turn strongly modulate spiking; and both spiking and waves appear affected by disorders and by drugs [e.g., refs. 58–61]. We provide initial evidence that the simulation may assist in uncovering the mechanisms of these cross-level relations. Preliminary validation of the model came from the observation that the simulated neuronal activity and interaction patterns were similar to NHP brains as they perform similar tasks (see Supplementary Figs. S4 and S5). In particular, the post-stimulus-onset cortical silence observed in the simulation, was also seen in the empirical data (Supplementary Fig. S5). This exemplifies the detailed physiological features produced by the simulation that correspond directly to those that also occur in real neural activity (despite the lack of any training of the simulation on any such data). Although the simulation carries out solely physiological operations, in doing so, it successfully learns the visual categorization task that it is presented with. That is, via its own synaptic changes, it acquires the category characteristics (i.e., discriminating category A from B) and it learns (via its own simulated striatal activity) to produce simple appropriate behaviors (a simulated “saccade” left or right). The behavioral responses increase in accuracy across trials (Fig. 2a) both in the simulation (top) and in the experimental animals (bottom), and at comparable rates. The model achieves 80% performance accuracy consistently between 100 to 400 trials across the sessions, and once that 80% level is attained, it is maintained throughout the remainder of the trials in the session. Cortico-cortical synapses exhibit long-term increases in weight (Fig. 2b). By contrast, striatal synapses exhibit increases and decreases as per the combined effect of cortical glutamatergic, SNc dopaminergic, and TAN cholinergic inputs that converge at each spine of striatal medium spiny neurons (see Methods and Fig. 1). Thus, cortical synapses are seen to slowly strengthen, while corticostriatal synapses strengthen and weaken over trials. Cortical and striatal synaptic change underlie changes in spiking and synchrony leading to behavioral changes in the form of learning. a Behavioral learning over trials in simulation (top) and NHPs (bottom) exhibit comparable characteristics. Correct behaviors increase slowly over early trials (0–200, light green shaded), and reach plateau performance by about trial 450. We define trials 500–700 as “late" (gray shaded). b Changes to simulated synaptic strength averaged over all connections for cortico-cortical, cortico-striatal, and thalamo-cortical contacts across trials, as well as accuracy of behavioral trials. The trends show Long Term Potentiation (LTP), Long Term Depression (LTD), and synaptic potentiation reversal. c Simulated (top two) and empirical (bottom two) activity of single sessions across trials. Each row represents Local Spike Summations (for simulated data) and Local Field Potentials (for empirical data) over a single trial. Dashed lines indicate the time of stimulus offset. d Corticostriatal phase-locking values (PLV ± SEM) from simulated (top) and empirical (bottom) data. These show that later trials (blue) had increased phase locking between the cortex and striatum in the beta frequency band (in gray) which is driven by the simulated ASC1. This phase locking remains even when the stimulus is removed for both the simulation and the NHPs. Source data are provided as a Source Data file. The processes of learning and of holding information in “working memory” depends on interconnections among all four primary (cortical, striatal, TAN, and brainstem) subcircuits. Ongoing recurrent activity, via feedback from striatum to thalamus to cortex to striatum, crucially drives the ongoing memory; this is concordant with the recorded data from the NHPs. Investigating neuronal activity differences between early and late trials (Fig. 2c) shows that spiking is much stronger in late trials for both simulated and empirical systems, in both the cortex and striatum, and both during and after stimulus presentation. Empirical observations of spiking in NHP brains are quantified using the local field potential (LFP)28. For the simulation, we developed a far simpler metric called local spike summation (LSS), defined in Methods. This is not meant to simulate LFPs, but rather to identify first the simple summed activity in local simulated cells (via the LSS measure), and by comparing with empirical LFPs, to thereby isolate possible LFP components beyond the simple LSS summations. Notably, the simulated LSS decreases in spiking substantially after stimulus offset whereas empirical LFP activity does not decrease by a corresponding amount (Fig. 2c). This is somewhat expected since real PFC neurons are subjected to substantial input from multiple cortical and subcortical regions that are not present in the simulation, and thus PFC cells are only partly driven by visual stimulus inputs. By contrast, in the simulation, there are no extraneous inputs and no artificially injected noise, so it is expected that the empirical and model records will substantially differ. These differences may well have importance, and further study of these is in progress. Surprisingly it was found that, despite these differences, there were notable correspondences between the inter-area cortico-striatal synchronies, and changes to these synchronies, that occurred both in the model and the macaques. The synchrony between cortical and striatal activity is calculated using the phase locking value (PLV) from a wavelet analysis of LSS or LFP time series (see Methods and Supplementary Material) as was done in28. PLV is measured in multiple frequency bands including the near 16 Hz (beta-frequency) band driven by the ASC1 in the simulations. Figure 2d shows that both simulated and empirical data showed increased synchrony in the beta-frequency band in late trials versus early trials, though this effect was much stronger in the simulation, in particular during the delay epoch. The activity during the delay epoch represents a “working memory" or “holding memory", in which there is no visual stimulus and the NHP must wait before saccading to indicate the stimulus category (A or B). This requires that the category information must be maintained by the NHP even though it can no longer be viewed. During this delay epoch, increased corticostriatal synchrony is seen in empirical NHP records (Fig. 2d, bottom right). A markedly similar change to synchronous activity is found in the simulation (Fig. 2d, top right), enabling study of what causes this in the simulation, and thus hypotheses of corresponding causes in the macaque brain. In the simulation, looping spiking activity from cortex to striatum to pallidum to thalamus back to the cortex is strongly present, and this is found to directly cause maintenance of the spatiotemporal firing pattern in the simulation even after the stimulus is off. This is explained in detail in Methods, Detailed model description. Further opportunities for causal mechanistic understanding are afforded by studying activity during correct versus incorrect trials. In the NHPs it is seen that synchrony in the beta frequency band is substantially increased only in correct trials. The difference between correct and incorrect trials is shown in terms of the PLV measure in Fig. 3. Both simulated and empirical results show that slightly higher synchrony during early incorrect trials is reversed with learning, so that later trials show stronger synchrony in the beta frequency band only on correct trials (Fig. 3a). The simulation again provides a candidate explanation: the correct trials cause higher cortico-striatal weights (Fig. 3b); these weights are initially similar for synapses on both “correct” and “incorrect” neurons, until about 450 trials (see Fig. 3b, and compare with Fig. 2b bottom panel). This is the point in the trials that may be said to behaviorally transition from “exploration” to “exploitation”; the synaptic strengths then markedly diverge, with correct targets becoming more strongly weighted. These weights for correct vs incorrect targets are also reflected in the rate of neuron spiking, which is much lower and more localized in both cortex and striatum during incorrect trials. This occurs both in the empirical and simulated findings, as can be seen in Fig. 3c. Strengthening of cortical-striatal synaptic weights support phase locking values and making correct choices. a Corticostriatal synchrony on correct vs. incorrect trials as measured by Phase Locking Values (PLV) at different frequencies (with the beta frequencies driven by the simulated ASC1 highlighted in gray). Shown are PLVs for incorrect minus correct trials on average (d), in units of standard deviations from a random sample (z(d) ± SEM, they are z-transformed, see Methods). Values that are significantly above zero are instances where incorrect trials have greater synchrony than correct trials; less than zero means correct trials have greater synchrony. In the model ("simulated'', top), corticostriatal synchrony during incorrect trials in the beta frequency range decreases with learning, from early (colored cyan) to late (colored blue) trials, both during stimulus presentation (left) and delay period (right); the macaque subjects (''empirical'', bottom) exhibited a corresponding effect as reported in ref. 28. b In the simulation, the synchrony decrease is found to be due predominantly to differential synaptic strengthening on those striatal cells responding on correct (blue) vs on incorrect trials (orange). These are average weights for synapses from cortical neurons to striatal neurons. c These synaptic effects show up in local spike summation (LSS) plots of simulation population activity in late trials, after extensive learning, in cortex (left) and striatum (right) on incorrect (top) and correct (bottom) trials. Due to selective weakening of corticostriatal synapses on incorrectly-responding cells (b), the striatal responses in incorrect trials become extraordinarily sparse; this is the primary contributor to diminishing corticostriatal phase-locking values. Source data are provided as a Source Data file. To further study the influence of particular individual circuit components in the simulation, we also performed an initial set of simulated lesion experiments. We disabled three key elements one at a time: SNc, striosomal cells, and TANs. All three lesions interfered with the learning behavior, but via clearly separate mechanisms (see Supplementary Figs. S12–S14), giving rise to testable predictions and insights about detailed circuit operation. In sum, not only does the simulation produce behavioral category learning commensurate with that seen in NHPs, the simulation also exhibits explicit and detailed physiological spatio-temporal spiking and field responses, from both cortical and striatal fields, which can be compared directly against empirical physiological data. The simulation shows a range of complex behaviors seen in the NHPs, including different synchrony and phase locking that is specific to the particular behavior that is being engaged (Figs. 2d and 3a). These same cortico-striatal activity patterns are shown to change over time as a response to synaptic plasticity—two distinct forms of plasticity for cortex vs. striatum (Fig. 2b)—and these changes in the model are compared directly against empirical changes in NHPs (Fig. 2c). The model has predictive power: the discovery of incongruent neurons An effective model of the brain will provide significant new insights into neuroscientific questions. Here we show that our model has specific predictive power as illustrated by the discovery of “incongruent neurons” in the simulation. Although we report in parallel the discovery in simulated and empirical data, we emphasize that the simulation results prompted the successful identification of a previously-missed behavior in the long-studied empirical data. Analysis of the simulation showed surprising predictive behavior in some neurons. After extended learning trials in the category task, the model reached a phase where every simulated excitatory anterior cortical neuron had acquired a characteristic preference to fire either for stimulus category A or B. Unexpectedly, every such neuron also turned out to have a specific response to the outcome of the trial: correct vs. incorrect. These neuronal responses were predictive codes: they fired at the start of a trial, even though the specific outcomes that they predicted would not occur for more than a thousand more milliseconds in the future. Specifically, all simulated neurons were found to show strongly selective responses to one of four conditions: A-correct, A-incorrect, B-correct, and B-incorrect. Here, the prefix (A or B) refers to the category of stimulus presented in a given trial, and the suffix (correct or incorrect) refers to the outcome of the trial after the subject responds. Thus, for instance, A-incorrect means that an A-type stimulus was presented and the subject responded incorrectly (responded in this case as though a ’B’ had occurred). These selective responses to one of the four conditions occurred during the initial 200 ms of stimulus (see Figs. S4, S5, and S8), long before the erroneous response would be performed. It is worth emphasizing that this is a strictly emergent phenomenon from the simulation’s internal synaptic learning process: these neurons are not (and biologically cannot be) pre-categorized in advance to separately target these four trial types. An initial expectation might be that a system that had successfully learned, over trials, to distinguish between the different types of stimuli, would have optimized its performance by having practically all neurons supporting correct choices, i.e., enabling the organism to produce the correct response leading to a reward. By contrast, any neurons that indicate an upcoming incorrect choice (A/B incorrect neurons) we thus termed these “incongruent neurons” (also corresponding to “incorrect synapses" in Fig. 3b). These incongruent neurons (ICNs) learned to predict an upcoming behavioral error. Comprising about 20% of all neurons, ICNs sufficiently activate target striatal action-selection cells for the other category, thus causing the wrong behavioral response. To explore these in greater detail and to determine whether or not such incongruent neurons also occur in empirical NHP data, we use a simple method to identify and characterize incongruent neurons. 1) Trials are sorted into the four “input-outcome” classes (A-correct, A-incorrect, B-correct, B-incorrect). 2) Spiking rates of each excitatory anterior cortical neuron during the first 200 ms of a given trial were normalized by the average number of spikes across the population for that trial-type. This then allows for 3) assignment of a neuron to one of the four classes based on the highest spiking rate. This simple sorting by their predicted decisions leads to neurons strongly (and often uniquely) correlated with each of the four classes, as shown in Fig. 4a. Though the implanted electrodes in the macaque NHPs acquire recordings of only very few neurons, Fig. 4a does indicate that the empirically recorded neurons appear also to exhibit predictiveness of specific eventual behavioral outcomes, in direct concordance with the ICN neurons found in the simulation. "Incongruent Neurons” (ICNs) were discovered in the simulation and later confirmed in empirical data: they reliably predict incorrect choices long before they occur, and are statistically highly significant. a Simulated and empirical cortical spiking preferences (see text) sorted by four conditions over the first 200 ms. b ROC (Receiver Operating Characteristic) plots showing how True Positives exceed False Positives for ICNs as measured by area under the curve (AUC). ICNs significantly outperform randomly chosen neurons, showing that the categorization into congruent and incongruent neurons is meaningful. c ROC for ICNs per session using a predetermined fixed decision threshold (see Methods); red dots are ICN predictiveness and gray dots are predictiveness of randomly chosen cells. d Sample trial-by-trial run showing effects of a real-time predictive intervention that halts trials based on sensing of incongruent neuron spiking patterns (red) or random spiking (gray) compared to the original performance (blue). e Summary statistics over all sessions: random neurons (gray) have negligible ability to change accuracy of outcomes (0.06 ± 0.72%) in empirical trials whereas ICNs (red) increase accuracy significantly (2.07% for empirical NHP trials and 0.79% for simulated trials). This level of improvement by random chance happens with probability p = 0.0017 for empirical trials and p = 0.003 for simulated trials. The increased accuracy confirms that NHP brains would improve at the task if ICNs responded differently and that ICNs are much better at predicted behavioral errors than random neurons. All the z-scores and p-values shown in this figure are calculated using one-tailed one sample z-test. Source data are provided as a Source Data file. We confirmed that ICNs were self-consistent and persistent in both simulated and empirical data with strong statistical significance. To ascertain statistical validity, we divided the late trials in half, and used the first half for determination of purported ICNs, which then were tested by being applied to the separate second half of late trials. Figure 4b shows that ICNs predict behavioral outcomes significantly better than randomly chosen neurons (p < 0.001 for empirical data and p < 10−21 for simulated data). We then applied an even more stringent threshold for validation of ICNs: could these neurons predict outcomes, in real-time, within individual trials? If a hypothetical device were implanted into the NHPs and trained on initial trials, it could be tested for its ability to improve behavior, by halting any trial in real-time whenever incongruent neurons predicted an upcoming erroneous response. Figure 4d shows a sample trial-by-trial run where such an ICN-based intervention significantly (p < 0.005) increases behavioral accuracy (Fig. 4e) of the simulation. Finally, we identified specific aspects of the simulation that show how ICNs are mechanistically produced. Supplementary Fig. S10 begins with sparse synaptic cortical connectivity and maps those connections backward, through multiple cortical areas, superimposing them directly back onto the visual input stimuli. The sparse combination of synapses that eventually co-occur at downstream cortical cells, defines circumscribed visual receptive fields that any given cortical neuron can “see.” Analyses (in Supplementary Fig. S10b–d) show that cortical cells are thus anatomically “pre-weighted” to probabilistically prefer either category A or category B stimuli. When these anatomical biases are sufficiently strong, they reliably predict eventual learned anterior cortical category A vs B cells, whereas less-biased, or more-ambiguous cells, become candidate incongruent neurons (ICNs). These detailed analysis of anatomical bias and synaptic modification are further detailed in Supplementary Material section IV. In addition to the anatomical bias there is another mechanistic aspect to the emergence of ICNs. Even though both the congruent (A/B correct) and incongruent (A/B incorrect) neurons are selective to their corresponding stimulus type, the difference lies in their downstream connections to the striatum. Thus, ICNs in the cortex tend to form stronger synapses with the striatal region that map to the motor response for the complementary category. Congruent neurons ‘learn’ stronger synapses with the striatal region corresponding to ‘correct’ motor response. This is the expected outcome of reinforcement learning. On the other hand, incongruent neurons ‘learn’ stronger synapses with the ‘incorrect’ striatal region. This outcome is not expected typically from reinforcement learning. This phenomena needs a deeper study on ICNs. These results statistically validate that ICNs are a real feature of both simulated and, surprisingly, NHP brains. Thus, the corticostriatal circuit simulation demonstrates its ability to satisfy the strictest bar of any model: predicting a previously unknown phenomena, subsequently empirically confirmed, that are quantitatively and qualitatively distinct from any information used in building the model. Discussion We demonstrate a brain circuit model capable of simulating activity across multiple scales, from individual neurons, to anatomical micro-assemblies, to whole brain rhythmic interactions, to behavior. The model is built solely from mechanistically accurate neural microcircuits, each corresponding to distinct brain region structures, and each of which naturally elicits distinct computational processes directly from its biological activity (physiological computation). These processes are shown to contribute basic operations, such as lateral inhibition and exploration/exploitation, to a complex categorical learning task. Model outputs reliably match independent experimental data acquired from NHPs, even though the model received no training from any of these data. The model’s emergent behavior includes detailed spiking behavior and cortical-striatal synchrony; learning-related changes to these spiking and field responses across trials; the accuracy of the task as a function of the number of trials; and selectivity of individual cortical neurons both for visual stimulus category and for trial outcome (correct vs. incorrect). All of these are subsequently shown to correspond to data from NHPs performing an equivalent series of tasks. A set of other models share our goal of adopting constraints from anatomy and physiology in their accounts of high-level cognitive abilities. Two notable instances are Emergent25,62 and SPAUN26, both groundbreaking systems that were aimed at bridging our understanding of cognitive and neural phenomena. The model presented here is in some ways building on that prior work, though there also are many crucial differences that make a substantial break between that work and the present simulation. The Emergent system25, a reinforcement-learning based architecture incorporating components modeling cortex and basal ganglia, was effectively taught to carry out trial-and-error tasks. This work bears substantial relation to the reinforcement components in the present model, except that in the present simulation all of the activity occurs solely from physiological signals that are from the biological striatal literature, rather than any other forms of computation. The present simulation emphasizes details of anatomical circuitry across cortex and basal ganglia components, differentiating it from the neuronal groups in the Emergent system62, which are characterized by well-justified network stand-ins that are hypothesized to carry out computations that may be generated within those brain structures. Emergent was able to provide strong candidate interpretations of functional operations of the striatal complex; we have incorporated modeling of detailed spiking, local field potentials, synchrony, phase locking and other physiological characteristics that actually carry out the computations themselves within the simulation. A different approach is seen in the Semantic Pointer Architecture Unified Network (SPAUN) system26, which constructs and manipulates advanced “semantic pointer” representations that capture complex relations within a semantic vector space. The system expresses “spikes” from its neurally inspired units, which are a very advanced and interesting code that is produced by the trained model in order to encode the stimuli, relations, and behaviors that it can process. The resulting model is based on strong hypotheses about vector symbolic algebra, using network models to encode these vectors, and to train weights. Although these are not designed to arise from bottom-up mechanisms of physiology, they nonetheless provide a powerful framework in which temporally changing information can be encoded, compressed, transformed, and decoded in brainlike circuitry. Research on SPAUN continues to make important connections between the vector symbolic algebra network and a range of neural responses in real brains. We hope that our simulation extends this work by demonstrating how bottom-up physiology can directly produce computation, with no separate semantic code, and how the resulting physiological computation compares both with empirical brain measures, from spiking to field potentials to synchrony, and with behaviors, from working memory to decisions to complex learning tasks. There are other studies that attempt similar connections between physiology and computation. Humphries et al., 200616 presents a mechanistic model that incorporates detailed anatomical and physiological corticostriatal data to demonstrate how the basal ganglia can perform action selection and how oscillatory activity can emerge from interactions between the constituent nuclei. Ashby et al., 200717 addresses automaticity in perceptual categorization via reinforcement learning arising from the basal ganglia. Ashby et al., 201118 investigates how cholinergic interneurons in the striatum can protect striatal-dependent learning from interference, allowing for the acquisition of new skills without overwriting previously learned ones, demonstrating the importance of incorporating real biological constraints into such models. Goldman et al., 200919 describes an “integrator” circuit and its utility in head-direction encoding; this is a very good example of a module, like a computational primitive, that may occur as a part of or incorporated in a larger neural system. Wang 202220 is a broad review that includes descriptions of decision-making systems that arise in part from gradients across cortical regions, based on differing time scales across cortex63,64. Wang 200821 describes a range of recurrent-connection systems that are used to produce multiple dynamical behaviors that can be directly compared with behavioral decisions; these are highly useful instances of an abstracted model that can be studied for its relevance to the neural details that may be occurring in actual anatomical circuitry. Hill & Tononi, 200522 describe an extensive model that is applied to data for sleep and waking. All of these are instances of circuit equations to probe neural correlates of some cognitive functions as well as head-direction cells and sleep. Primitives as often used in computational neuroscience65,66 are inspired by, or can be more directly derived from, the properties and functions of biological neurons and neural circuits, proposing abstractions of complex neural processes into mathematically tractable components. Examples include neural activation functions, such as sigmoids and rectified linear units (ReLU)65,66, synaptic plasticity rules, like Hebbian learning and spike-timing dependent plasticity (STDP)67,68, neural network architectures, including feedforward networks and recurrent neural networks (RNNs)69,70, probabilistic inference, such as Bayesian inference and Markov decision processes (MDPs)71,72, and attractor dynamics, and related dynamical models like Hopfield networks and continuous attractor neural network (CANNs)73,74. By combining these primitives in various ways, computational neuroscientists can develop testable hypotheses and gain insights into the underlying mechanisms of neural computation, from single neuron dynamics to large-scale network interactions65,66. Computational primitives can be phenomenologically predictive without being mechanistically biomimetic. A recurring open question is how predictive synthetic primitives can be across wide realms of distinct neural and behavioral data, instead of models that may individually predict certain experiments but must be changed to correspond to further data. One of the most commonly used synthetic computational primitives in computational neuroscience is backpropagation, a learning algorithm that trains artificial neural networks, particularly multi-layer perceptrons (MLPs)75, such as deep learning networks69, using gradient descent to minimize the difference between the network’s output and a desired output that must be separately provided to the network. Confusingly, the terms computational primitives and motifs are sometimes used interchangeably, to variously mean fundamental operations within computational models65,66, or to recurring structural patterns of connectivity or dynamics, such as feed-forward loops, recurrent loops, and central pattern generators76,77. Therefore, to clarify, what we term BCPs describe physiological computation: bottom-up mechanistic information-processing operations that arise directly from the physiological steps taken by cells within well-defined anatomical circuitry from distinct brain regions. We specifically posit that these operations combine to give rise to brain-based cognition, thus enabling the prediction of both information-processing and behavioral operations as well as the specific electrophysiological and biochemical mechanisms that directly underlie those operations. The surprising and non-trivial aspect of such simulations is that this fundamental background construction of the model has yielded extensive physiological phenomena, including specific spiking patterns, local field patterns, and cortico-striatal synchrony and phase-locking patterns, and these patterns were then seen to compare closely with those produced empirically by NHPs in response to seeing the same visual stimuli as the model does. Examples of these findings include (but are not limited to) : learning dependent synchrony changes (synchrony increases with learning, see Fig. 2d); stimulus-dependent synchrony changes (synchrony increases significantly more during the stimulus delay than when the stimulus is present, see Fig. 2d, right panels); and outcome-dependent synchrony changes (synchrony increases occur differentially on correct but not incorrect outcomes, Fig. 3a). One of the most powerful consequences of this BCP-based model is that its simulation identified a previously unknown class of neural signals, which were then independently verified using empirical NHP data. Termed “incongruent neurons” (ICNs), these cells’ early activity in the task predict an upcoming incorrect choice that occurs far later. Notably, ICNs correspond with very large local field potential (LFP) effects that show up prominently in NHP recordings of cortico-striatal synchrony (see Fig. 3a). Therefore, ICNs appear to be integral to a large-scale signaling system coordinating activity between the cortex and striatum. This predictive activity of ICNs is consistent with other contexts in which neural activity patterns in the brain were found to predict later motor decisions78–82, yet also are markedly distinct in that they predict error. ICNs predict an undesirable action that the animal is about to carry out; the animal is choosing to do something presumably against its own interest. What functions might ICNs play in predicting error? The NHP experimental subjects were not evolved merely to solve only this particular two-category task, nor was the simulation. Rather, the simulation was solely based on physiological computation as described. Quite different sets of environmental challenges may be presented (to the NHP or the simulation), containing multiple categories (and subcategories), establishing entirely distinct pairings of input types and response types. In this wider world, ICNs may play a functional role in avoiding local minima, adding flexibility or alternate choices to the organism’s decision-making mechanisms. For a specific instance, if say the contingencies for the choices are reversed, the ICNs may allow the organism to sample alternate choices and adapt to the new environment speedily. Ongoing work in reinforcement learning continues to address central questions of how predictive and retrospective information is neurally coded83; the discovery of neural ICN coding may help further our understanding. This incongruence among decision, intention, and valence offers a rich panoply of directions for future study. The goal of the work was not to accomplish complex arbitrary computational or cognitive operations at the outset, but rather to provide initial bridges spanning from “lower” physiology to “higher” behavior and cognition, across individual neurons and anatomically structured populations. The model therefore initially attacks a relatively limited task of category learning, with a restricted set of possible stimuli, all of which nonetheless are entirely novel to the model. There are many components of functioning brains that are initially absent from the simulation, testing the extent to which the implemented areas (cortex, striatum, pallidum, SNc, thalamus) and their interconnections could engage the category learning task in the absence of limbic and many other circuits. The simulation also is focused specifically on physiology rather than on biophysics: physiological phenomena are consistently replicable across multiple laboratories and researchers, whereas underlying biophysics still are largely hypothetical and in some cases differ very substantially across different models. Detailed ion channels and internal compartments in cell populations of different brain regions are being studied in upcoming versions of the simulation. One particular simplification in the present model is that of interneuron subtypes. Extensive evidence distinguishes interneurons by differing genetic markers, connectivity patterns, physiological activities, and functional roles42,84, yet the complexity of these diverse cell types is still in the process of being addressed in the literature. For instance, the differing functions of feedback vs. feedforward inhibition are often linked with genetic markers: cells that are positive for parvalbumin (PV) or somatostatin (SOM) exhibit regional specificity42, cortical layer specificity84–86, and possible distinct cognitive roles87,88. Yet although local feedback inhibition is often thought to be carried out by PV basket cells, which form reciprocal connections with pyramidal cells in cortical layers II/III, other studies strongly suggest feedback inhibition to be performed by SOM cells86. Other work suggests SOM martinotti cells to cause feedforward inhibition42,84. We have thus far implemented two distinct simplified populations of feedforward and feedback inhibitory neurons; ongoing work aims to incorporate far more cell type diversity into the models. The model presented here takes a first step toward a consistent end-to-end explanatory account of organism-level behaviors simultaneously with spiking and inter-area interactions, during learning among multiple cortical and subcortical regions, consistent with real electrophysiological measures. The model was intended to incorporate extensive details both of anatomical wiring, and of physiological activity, which is ambitious, but nonetheless the model was also intended to be just a starting point for observation of such systems. Importantly absent from the approach is the existence of any statistical learning to ‘match’ mined data. The simulation as presented accomplishes these initial aims, and moreover predicts a phenomenon that had been previously unknown, and unexpected. Finally, we emphasize the broader point that these unexpected findings emerged directly from sheer simulation of physiological operations occurring in anatomical circuit designs. The resulting “physiological computation” in the present work stands in contrast to standard approaches in neural networks such as gradient-descent systems. Those systems are presented with data that the system is intended to statistically capture, so that corresponding data can be reproduced. The present model is not presented with any such data. It instead merely produces simulated physiological activity. There is no target data to attempt to curve-fit to. Rather, the system’s parameters (such as weights, synaptic change rates, etc.), were not determined through data fitting of any kind, nor on pre-existing formal models such as recurrent or dynamical systems. The model’s emergent behavior is solely based on data from the literature about neurons, their anatomical circuit layouts, physiological activity rules, and synaptic plasticity rules. The simulation is simply presented with the visual dot-pattern stimuli of the task, which then produces physiological responses. Some of these physiological responses result in synaptic change within the model, and those changes to synapses can cause the model’s behavior to change. It is those behavioral changes, resulting from internal synaptic change, that cause the model to incrementally alter its behavior in response to the stimuli. While much computational work focuses on the statistical learning of specific data, and the use of mathematical models of recurrence or dynamics to fit various empirical parameters, the present work instead attempts to uncover how low-level physiological spiking, embedded in specific delimited sets of anatomical wiring organizations, can itself give rise to the forms of neural and behavioral results that brains produce. As a result, the simulation does not just learn in a way that is specific to a particular set of stimuli or demands, but rather generates a broad range of functions that encompass the phenomenological realms of perceptual categorization, reinforcement learning, decision-making, action selection, working memory, and category learning, as well as extensive neural patterns of spiking, field potentials, synchrony, phase-locking, and changes to these physiological patterns that occur with synaptic change. The breadth and depth of the findings from this physiological computation model are powerful evidence of its utility in the analysis of existing data, and are suggestive of its potential applicability to a broad range of challenging questions from the neurobiological bases of behaviors and associated disorders linked to predictive coding and reinforcement learning. Methods We describe the corticostriatal circuit from mechanistic to emergent scales. We begin with a detailed model description at the neuronal and assembly levels. We then provide details on how corticostriatal decision-making proceeds from synaptic plasticity, e.g., how the neurons are continually modified to proceed with learning. We then provide details for our computational methods, the experimental task design, the simulation protocol, and how we analyze the model’s physiological response. See the Supplementary Material Methods section for additional information regarding the model’s construction, parameter values, and references. Detailed model description Extensive anatomical and physiological features incorporated into the present simulation A sizeable body of references was used in the conception and construction of the several subcircuits and neural assemblies that constitute the present brain circuit simulation (Table 1, Fig. 1d); these consist of attributes that are highly cited in the literature. For list of key publications for each computational primitive, see Table S1 in Supplementary Material. Spiking neurons and synaptic connections Neuronal Dynamics Each neuron is modeled using ionic conductance based point neuron models following the Hodgkin–Huxley formalism89. For simplicity, in this model we consider only voltage gated Sodium and Potassium channels. The membrane potential is described by: where Iin is the input current, which can either be external stimulus or background activity, and Isyn is the synaptic input. Sodium current INa=ḡNam3h(V−VNa) and potassium current IK=ḡKn4(V−VK) are driven by gating variables {m, h, n} whose dynamics are governed by the general form : Here, χ is the gating variable and ϕχ is the temperature related effect on the time scale. See Methods section in Supplementary Material for parameter values. Synapse Synaptic current in Eq. (1) for a neuron i is the sum of synaptic inputs from all incoming axons {j} viz. Isyni=∑jIsynij. Synaptic current from neuron j to neuron i is given by where Wij is the synaptic weight from neuron j to i, a quantity which estimates density of dendritic spines and is modified by Long Term Potentiation (LTP) and Long Term Depression (LTD, see Eq. (28),(30)). The synaptic conductance gsynj is a function of spiking activity of the presynaptic neuron, and therefore is one of the state variables for each neuron whose dynamics is described by damped oscillator equation: which is driven by impulse force g∞(V) defined as follows90 See Methods section in Supplementary Material for parameter values. Brain regions modeled as cell assemblies The schematic of the overall circuit is shown in Fig. 1. Most of the brain areas shown in the circuit have been modeled as cell assemblies of sparsely connected spiking neurons, where each region has its own specific internal structure and neuronal types comprising them. These structures and neuronal types are derived from the well known anatomical and physiological literature. Below are the specific structures these brain areas modeled here. Cortical areas Superficial layers of cortical regions in this model (cortical blocks) comprise large number of local feedback lateral-inhibition circuits (L-FLIC). Each L-FLIC circuit (see Fig. 1a), comprises five excitatory neurons sending synapses to one feedback inhibitory neuron while the inhibitory neuron sends synapses back to the 5 excitatory neurons. The L-FLIC circuits are connected to each other through synapses between the excitatory neurons. We have set the connection density such that each excitatory neuron is connected to 1 excitatory neuron from the same cortical block. Within each cortical block, we have 1 feed-forward inhibitory neuron which recieves input from excitatory neurons of other cortical regions and sends inhibitory synapses to excitatory neurons of the same cortical block. These feed-forward neurons also receive modulatory inputs from various Brainstem nuclei forming the Ascending Reticular Activating System91. The rhythmic bursting of feed-forward inhibitory neurons causes the rhythmic bursting of the excitatory neurons and which in turn sets the dominant rhythm in the cortical region. There are two cortical blocks in this simplified model: the Simple Visual Cortical Region (SVCR) and the Anterior Cortex (AC). The SVCR consists of 45 L-FLIC circuits comprising (45 × 5 =) 225 excitatory ‘target’ neurons which receive the stimulus dot patters in the form of input current Iin. The visual stimulus consists of (15 × 15=) 225 pixels (see Fig. S6) which are mapped directly onto the 225 visual area neurons, where the Iin for each neuron is proportional to gray scale value of the corresponding pixel. The anterior cortex (AC) is comprised of 20 L-FLIC circuits, hence (20 × 5=) 100 target excitatory cells. The connections between the SVCR and the AC are such that every neuron has equal number of outgoing and incoming synaptic connections; the resulting hypergeometric connectome37 ensures the absence of “hot” or “cold” neurons, i.e., cells differently capable of activity due solely to their afferent wiring. Such connectivity is supported by empirical evidence92–94. Every SVCR neuron makes an outgoing synapse with 8 out of 100 AC neurons, while each AC neuron receives incoming synapses from 18 out of 225 SVCR neurons, thus the connection probability for cortico-cortical connection is 8%95. It may be useful to also note that the particular cortical inhibitory feedback mechanism (L-FLIC) is inherently capable of learning multiple categories, not just two as done in this task. The number of categories is partially limited by the number of superficial-layer cells within a cortical cell assembly (containing multiple L-FLIC circuit assemblies), which number in the hundreds of thousands. In this lateral inhibition mechanism as described earlier in the text, the subset of cells that are active are the strongest responders to the specific pattern of activity across input axons for a given stimulus. The strongest responders for a given stimulus category will selectively respond to the axon activation patterns that are most similar to each other. Thus we emphasize that the L-FLIC circuitry is not at all limiting the number of categories to which the model can respond and encode. Striatum For the striatal-pallidal projection system, we model two blocks (’L’ and ’R’, say) for each of the downstream brain regions in the loop, viz. Striatum, GPi, GPe, STN, and Thalamus. Each block in one region connects with the corresponding block in the other region viz. L(R) block of one region connects to L(R) block of another region, thus representing the topographic connections. These two streams of connection correspond to the two choices of response actions (in this case left or right saccade). The Striatum has three components: Matrisomes (matrix) and Striosomes (patch) medium spiny neurons (MSNs) that are GABAergic, and the tonically active neurons (TANs) that are cholinergic. These three form a striatal complex57, which is supposed to play a vital role in reward-based action selection96. We modeled these components along with SNc as simplified physiologically-derived “rules” defining their input/output behavior (see following subsection, Eq. (11),(14),(16),(18)). Modeling MSNs, TANs and SNc as input/output elements is well supported by extensive studies dendritic arbors49, relating synaptic input characteristics and output spiking characteristics56. Multiple physiological mechanisms have been proposed to incorporate active dendrites and ion channel dynamics into input/output computational units50–54. Furthermore, we also modeled two blocks of matrisome as spiking neuronal assemblies (L-STR and R-STR) to capture the temporal and spectral properties of the striatal data from the experiments. We can understand the spiking neuronal assemblies as a subset within the larger population of MSNs which are modeled as input/output blocks. We also model a single TAN spiking neuron which provides modulatory input to MSNs. Each matrisomal block consists of single layer of 25 inhibitory neurons, where each neuron gets incoming synapses from 4 AC neurons. These neurons also get sub-threshold excitation from a TAN neuron. Since it was experimentally observed that TAN neurons are phase-locked with the striatal LFPs97,98, we propose that the striatal rhythm is modulated by rhythmic bursting of TANs. TAN neurons in turn get the rhythmic input from Intralaminar Thalamic Nuclei. GPe Two blocks of single-layer assemblies of inhibitory neurons, 15 neurons in each block. Each neuron is connected to 1 striatal neuron of the corresponding block in striatum (topographic connections). Each GPe neuron is connected to 1 GPi neuron of corresponding block. STN Two blocks of single-layer assemblies of excitatory neurons, 15 neurons in each block. Each neuron is connected to 1 GPe neuron of corresponding block in GPe (topographic connections). Each STN neuron is connected to 1 GPi neuron of corresponding block. GPi Two blocks of single-layer assemblies of inhibitory neurons, 25 neurons in each block. Each neuron is connected to 1 striatal neuron of corresponding block. Thalamus Two blocks of single-layer assemblies of excitatory neurons, 25 neurons in each block. Each neuron is connected to 1 GPi neuron of the corresponding block. Thalamic neurons project back to AC target neurons thus completing the loop (see Fig. 1). Each AC neuron gets input from 16 thalamic neurons i.e., eight neurons from each thalamic block. Ascending systems and intralaminar thalamic nuclei The simulated ascending system (ASC1) is an extreme simplification of ascending systems such as the cholinergic basal forebrain and noradrenergic locus coeruleus; it produces rhythmic activity via a neural mass model. That activity becomes simulated modulatory input to cortex, driving a beta rhythm in the cortex99. The ASC1 simulation thus functions as a central pattern generator. It has been modeled using a simple ‘Next Generation’ neural mass model46,47 which is a mean field approximation of a network of rhythmic neurons. A single neural mass representing an ascending system nucleus comprises a synaptically coupled population of excitatory (E) and inhibitory (I) neurons. Their collective activity is defined by the complex valued Kuramoto order parameter Ze and Zi respectively, while their synaptic interaction is measured by synaptic conductivities gee, gei, gie and gii such that gab is the synaptic conductivity from population b to population a, where a, b ∈ {E, I}. The dynamics is described as : where and the population firing rate f is given by The firing rate f(Ze) of population E directly affects the modulation of the target neurons, in the form of an input current to the target neurons such that Imod = kLCf(Ze). In this simulation, those targets are simulated somatostatin feed-forward inhibitory cortical neurons. See Methods section in Supplementary Material for parameter values. Corticostriatal decision making and synaptic plasticity The spatio-temporal spiking patterns in the above described cortico-striatal-thalamic-cortico (CSTC) circuit have been simulated by modeling the interconnected cortical and subcortical regions as synaptic networks of neuronal assemblies, each comprising spiking neurons of Hodgkin–Huxley type (as described above). Now we describe the set of mechanisms through which these spatio-temporal firing patterns generate the learning driven behavior (response choice) and feedback driven synaptic plasticity (and thus category learning). Although these equations describe our proposed mechanisms for corticostriatal computation at a much coarseer scale of length and time compared to the physiological scales of spiking neurons and neuroreceptors, they are nevertheless based on well-known physiological and anatomical principles found across the literature. In principle, all of the following mechanisms can be entirely modeled using only the physiological phenomena at the neuronal length and time scales. However, in this initial rendition of the model we have implemented reasonably simplified population level abstractions of these well defined physiological mechanisms and anatomical constraints. The model is entirely summarized in Table 2. Following is the detailed description of the model components. Table 2Model EquationsGeneral formSpecific formStriosome (patch) activityρxpat(t,Δt)=PAT∑i∈CtxWxi(t)⋅Sit−Δtt−LI∑y≠xρymatρxpat(tn)=Hx(tn)∑i∈CtxWxi(tn)⋅Sitn−1tn∣x∈{1,2}ρxpat(t,Δt) : striosome spiking activity in striatal block xHx(tn)=Θ(ρxmat(tn−1)−ρymat(tn−1))n>21n≤2LI : Lateral inhibition by other striatal areas(x, y) ∈ {(1, 2), (2, 1)}TAN activityRTAN(t)=Inhibition∑xρxpat(t,Δt)κTANRTAN(tn)=κTAN,n=1minκTANλTAN∑xρxpat(tn−1),κTAN,n>1κTAN = 100, λTAN = 1Matrisome (matrix) activityρxmat(t,Δt)=MAT∑i∈CtxWxi(t)⋅Sit−Δtt+TAN(RTAN)−LI∑y∈Nρymat(t,Δt)y≠xρxmat(tn)=Hx(tn)∑i∈CtxWxi(tn)⋅Sitn−1tn+Pois(RTAN(tn))ρymat(t,Δt) : matrisome spiking activity in striatal block yPois(λ) : Poisson random variable of mean λSNc activityRDA(t)=Inhibition∑xρxpat(t,Δt)κDARDA(tn)=κDA,n=1minκDAλDA∑xρxpat(tn−1),κDA,n>1κDA = 1, λDA = 0.33Action selection and reward feedbackA=actioniρimat(tr)=max{ρ1mat(tr),ρ2mat(tr)…}A=leftsaccade∣ρ1mat(tr)>0rightsaccade∣ρ2mat(tr)>0F(A)=reward∣A:correctpunishment/noreward∣A:incorrectF(A)=1∣A:correct0∣A:incorrectDA release at corticostriatal synapsesDASNc=∫t0tfRDA(t)dt+DAfbDASNc=∑nRDA(tn)+DAfb≈DA¯+RDA(t2)−κDA+DAfbDAfb:DAfbF(A)DAfb=θrew∣F(A)=10∣F(A)=0DASNc as a measure of ’Prediction Error’DASNc=DA¯+ϵ∣ϵ:predictionerrorϵ=R−Q∣R:reward,Q:expectationR=[DA]fb,Q=κDA−RDA(t2)Corticostriatal synaptic plasticitydWijdt=FionSi,Sj⋅FDADASNc−Γdec(Wij)ΔWxi=Hx⋅Si⋅FDADASNc−DA¯−γWxix∈{strblocks}Fion: ionotropic receptor factor, Si: activity of neuron iFDA(y)=KDA⋅y⋅(y+θM)⋅σ′(α(y+θM))FDA: DA receptor factory=DASNc−DA¯=ϵ,σ′(x)=11+e−x⋅11+exΓdec: synaptic decayKDA = 0.04, α = 2.5, γ = 0.01, θM = 1.0Cortico-cortical & thalamo-cortical plasticitydWijdt=FionSi,Sj−FrevDAVTAΔWij=KionSi⋅Sj⋅(W¯−Wij)⋅FAFrev: LTP reversal as function of DA from VTAcortico-cortical : Kion = 5 × 10−4, W¯=5thalamo-cortical : Kion = 1.7 × 10−5, W¯=6Thalamo-cortical short-term synaptic augmentationSynaptic CurrentConductance DynamicsIsynij=gstpi(t)⋅Wij⋅gsynj(t)(Vi−Vsynj)dgstpdt=−1τ3gstp+z⋅kstp(Ḡstp−gstp)dzdt=−1τ1z+g∞(V)τ3 = 2000ms, τ1 = 0.1ms, kstp = 0.5, Ḡstp=0.5 Model Equations Population activity in STR and SNc There are four key sub-populations of subcortical regions: matrisome (matrix), striosome (patch) and tANs in the striatum and dopaminergic neurons of substantia nigra pars compacta (SNc). We consider one sub-population each for TANs and SNc and two competing sub-populations each for matrisome and striosome, respectively part of the two corticostriatal loops described in the circuit model. Since matrix and patch neurons are GABAergic neurons with relatively longer time scales (~80 ms), their firings have a cumulative effect over a given time interval. Hence for the striosome and matrisome we consider their cumulative spiking activities ρstr and ρmat, respectively. For dopaminergic SNc neurons and cholinergic TANs on the other hand, we consider their instantaneous firing rates RTAN and RDA respectively. Note that substantia nigra pars reticulata (SNr) is intentionally absent for this initial model. The SNr is predominantly an inhibitory output stage of the striatal complex, as are the pallidal structures (GPe, GPi), and it is possible that there may be some relationships among their functions, as well as some possible non-overlapping functions100. In both cases, lesions to SNr and to pallidal outputs tend to lead to change in spontaneous locomotion, abnormal limb movements, and difficulties with skilled motor tasks101. These lesion-based changes tend to be in opposite directions (SNr lesions tend to increase motor activity; GP lesions tend to impair activity), as would be expected by the anatomical circuitry: GP inhibits SNr, which in turn is an inhibitory output stage projecting to thalamus and to brainstem102. Striosome activity Striosome ("patch”) sub-population is driven by spatio-temporal spiking input from cortex, AC in this case, and is laterally inhibited by matrisomes ("matrix”) of the competing sub-population. The cumulative spiking activity ρxpat in the striosome sub-population x at time t over interval Δt is given by where, PAT is a generic function with cortical neuronal activity as input and striosomal ("patch") activity as output. Here cortical input is represented by [Si]t−Δtt that is the number of spikes occurring in AC neuron i during interval [t − Δt, t] and Wxi(t) is synaptic weight for the synapse(s) from AC neuron i to striatal sub-population x (including both patch and matrix). The lateral inhibition function LI represents the inhibitory inputs coming from all other areas of the striatum. For the sake of simplicity, in this paper we used discrete time maps for population activity instead of above described continuous dynamics : t ⇒ tn where tn = t0 + n ⋅ Δtinh. Here t0 is the time of stimulus onset and interval Δtinh is the time duration of GABAergic inhibition. The discretized form for cumulative striosomal activity (Eq. (11)) is given by and the simplified form for used for lateral inhibition between two striatal regions modeled here is given by where Θ is the Heaviside function and ρxmat is the cumulative spiking activity of matriosome ("matrix") subpopulation x (see below). TAN activity TANs are driven by intralaminar regions of the thalamus, and are inhibited by all striosomal sub-populations. The firing rate RTAN can be generally described by: where, κTAN is the baseline activity of TAN neurons and Inhibiton(ρ∣κ) is a monotonically decreasing function of the cumulative spiking activity ρ of the source population, given the baseline spiking activity of the target population is κ. The specific discrete form for TAN activity (Eq. (14)) we used here is given by Matrisome activity Matrisome sub-populations receive similar inputs as corresponding striosome sub-populations, with an additional modulatory input from TANs. Hence the cumulative spiking activity in the matrisome (matrix) sub-population x over interval Δt at time t is given by where, MAT is a generic function like PAT but for the matrisome, with cortical neuronal activity as input and matrisomal (patch) activity as output and TAN is the contribution to matrisomal activity from ACh modulatory inputs from the TAN neurons. The discrete form of Eq. (16) used in this work is as follows where Pois(λ) generates a random value from Poisson distribution with mean λ. Note that we have not yet included many of the forms of inhibition that occur in these structures, including presynaptic inhibition among striatal neurons103. The existing lateral inhibition between segments of the striatal complex (Eq. (11),(16)) may be producing some of the effects that otherwise would arise from presynaptic inhibition; this is not known and will be studied as these features are incorporated in the new versions of the model. Dopaminergic SNc activity DA neurons in the SNc, like TANs, are inhibited by GABAergic input from striosomal sub-populations. Their activity can be generally described by where, κDA is the baseline activity of DA neurons in SNc. The specific discretized form for Eq. (18) used in this work is given by Action selection and reward feedback Due to lateral inhibition between striatal sub-populations, one sub-population tends to dominate while others become suppressed. Thus, during a single trial with a given stimulus, only one of the striatal sub-populations consistently remains active, which then activates specific downstream circuits corresponding to a specific response. Thus the response action A is chosen at the response time tr by The specific form of selected action is After the response, a simplified feedback F is provided in the form of reward or punishment depending on the correctness of choice and for this specific case, reward is determined by DA release at corticostriatal synapses The cumulative amount of dopamine released at the corticostriatal synapses by SNc neurons over the course of a single trial, i.e. from stimulus onset until feedback reward, is given by where, t0 is stimulus onset time, tf is the time of reward feedback and DAfbF is the amount of DA released due to reward feedback F which is a function of response action A The specific discretized form of Eq. (24) used for this work is as follows where, [DA¯] is the baseline DA release in the absence of any striosomal inhibition of SNc. The strongest suppression of DA neurons from baseline activity as a result of striosomal inhibition occurs at time t2, since for t > t2 the lateral inhibition within STR sub-populations suppresses most of the striosomal activity, bringing SNc activity back to baseline. Thus the approximation in Eq. (25) is justified. In this specific case, DA released as a result of feedback is given by: Since the total amount of DA released during a trial directly affects the corticostriatal synaptic plasticity, and thus affects learning, it can also be expressed in a traditional reinforcement learning framework in terms of value prediction error: where, error prediction ϵ=R−Q such that the reward is R=DAfbF and the expected reward is Q=κDA−RDA(t2) Corticostriatal synaptic plasticity Synaptic plasticity on striatal medium spiny neurons (MSNs) follows a set of rules corresponding to the literature on plasticity in basal ganglia104. A large body of experimental literature indicate three factors involved in the LTP/LTD of corticostriatal synapses105: phasic increase in DA release; presynaptic activity; and postsynaptic depolarization. Here in this model we also consider the synaptic decay of corticostriatal synapses. The general form of corticostriatal change is described as : where, Fion is the synaptic weight change as a function of pre- and post-synaptic activity of cortical and striatal neurons Sj and Si respectively, while FDA is the D1/D2 receptor factor as a function of the DA from SNc and Γdec is the synaptic decay. The simplified specific form of Eq. (28) implemented here is given by where Hx determines the state of activity in striatal block x (see Eq. 13b) and Si determines the activity in cortical neuron i. In this simplified form, the activity of the postsynaptic striatal neurons is summarized in the activity state Hx, since the striatal MSN populations are modeled as input/output blocks (Eq. (11),(16)) The specific form of FDA is derived from the experimental literature whose qualitative behavior is summarized in105. Due to its qualitative similarity with the BCM curve for synaptic plasticity106,107, even though it explains a completely different set of phenomena, we defined our FDA with the same mathematical form as FDA(y)=KDA⋅y⋅(y+θM)⋅σ′(α(y+θM)) where y=DASNc−DA¯=ϵ (error prediction). Here the sigmoidal function is defined as σ(x)=11+e−x. Due to the specific form of the BCM function, it allows both LTP and LTD, depending on the value of the prediction error as quantified by the DA release (see Eq. (27)) Cortico-cortical and thalamo-cortical synaptic plasticity In the simulation, specific rules of synaptic potentiation, and reversal of that potentiation, are adopted for synapses in superficial-layer anterior cortical cells, corresponding to consistently replicated studies from the plasticity literature108–110. Changes in synaptic weights W from cortical cell i to j are described first in general form, illustrating the proposed set of mechanisms to be studied, and then in highly specific form showing a very limited special case of the general form, currently implemented in simulations. The general form of synaptic change modeled here in is: where Fion and Frev are increments and decrements to synaptic weights; Si and Sj are the number of spikes from cortical source cells j and targets i, and DVTA is the quantity of DA released from the Ventral Tegmental Area (VTA) onto the cortical targets. Frev is a function erasing the increment of all recently incremented synapses. Having identified physiological-level systems mechanisms for potentiation and reversal, the effects of the general form can be substantially simplified for initial incorporation into a simulation. In the currently implemented model, these general forms are implemented as special cases, such that the change to a cortical weight from cell j to cell i is: where Kion is constant and W¯ is the maximum value that a weight can attain, while F(A) is a feedback function of the response such that thus capturing the effects of potentiation on correct trials and lack of potentiation on incorrect trials. We apply the same plasticity model for thalamo-cortical synapses as well. Short-term augmentation of thalamo-cortical synapses: mechanism for sustained activity In addition of long term plasticity in the thalamo-cortical synapses explained above, there is an additional short term synaptic augmentation that has been studied in the literature111,112. This short-term augmentation of time scales ranging from few milliseconds to few seconds is caused by several factors, e.g., the stimulus frequencies and behavioral states of cortical neurons. This short-term synaptic facilitation/augmentation has also been suggested as a mechanism for working memory through persistent reverberation of spiking activity113. The various molecular mechanisms underlying various types of short-term synaptic augmentation include presynaptic residual calcium114 and perturbation in postsynaptic firing115. In our model this short term thalamo-cortical augmentation serves two purposes : (1) to sustain the spiking activity in the circuit even after offset of stimulus and (2) to hold the pre-offset spatial firing pattern in the anterior cortex ("AC”) intact even during the delay epoch after the offset : the “holding” memory116. Thus, post stimulus offset, instead of only the spiking activity within the circuit, is sustained but also the “memory” of the stimulus encoded in the spatial firing pattern in the AC is sustained. This requires a mechanism which augments the thalamo-cortical synapses based on the recent firing of post-synaptic cortical neurons such that the neurons firing during stimulus would be more susceptible to the thalamic excitation even after stimulus offset. We implement this by introducing an extra factor in thalamo-cortical synaptic conductance : gstpi, for a synapse from thalamic neuron j onto the cortical neuron i. The synaptic Equation (3) gets modified for thalamo-cortical connections as: where gstpi, as in the case of synaptic conductance gsyn (see Equations (4)), increases due to spiking of neuron i: where τ3 is the decay constant and Ḡstp is the asymptotic value (upper bound) of gstp. The intermediate variable z is the same in equations (4) and (33). The equations governing the activity in different kinds of neurons is resummarized in Table 2. Computational methods One of the practical difficulties in multi-scale computational neuroscience has been the limitation due to the tension between model flexibility and simulation speed. Other multi-scale models have been developed based on extensive knowledge of basic physiological and anatomical characteristics of the brain. Existing models can be broadly understood as primarily optimized for cellular-scale mechanisms, such as NEURON117, NEST118, Brian119, Emergent62, and SPAUN26; or optimized for multi-scale emergent dynamics like The Virtual Brain120. These platforms present challenges when attempting to produce multi-scale models that span from individual neurons to the whole-brain; with the exception of SPAUN and Emergent, they are also not typically constructed to generate extended cognitive operations such as the behavioral perception, learning, working-memory, and decision task presented herein. To bridge this gap, we developed Neuroblox, a computational neuroscience platform optimized for data-driven multi-scale brain modeling (see Methods section in Supplementary Material for further details). Previous modeling efforts to create more realistic and detailed multi-scale biomimetic models have been hindered by the computational intractability of solving massive sets of differential equations. Neuroblox uses the Julia programming language and a variety of computational and mathematical algorithms that lead to orders of magnitude speedups, allowing for hundreds of complex neurons to be simulated in almost real-time. Our computational models are openly available, as stand-alone implementation (github.com/Neuroblox/corticostriatal-circuit-notebook) and also as a model designed in Neuroblox.jl (see https://www.neuroblox.ai/). Neuroblox can be used interactively via a graphical user interface. Experimental task design The category learning task and the corresponding neurophysiological recording with adult rhesus macaques (non-human primates, NHPs), on which we specifically model our simulations, is described in detail in refs. 27,28 which we summarize here. The animals were taken care of in accordance with the National Institutes of Health guidelines and the policies of the Massachusetts Institute of Technology Committee for Animal Care. A single category learning session consists of 600–800 trials where, in each trial, initially the animal has to fixate on a central target onscreen. While fixating, a randomly chosen category exemplar appears on the screen for 600 ms. Each exemplar is a constellation of seven dots derived from either of the two category prototypes (called “A” and “B”) with small random variations. The dots are presented for 0.6 s, removed for 1 s (requiring a form of working memory), and then a decision is made. For the NHPs, the decision was in the form of a saccade to the left (for A) or right (for B) and correct decisions were rewarded with juice. This is summarized in Fig. S6a, b. The exemplar epoch (stimulus on) is followed by 1000 ms of delay epoch (stimulus off) in which the animal again fixates on the center and waits for the response cue, after which two saccade targets appear on the left and right of center, each corresponding to one of the categories. The animal responds with a direct saccade to one of the targets indicating the correct category of the exemplar, thus receives a reward (juice drops) on correct response and no reward for incorrect response. The exemplar set for each category is gradually increased starting from 1 for each category, and is doubled in size after each bock of trials. Each block of trials is over once the accuracy of the animal reaches atleast 80% over last 20 trials of that block, after which th next block begins with doubled set of exemplars. Based on this demarcation, first two blocks (100–150 trials) while trials from block 6 onward are considered late learning stage. For every session, a new set of category prototype patterns are used. Simulation protocol We simulated the category learning trial sessions as performed in the NHPs on our corticostriatal model. The set of random dot pattern stimuli as used in the experiments were also was used in the simulation as the input. Since the visual area in this model does not represent the primary visual area, but some higher area in the hierarchy of visual processing, we added a spatial filter to the dot patterns that approximate the gaussian smoothing as follows. The images are generated in gray-scale with total (15 x 15=) 225 pixels, where each pixel has brightness value within [0, 1] (0: black, 1: white). For each pixel (i, j) corresponding to the dot location, the brightness value is 1. For the four adjacent pixels (i − 1, j), (i + 1, j), (i, j − 1), (i, j + 1), brightness value is 0.6. For all other pixels, brightness is 0. As mentioned in the model description, the pixels map one-to-one on the simulated visual area cortical units, where each unit (neuron) receives a steady input current proportional to the brightness value of corresponding pixel. In accordance with the experiments, each trial was simulated for 1600 ms, in which the stimulus onset is between 0–600 ms, while during 600–1600 ms there is no visual input. At the end of 1600 ms the circuit model output determines the action choice, and based on the outcome a reward feedback is instantaneously fed into the model (see Model Description above). The synaptic weights are discretely updated after the reward feedback depending on the spatio-temporal spiking patterns within the circuit and the level of dopamine release from SNc and VTA respectively during the trial interval.The next trial cycle begins with the onset of the next visual stimulus. Right from the first trial onwards the stimuli are chosen from either of the two categories randomly out of the entire set, as opposed to gradual doubling of the stimulus set in the experiments (see ref. 28). For simulations we ran each session for 700 trials, matching the average number of trials in the experiments. We simulated 32 learning sessions to obtain the main results in this paper, where in each session we used one out of eight pairs of prototypes to generate the exemplar dot patterns. Each prototype had about 1000 exemplars. It should be noted that the training regimens are not quite the same: the animal training incorporated i) extensive initial shaping and pilot training, absent from the simulation; and ii) graded introduction of training instances such that initially only single category deformations were shown, and others added subsequently. Since we do not have the trials grouped into blocks based on the size of stimulus samples, we define early and late trials based on their learning behavior. For simplicity, we kept the group size of early and late trials equal for all simulated sessions viz. 1–150 trials were grouped as early trials and 500–700 trials were grouped as late trials, such that for all the sessions the early trials showed average accuracy below 60% and late trials showed average accuracy above 80%. Analysis of model physiological response Field estimate There are several models that estimate local field potentials (LFP) from simulated spiking model in which the excitatory post synaptic potentials (EPSPs) are convolved with spatial filters121. For this model, however, we wanted a quicker and computationally less complex method to approximate the LFPs to capture the qualitative behavior of the observed LFPs, particularly the synchrony effects. We are primarily interested in i) relating individual cell responses to LFPs, and ii) measuring the synchrony and phase relations among fields, across areas. We obtain a very simple neural mass activity from the spiking activities of various blocks in the model simulating specific brain regions, viz. Local Spike Summation (LSS), which is simply the spike histogram. where, Tjm is the mth spike-time for jth neuron while neuron j belongs to a specific block (brain region such as AC, STR etc.). For all PLV analyses of LSS, we used time bin Δt = 1ms. For rastor plot representations in Figs. 2 and 3 we used Δt = 20 ms. We also calculate Average Local Membrane Potential (ALMP) as an alternate surrogate for local field: ALMP(t)=1N∑iVi(t) where N is the neuronal population size and Vi(t) is membrane potential of neuron i. We devised the LSS as a surrogate, since the input (EPSPs) of the cells directly correspond to the output of the neighboring population. For calculation of Phase Locking Values used to determine synchrony, see the Supplementary Materials. Acquisition of incongruent neurons (ICNs) Incongruent neurons, in both simulations as well as empirical data, were identified during late learning trials as those units (neurons) that were selectively most responsive in the 0–200 ms window of stimulus onset during the trials with resultant incorrect outcomes in either of the stimulus categories (A-incorrect and B-incorrect). For testing the predictive capability of incongruent neurons to anticipate incorrect outcomes, we used the first half of late trials for the acquisition of incongruent neurons (acquisition trials) and the second half of late trials for measuring the predictive effect (application trials). Acquisition was done as follows. In order to determine the condition specific preference of single units (neurons) based on their average spiking behavior (as shown in Fig. 4a), for each unit (represented by a single row in Fig. 4a), we first determine the spiking activity Sti for each unit i in response to the respective stimulus of each trial t. Sti is the number of spikes occurring in unit i during a specific time interval (0–200 ms of stimulus onset) for trial t. (A notable distinction is the smaller number of average spikes produced in the NHPs compared to the simulation: 1.33 ± 0.05 spikes in 200 ms empirically vs. 9.52 ± 0.18 spikes per 200 ms in the simulation.) In order to determine the condition specific preference of single units (neurons) based on their average spiking behavior (as shown in Fig. 4a), for each unit (represented by a single row in Fig. 4a), we first determine the spiking activity Sti for each unit i in response to the respective stimulus of each trial t. Sti is the number of spikes occurring in unit i during a specific time interval (0–200 ms of stimulus onset) for trial t. (A notable distinction is the smaller number of average spikes produced in the NHPs compared to the simulation: 1.33 ± 0.05 spikes in 200 ms empirically vs. 9.52 ± 0.18 spikes per 200 ms in the simulation.) We then calculate normalized spiking activity Nti of each unit at a given trial t as: Nti=Sti∑iSti, which normalizes the global effects that are unrelated to stimuli but cause trial to trial variation of spiking activity. We then calculate normalized spiking activity Nti of each unit at a given trial t as: Nti=Sti∑iSti, which normalizes the global effects that are unrelated to stimuli but cause trial to trial variation of spiking activity. We sort the acquisition learning trials (first half of late trials) into four conditions based on stimulus category (A vs B) and outcome (correct vs incorrect) viz. A-correct (C1), A-incorrect (C2), B-correct (C3) and B-incorrect (C4). We then calculate the average normalized activity NCi for each unit i over group of trials corresponding to each condition C where C ∈ {C1, C2, C3, C4}, using NCi=⟨Nti⟩t∈C. We sort the acquisition learning trials (first half of late trials) into four conditions based on stimulus category (A vs B) and outcome (correct vs incorrect) viz. A-correct (C1), A-incorrect (C2), B-correct (C3) and B-incorrect (C4). We then calculate the average normalized activity NCi for each unit i over group of trials corresponding to each condition C where C ∈ {C1, C2, C3, C4}, using NCi=⟨Nti⟩t∈C. In order to sort the neurons based on their preferred condition, we determine the maximum values of NCi for each unit i and we do a second normalization of average normalized activity NCi by its maximum.35N¯Ci=NCimaxNC1i,NC2i,NC3i,NC4iIf NC is the set of neurons that prefer condition C, we will have N¯Ci=1∀i∈NC. In order to sort the neurons based on their preferred condition, we determine the maximum values of NCi for each unit i and we do a second normalization of average normalized activity NCi by its maximum.35N¯Ci=NCimaxNC1i,NC2i,NC3i,NC4iIf NC is the set of neurons that prefer condition C, we will have N¯Ci=1∀i∈NC. Incongruent neurons (ICNs) are the units that prefer conditions C2 and C4 (A-incorrect and B-incorrect), viz. : ICN≡{NC2,NC4} Incongruent neurons (ICNs) are the units that prefer conditions C2 and C4 (A-incorrect and B-incorrect), viz. : ICN≡{NC2,NC4} For empirical data we used an extra clean up step before the identification of incongruent neurons. We had only two criteria : (1) Reject sessions that have insufficient sample size of incorrect trials during the acquisition (≥4 A and B incorrect trials), and (2) Reject the neurons which have too sparse spiking activity throughout acquisition (neurons with Nti<0.05 for more than 75% of trials) For empirical data we used an extra clean up step before the identification of incongruent neurons. We had only two criteria : (1) Reject sessions that have insufficient sample size of incorrect trials during the acquisition (≥4 A and B incorrect trials), and (2) Reject the neurons which have too sparse spiking activity throughout acquisition (neurons with Nti<0.05 for more than 75% of trials) Testing of incongruent neurons (ICNs) We established the predictive significance of empirical as well as simulated incongruent neurons as follows. After identifying ICNs in the acquisition trials, it was essential to test the statistical significance of predictive accuracy of incorrect choices in the subsequent set of trials, which we called application trials. We hypothesized that the incongruent neurons identified in acquisition trials would continue to be selectively more responsive during A (or B) - incorrect trials during subsequent application trials as well. For a given trial t, we use the total normalized activity of condition specific neurons ∑i∈NCNti as a decision variable to predict whether the trial is going to be of condition C. Thus, given a decision threshold θd the trial will be predicted to be A-incorrect if ∑i∈NC2Nti>θd, and B-incorrect if ∑i∈NC4Nti>θd. For a fixed θd, we determine the true positive trials and false positive trials based on the prediction success. If true positive PCT is defined as number of C trials accurately predicted to be C, true negative GCT is number of non-C trials accurately predicted to be non-C, false positive PCF is number of non-C trials wrongly predicted to be C and false negative GCF is number of C trials predicted to be non-C, then true positive rates RCT and false positive rates RCF are calculated as : RCT=PCTPCT+GCF and RCF=PCFPCF+GCT. We then used these true positive and false positive rates for conditions C ∈ {C4, C4} to analyze the predictive significance of incongruent neurons. We performed three separate tests : Group Statistics of ICN prediction. We determined the receiver operating characteristic (ROC) curves (true positive rate vs false positive rate) for each learning session and for each condition type (A-incorrect and B-incorrect) by sweeping across a range of decision threshold values θd. Predictive performance is estimated using the area under the curve (AUC) which is calculated as area between the ROC curve and the diagonal identity line. It ranges between 0.5 and −0.5. We compared the entire sample of AUC values A obtained over all sessions, to the randomized control set of AUCs obtained from using randomly sampled neuron set as predictors of incortrials A′. We calculated the one-sample z-score as ZA=⟨A⟩−⟨A′⟩Var(A′)/N, where N is the sample size of all ROCs calculated over all sessions. The results are illustrated in Fig. 4b. Group Statistics of ICN prediction. We determined the receiver operating characteristic (ROC) curves (true positive rate vs false positive rate) for each learning session and for each condition type (A-incorrect and B-incorrect) by sweeping across a range of decision threshold values θd. Predictive performance is estimated using the area under the curve (AUC) which is calculated as area between the ROC curve and the diagonal identity line. It ranges between 0.5 and −0.5. We compared the entire sample of AUC values A obtained over all sessions, to the randomized control set of AUCs obtained from using randomly sampled neuron set as predictors of incortrials A′. We calculated the one-sample z-score as ZA=⟨A⟩−⟨A′⟩Var(A′)/N, where N is the sample size of all ROCs calculated over all sessions. The results are illustrated in Fig. 4b. Sample predictive ICN effect. As a specific example to illustrate a simple ICN driven predictive criteria uniformly applicable for all learning sessions, we fix the value of θd instead of sweeping it over a range of values as done in the first test described above. For each learning session we determine the value of θd for predicting a trial condition C (C ∈ {C2, C4}), from the acquisition trials, using the criteria : ∑i∈NCNti<θd during 75% of the non-C trials during acquisition period. Using these acquired values of decision thresholds, we determine the true positive and false positive rates for each condition (A-incorr and B-incorr) across all the sessions. Here predictive performance is measured as difference between true positive and false positive rates : dTF=RCT−RCF. We compare the sample of dTF obtained from ICNs to the randomized control of predictive performances obtained by randomly sampled neurons used for prediction dTF′. Significance is measured using one sample z-score : Zd=⟨dTF⟩−⟨dTF′⟩Var(dTF′)/N, where N is the sample size. The results are illustrated in Fig. 4c. Sample predictive ICN effect. As a specific example to illustrate a simple ICN driven predictive criteria uniformly applicable for all learning sessions, we fix the value of θd instead of sweeping it over a range of values as done in the first test described above. For each learning session we determine the value of θd for predicting a trial condition C (C ∈ {C2, C4}), from the acquisition trials, using the criteria : ∑i∈NCNti<θd during 75% of the non-C trials during acquisition period. Using these acquired values of decision thresholds, we determine the true positive and false positive rates for each condition (A-incorr and B-incorr) across all the sessions. Here predictive performance is measured as difference between true positive and false positive rates : dTF=RCT−RCF. We compare the sample of dTF obtained from ICNs to the randomized control of predictive performances obtained by randomly sampled neurons used for prediction dTF′. Significance is measured using one sample z-score : Zd=⟨dTF⟩−⟨dTF′⟩Var(dTF′)/N, where N is the sample size. The results are illustrated in Fig. 4c. Predictive real-time statistics of ICN intervention Based on the predictive criteria suggested in the second test described above, we design a prediction based hypothetical intervention protocol (imagined as a “neuroprosthetic”) during the application trials in real time, so as to test whether there is a significant improvement in the accuracy of the model as well as the animal. The intervention protocol simply is: if the trial is predicted to be incorrect by either A-incorrect (NC2) or B-incorrect neurons (NC4), stop the trial/disqualify the response. We calculate the difference of accuracy between intervened behavior and the original behavior Δ. We compare the sample of observed Δ to that obtained from randomized control set of randomly intervened behavior Δ′ i.e., randomly selected trials are disqualified instead of trials predicted as incorrect. The significance is measured as one sample z-score: ZΔ=⟨Δ⟩−⟨Δ′⟩Var(Δ′)/N, where N is the sample size. The results are illustrated in Fig. 4d, e Predictive real-time statistics of ICN intervention Based on the predictive criteria suggested in the second test described above, we design a prediction based hypothetical intervention protocol (imagined as a “neuroprosthetic”) during the application trials in real time, so as to test whether there is a significant improvement in the accuracy of the model as well as the animal. The intervention protocol simply is: if the trial is predicted to be incorrect by either A-incorrect (NC2) or B-incorrect neurons (NC4), stop the trial/disqualify the response. We calculate the difference of accuracy between intervened behavior and the original behavior Δ. We compare the sample of observed Δ to that obtained from randomized control set of randomly intervened behavior Δ′ i.e., randomly selected trials are disqualified instead of trials predicted as incorrect. The significance is measured as one sample z-score: ZΔ=⟨Δ⟩−⟨Δ′⟩Var(Δ′)/N, where N is the sample size. The results are illustrated in Fig. 4d, e All the above mentioned statistical analysis of the simulated physiological responses, such as power spectral density, phase lock value, etc. were written in MATLAB R2020. Reporting summary Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article. Supplementary information Supplementary Information Reporting Summary Transparent Peer Review file Source data Source Data Acknowledgements We thank Alex Driussi for his valuable support with graphics. We thank Anthony Chesebro for useful discussions. The research presented here was funded by the Baszucki Brain Research Fund, United States (LRMP). This work was supported in part by the Office of Naval Research, United States : N00014-21-1-2290 (RG). The experiments were funded by Office of Naval Research, United States : MURI N00014-23-1-2768 and MURI W911NF2410228, National Institute of Mental Health : 1R01MH131715-01, Freedom Together Foundation, and The Picower Institute for Learning and Memory (EKM). Author contributions Conceptualization: A.P., H.H.S., L.R.M.P., E.K.M., and R.G. Data curation: S.L.B., E.G.A., and E.K.M. Formal analysis: A.P. and R.G. Funding acquisition: H.H.S., L.R.M.P., E.K.M., and R.G. Investigation: A.P. and R.G. Methodology: A.P. and R.G. Project administration: L.R.M.P. Software: A.P., H.O., S.S., and H.H.S. Supervision: H.H.S., L.R.M.P., E.K.M., and R.G. Validation: A.P. Visualization: A.P., L.R.M.P., and R.G. Writing - original draft: A.P. and R.G. Writing - review & editing: A.P., S.L.B., H.H.S., L.R.M.P., E.K.M., and R.G. Peer review Peer review information Nature Communications thanks Garrison Cottrell, Tomoki Fukai, Jung Lee and the other, anonymous, reviewer(s) for their contribution to the peer review of this work. A peer review file is available. Data availability Electrophysiological recordings from macaque brain under category learning paradigm that was used for validation in this paper can be accessed at : https://github.com/Neuroblox/Neuroblox.jl/blob/main/RESOURCES.md. This includes preprocessed LFP signals and spikes from PFC and Striatum. Source data for the figures are provided with this paper. Source data are provided with this paper. Code availability The model shown here is now a part of Neuroblox computational neuroscience platform (https://www.neuroblox.ai/), which includes an easy-to-use GUI as well as documentation and tutorials. A standalone Julia implementation of the model can be found at https://github.com/Neuroblox/Neuroblox.jl/blob/main/RESOURCES.md. Competing interests The authors declare the following competing interests: authors RG, EKM, LRMP, and HHS are co-Founders of Neuroblox Inc., a company spun out of SUNYSB, MIT, and Dartmouth to develop a commercial-grade software platform for multi-scale computational neuroscience with applications to diagnosis and treatment of brain-based disorders. The remaining authors declare no competing interests. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Supplementary information The online version contains supplementary material available at 10.1038/s41467-025-67076-x. References Associated Data Supplementary Materials Supplementary Information Reporting Summary Transparent Peer Review file Source Data Data Availability Statement Electrophysiological recordings from macaque brain under category learning paradigm that was used for validation in this paper can be accessed at : https://github.com/Neuroblox/Neuroblox.jl/blob/main/RESOURCES.md. This includes preprocessed LFP signals and spikes from PFC and Striatum. Source data for the figures are provided with this paper. Source data are provided with this paper. The model shown here is now a part of Neuroblox computational neuroscience platform (https://www.neuroblox.ai/), which includes an easy-to-use GUI as well as documentation and tutorials. A standalone Julia implementation of the model can be found at https://github.com/Neuroblox/Neuroblox.jl/blob/main/RESOURCES.md.