Hierarchy of prediction errors shapes the learning of context-dependent sensory representations
How sensory information is interpreted depends on context, yet the neural mechanisms by which context shapes sensory processing remain poorly understood. To address this question, we developed a computational model constrained by in vivo functional imaging of cortical neurons in mice during reversal learning of a tactile sensory discrimination task. During learning, layer 2/3 somatosensory neurons enhanced their response to reward-predictive stimuli. The model accounted for these observations through selective top-down gain amplification of apical dendritic inputs, accompanied by reduced reward-prediction errors and increased confidence in outcome predictions. Upon rule-reversal, the lateral orbitofrontal cortex, through disinhibitory VIP interneurons, encoded a context-prediction error signaling a loss of confidence. The hierarchy of reward- and context-prediction errors across cortical areas is mirrored in top-down signals modulating apical activity of simulated pyramidal neurons in the primary sensory cortex. The model explains how contextual changes are detected and how reward- and context-prediction error signals, originating in different cortical regions, interact to reshape the sensory representation.