Learning-related congruent and incongruent changes of excitation and inhibition in distinct cortical areas

Excitatory and inhibitory neurons in diverse cortical regions are likely to contribute differentially to the transformation of sensory information into goal-directed motor plans. Here, we investigate the relative changes across mouse sensorimotor cortex in the activity of putative excitatory and inhibitory neurons—categorized as regular spiking (RS) or fast spiking (FS) according to their action potential (AP) waveform—comparing before and after learning of a whisker detection task with delayed licking as perceptual report. Surprisingly, we found that the whisker-evoked activity of RS versus FS neurons changed in opposite directions after learning in primary and secondary whisker motor cortices, while it changed similarly in primary and secondary orofacial motor cortices. Our results suggest that changes in the balance of excitation and inhibition in local circuits concurrent with changes in the long-range synaptic inputs in distinct cortical regions might contribute to performance of delayed sensory-to-motor transformation.


Introduction
Many brain regions are thought to contribute to the performance of goal-directed sensory-to-motor transformations. An increasingly well-defined sensorimotor transformation studied in rodents is the learned association between a whisker sensory input and licking for reward [1][2][3][4][5][6][7][8][9][10][11][12][13][14][15][16][17][18][19]. From a cortical perspective considering whiskerdependent tasks requiring licking for perceptual report, sensory processing is prominent in the somatosensory cortices, whereas neuronal activity linked to motor planning during delay periods is primarily found in premotor cortices, and motor commands are more prominent in primary motor cortex [20][21][22][23]. We recently showed that in a whisker detection task with delayed licking, the correct execution of the task involves a stereotypical spatiotemporal sequence of whisker deflection-evoked neuronal firing by which sensory cortex appeared to contribute to exciting frontal cortical regions to initiate neuronal delay period activity [22]. Comparing novice and expert mice, we also found that the learning of the task is accompanied by region-and temporal-specific changes in cortical activity [22]. These experience-dependent changes in evoked-activity likely result from changes in long-range synaptic inputs and changes within local synaptically-connected neocortical microcircuits. Neocortex has regional specializations and a columnar organization divided into layers each containing many classes of neurons varying across diverse features [24][25][26][27][28]. At the most basic level, neocortical neurons can be classified as excitatory (releasing glutamate) or inhibitory (releasing GABA). Many neocortical excitatory neurons send long-range axons projecting to diverse brain regions, whereas most neocortical inhibitory neurons only have local axonal arborisations, thus contributing primarily to the regulation of local microcircuit activity. The balance between excitation and inhibition is likely to have a major impact on neocortical microcircuit computations and previous work has suggested important changes in this balance across development, brain states, sensorimotor processing and models of brain diseases [29][30][31][32][33][34][35][36]. Inhibitory GABAergic neurons can be further divided into many subclasses, with one of the most prominent being the parvalbumin-expressing (PV) neurons. PV cells provide potent inhibition onto excitatory cells by prominently innervating either the soma and proximal dendrites or the axonal initial segment, thus playing a critical role in controlling the discharge of excitatory neurons. At the millisecond timescale, the PV neurons appear specialized for high-speed synaptic computations with fast membrane time-constants and large fast synaptic conductances, receiving substantial excitatory input from many nearby excitatory neurons as well as long-range inputs [37][38][39][40][41][42]. Within a neocortical microcircuit, PV neurons are likely to play a critical role in controlling the balance between excitation and inhibition. PV cells typically fire at high rates and have short action potential (AP) durations that can be identified from extracellular recordings.
In fact, neurons recorded from extracellular recordings are typically classified based of their AP duration, as regular spiking (RS) units, which have broad AP waveforms and correspond mostly to excitatory neurons; and fast spiking (FS) units, which have narrow AP waveforms and largely correspond to inhibitory PV neurons. Previous whisker-related studies have reported experience-dependent plasticity of both excitatory and inhibitory synaptic transmission, with prominent changes reported in PV GABAergic neurons, for example following whisker deprivation [43,44]. However, it remains unknown how reward-based learning in whisker-dependent tasks might affect the activity of PV neurons, although previous work has revealed prominent changes in PV neuronal activity in mouse motor cortex during learning of a lever-press task [45] and in visual cortex during learning of a visual discrimination task [46].
In the present study, we investigate whether the changes observed during the learning of the whisker detection task with delayed licking are associated with a change in the balance between excitation and inhibition. We used our recently published dataset of high-density silicon probe recordings from six cortical regions previously identified to be important during this behavior [22] and compared the changes in evoked activity of RS and FS units. Interestingly, we found that upon task learning, RS and FS showed opposite changes in some cortical areas, suggesting important changes in local computation, whereas in other regions, RS and FS changed in parallel suggesting rather an overall shift in the synaptic drive to these areas.

Results
Localisation and classification of cortical neurons. In this study we further analysed a data set of extracellular silicon probe recordings of neuronal spiking activity we published recently [22]. We focused our analyses on six key neocortical regions: whisker primary somatosensory cortex (wS1), whisker secondary somatosensory cortex (wS2), whisker primary motor cortex (wM1), whisker secondary motor cortex (wM2), anterior lateral motor cortex (ALM) and tongue-jaw primary motor cortex (tjM1) ( Fig 1A). These regions participate in a whisker detection task with delayed licking to report perceived stimuli [22]. Mice first went through pretraining to the task structure, which included a brief light flash to indicate trial onset followed 2 s later by a brief auditory tone to indicate the beginning of the 1-s reporting period, during which the thirsty mice could lick to receive a water reward (Fig 1B). We recorded from two separate groups of mice referred to as "Novice" and "Expert" hereafter, while a brief whisker stimulus was introduced 1 s after the visual cue in a randomized half of the trials, and licking in the reporting window was only rewarded in whisker stimulus trials ( Fig 1B and 1C). Expert mice were given additional whisker training through which they learned to lick preferentially in trials with a whisker stimulus (Fig 1B and 1C). However, Novice mice had not learned the stimulus-reward contingency and licked equally in trials with and without whisker stimulus [22]. Through anatomical reconstruction of fluorescently-labelled electrode tracks and registration to a digital mouse brain atlas, here we precisely localize units to specific layers and cortical regions annotated in the Allen Mouse Brain Common Coordinate Framework [47] (Fig 1D and S1). The neuronal location was assigned to the recording site with the largest amplitude spike waveform along the shank of the silicon probe ( Fig 1E). Neurons in different cortical regions and layers had diverse firing patterns during task performance (Fig 1F and S1). We further distinguished neurons according to the duration of the action potential waveform. In both Novice and Expert mice, we found a bimodal distribution of spike duration, which we labelled as FS units (spike duration below 0.26 ms) and RS units (spike duration above 0.34 ms), according to standard nomenclature [48,49] (Fig 1G and S2).
Unexpectedly, we found a larger fraction of FS units in sensory areas compared to frontal areas (S2 Fig), which could in part reflect differential distribution of PV neurons [50] and in part might indicate the known sampling bias of extracellular recordings limited to high-firing neurons, whereas sensory cortex typically has rather sparse activity. During task performance, both FS and RS units had a broad range of baseline firing rates (Fig 1H), which appeared to have a near log-normal distribution in both To investigate the classification of FS and RS units, we conducted a new set of recordings in which we measured the impact of stimulating genetically-defined GABAergic neurons in mice expressing channelrhodopsin-2 (ChR2) under the control of the vesicular GABA transporter (VGAT) [51]. Blue light modulated the firing rate of RS and FS neurons in opposite directions, quantified both at the level of population ( Fig 1J) and at the level of individual neurons ( Fig 1K) (Fig 1L). As a second approach, and to avoid network effects of light stimulation [52], we focused only on the first 10-ms window after the onset of light stimulation and identified the opto-tagged neurons based on their fidelity of responses, response onset latency and jitter ( Fig 1M-O and S4). A larger fraction of neurons was opto-tagged among FS neurons compared to RS neurons. These data are therefore consistent with the hypothesis that the majority of FS units are likely to be inhibitory neurons, whereas the majority of RS units are likely to be excitatory neurons.
Strong task-modulation of fast-spiking neurons. Many RS units across all six cortical regions change their action potential firing rates in response to the whisker deflection [22]. Here, we analyzed the responses of FS units during task performance in Novice and Expert mice (Fig 2). Averaged across cortical areas and quantified over the first 100 ms after whisker deflection, FS neurons in Novice mice increased their firing rate by 4.6 ± 7.9 Hz (392 units recorded in 8 mice) which was significantly higher (Wilcoxon rank-sum test, p = 1x10 -34 ) than the increase in firing rate of RS neurons of 1.0 ± 2.4 Hz (1089 units recorded in 8 mice) (Fig 2A). Task-modulated RS and FS neurons were mainly excited, with only a small fraction showing significant reduction in firing rate (Fig 2B). Similarly, for Expert mice, whisker deflection evoked an increase of FS firing rate of 4.7 ± 9.1 Hz (831 units recorded in 18 mice) which was significantly higher (Wilcoxon rank-sum test, p = 4x10 -71 ) than the increase in firing rate of RS neurons of 1.1 ± 3.9 Hz (2724 units recorded in 18 mice) (Fig 2C) Wilcoxon rank-sum test, p = 1x10 -30 ). In Novice mice there was little delay period activity in either RS or FS units. The largest fraction of modulated neurons during the delay period were FS units in ALM of Expert mice, which were strongly excited ( Fig   2D). Analysis of correct rejection trials in Novice and Expert mice, revealed that in the absence of the whisker stimulation neuronal activity remained at baseline levels during the delay period in both RS and FS neurons (S5 Fig). Thus, the overall task selectivity of FS unit activity changed in a similar manner across learning compared to our previous quantification of RS units [22], with FS units having overall larger responses. Expert mice, the latency of RS units increased in wM1, but decreased in wM2, upon whisker learning (Fig 3D and S6B) [22]. In contrast FS units did not significantly change their latency across learning in any of the six cortical regions (Fig 3D and S6B). These latency differences reveal that task learning is accompanied by fast dynamic changes in the relative timing of the recruitment of FS and RS units across wM1 and wM2.
Fast sensory processing in wS1 and wS2. Having observed the fastest whiskerevoked responses in wS1 and wS2 (Fig 3), we further compared RS and FS units in these areas, by focusing on their response in the first 50-ms window (Fig 4). The whisker-evoked change in firing rates of RS and FS units in wS1 and wS2 remained unchanged across Novice and Expert mice (Fig 4A-4C Hz for 161 FS units in 18 mice, p < 10 -4 ; non-parametric permutation tests, FDRcorrected for multiple comparison) (Fig 4C). Neuronal responses in wS1 and wS2 often showed a biphasic response; a fast and sharp evoked response followed by a later secondary wave of spiking activity. While, the fast early response remained unchanged (Fig 2A and 2C), the late response increased across learning in RS and FS units of both wS1 and wS2 areas (S9 Fig), consistent with previous work in wS1 in a whisker detection task without a delay period [6].
The latencies of evoked activity in wS1 and wS2 were shorter for FS units compared to RS units for both Novice and Expert mice (Wilcoxon rank-sum tests FDRcorrected for multiple comparison: Novice wS1 p = 1x10 -7 ; Novice wS2 p = 1x10 -3 ; Expert wS1 p = 1x10 -10 ; Expert wS2 p = 9x10 -6 ) ( Fig 4D). Comparing wS1 and wS2 areas, we found no significant difference in RS units response latencies, whereas FS units in wS1 fired at shorter latencies than FS units in wS2 (Wilcoxon rank-sum test FDR-corrected for multiple comparison, Novice: p = 1x10 -4 , Expert: p = 3x10 -4 ). Both wS1 and wS2 therefore responded strongly and similarly to whisker stimulation in both Novice and Expert mice and no significant change was found in the response of RS or FS units across learning (Fig 4C and 4D).
Optogenetic inactivation by applying blue light in VGAT-ChR2 mice to either wS1 and wS2 during the delivery of the whisker stimulus induced a significant decrease in hit rate [22]. Here, we reanalyzed this inactivation data in a direct comparison across these two areas, and found a significantly stronger deficit induced by inactivation of wS2 compared to wS1 (wS1: ∆hit = -0.30 ± 0.13; wS2: ∆hit = -0.49 ± 0.12; Wilcoxon signed-rank test, p = 0.0039; 9 mice) ( Fig 4E). However, potential differences in the spatial extent of the whisker deflection-evoked responses and the efficacy of optogenetic inactivation in wS1 versus wS2 make it difficult to conclude the relative importance of sensory processing in these two areas. Nonetheless, the data suggest that neuronal activity in both wS1 and wS2 is involved in execution of this whisker detection task.
Parallel anatomical pathways from wS1 and wS2 to wM1 and wM2. Neuronal activity in wS1 and wS2 can only contribute to task execution by communicating with other brain regions. Along with various subcortical projections [53,54], innervation of frontal cortical areas might be of particular importance in connecting sensation and movement [10,22]. Neurons in wS1 have previously been shown to innervate wM1 [55][56][57][58], but much less is known about the long-range output of wS2. We therefore carried out a set of experiments in which we expressed fluorescent proteins in neurons of wS1 and wS2 to examine their relative innervation targets in frontal cortex ( Fig 5A). In the example experiment we injected virus expressing a red fluorescent protein in wS1 and a green fluorescent protein in wS2. The fixed brains were imaged through serial section two photon tomography and registered to the Allen Mouse Brain Common Coordinate Framework [47] (Fig 5B). As previously shown, wS1 innervates frontal cortex with a column of axons in a cortical region we label as wM1 ( Fig 5C). Similarly, wS2 axons project to frontal cortex in a columnar manner in a region we label as wM2 ( Fig 5D).
The location of wM2 appeared to be more anterior compared to the location of wM1 ( Fig 5E and 5F), which is further confirmed by overlaying the projections (Fig 5G).
Quantification of the location of the peak on average fluorescence across mice ( Fig 5G and 5H, contours) revealed that wM1 was located at 1.0 mm anterior and 1.0 mm lateral to bregma, while wM2 was located at 1.9 mm anterior and 1.2 mm lateral to bregma. We further quantified wM1 and wM2 locations by averaging among frontal projection centers from individual mice (Fig 5H, markers) finding similar results (wM1: 1.0 ± 0.1 mm anterior and 1.0 ± 0.1 mm lateral to bregma across 4 mice; wM2: 1.7 ± 0.1 mm anterior and 1.0 ± 0.3 mm lateral to bregma across 4 mice). Primary and secondary somatosensory cortex therefore map onto frontal cortex in a pattern consistent with mirror-symmetric somatotopy [58] and the frontal projections from visual cortex [59].
Changes in fast sensory processing in wM1 and wM2. We next investigated the changes in whisker deflection-evoked neuronal activity in wM1 and wM2 across task learning. RS and FS neurons in both wM1 and wM2 and in both Novice and Expert mice showed obvious fast sensory-evoked modulation, dominated by units with increased action potential firing (Fig 2, 3 and 6). However, RS and FS neurons changed their activity patterns differentially across learning in these two neighbouring cortical areas. In wM1, RS units had a smaller whisker-evoked response in Expert compared to Novice mice (Novice: 1.8 ± 3.0 Hz, 147 units recorded in 7 mice, Expert: 0.9 ± 3.9 Hz, 452 units recorded in 11 mice; non-parametric permutation test, p = 0.002) ( Fig 6A and S10), whereas FS units had a larger response in Expert mice (Novice: 3.1 ± 3.6 Hz, 66 units recorded in 7 mice, Expert: 7.3 ± 16.9 Hz, 134 units recorded in 11 mice; non-parametric permutation test, p = 0.0008) (Fig 6B and S10). The ratio of RS to FS firing in wM1 is therefore strongly changed in Expert mice in favor of FS units.
In contrast, we found that neuronal activity in wM2 changed in a very different way across learning compared to wM1. In wM2, whisker deflection evoked an increased action potential firing in RS units of Expert mice compared to Novice mice (Novice: 1.0 ± 2.2 Hz, 244 units recorded in 7 mice, Expert: 1.5 ± 4.5 Hz, 401 units recorded in 10 mice; non-parametric permutation test, p = 0.016) (Fig 6C and S11), but a decreased firing of FS units (Novice: 4.5 ± 6.8 Hz, 57 units recorded in 7 mice, Expert: 2.7 ± 3.9 Hz, 107 units recorded in 10 mice; non-parametric permutation test, p = 0.021) (Fig 6D and S11). The balance of RS to FS unit activity in wM2 is therefore enhanced in favor of RS units across task learning.
To test how the coordination between sensory and motor cortices changed across learning, we quantified inter-areal interactions between wS1->wM1 and wS2->wM2 in the subset of sessions during which we obtained simultaneous paired recordings from these areas (Fig 6E and 6F (Fig S12A). To further evaluate functional connectivity changes, we identified the number of directional connections (putative direct mono-synaptic connections) based on short-latency sharp peaks in the cross-correlograms between pairs of neurons from whisker sensory and whisker motor cortices (Fig 6F and S12B).
The percentage of connections between wS2-RS units to wM2-RS units increased significantly across learning (Novice: 3 out of 1077 pairs in 6 mice, Expert: 17 out of 1066 pairs in 3 mice; Chi-squared proportion test, p = 0.0032).
All together, these data suggest that learning might increase the excitation to inhibition ratio of the sensory-evoked response in wM2, but decreases the ratio in wM1 in favor of inhibition. Increased activity of excitatory neurons in wM2 across learning could arise from the increase in functional connectivity between wS2 to wM2, and could in turn contribute to driving excitation in other frontal areas including ALM, which is known to be important for the motor planning of licking [20,22].  [22]. An active suppression of licking during the response window after the auditory cue is also required in correct rejection trials compared to miss trials, and we previously reported stronger suppression of RS units in correct rejection trials [22]. Here, we similarly observed a larger reduction of activity of FS neurons during the response window in correct rejection trials compared to miss trials (S14 Fig). Thus, in periods when licking should be suppressed, there appears to be a decrease in firing of both RS and FS neurons in tjM1 across learning.
Delay period activity emerges in RS units of ALM after task learning, and is causally involved in motor planning [22]. non-parametric permutation test, p = 0.0001). Furthermore, in Expert compared to Novice mice, a larger fraction of RS and FS units were significantly modulated during the delay, primarily with an increase in firing rate (Fig 7C and 7D). The delay period activity was more prominent in deeper layers of ALM for both RS and FS neurons (S15 Preparatory movements were prominent during delay periods in Expert mice and accounted for a large part of the neuronal activity during the delay period [22]. Nonetheless, investigating the subset of quiet trials without delay period movements, we found that significant neuronal delay period activity still remains in both RS and FS units (S16 Fig). Therefore, both RS and FS units in ALM develop persistent delay period activity across learning which likely contributes to the storage of a licking motor plan.

Changes in excitation and inhibition across learning.
To the extent that we can equate RS units with excitatory neurons and FS units with inhibitory neurons (Fig 8A), we can begin to compute changes in the putative balance of excitation and inhibition as the changes in RS and FS firing rates across learning, providing a simple summary for comparisons (Fig 8). To do so, for each area (Fig 8B) (Fig 8C and 8D). Subtraction of the LMI of RS from the LMI of FS units as a measure of the change in the putative excitation-inhibition balance across learning, showed a decreased putative excitation-inhibition balance in wM1, but an increased putative excitation-inhibition balance in wM2 (E-I LMI wM1 = -0.72; E-I LMI wM2 = 0.46) (Fig 8E and 8F). Interestingly, the apparent balance of excitation and inhibition thus appears to change differently across learning in distinct cortical areas.

Discussion
Comparing neuronal activity across task learning revealed distinct changes in RS and FS units in various neocortical areas. Strikingly, in tjM1 and ALM, RS and FS neurons changed firing rates congruently across learning, but in wM1 and wM2, RS and FS changed firing rate incongruently, pointing towards learning-related changes in the balance of cortical excitation and inhibition, with an overall change across learning towards excitation of wM2 and inhibition of wM1.
In wS1 and wS2, we found that there was little change in overall neuronal activity across learning, consistent with a robust coding of the sensory stimulus in these areas of somatosensory cortex (Fig 4). Our results do not rule out a possible reorganization of neuronal activity across learning with some neurons increasing and others decreasing their response to whisker stimulation. Indeed, in a whisker detection task without a delay period, we previously found in wS1 of expert mice that neurons projecting to wS2 had stronger task-related depolarizations compared to neurons projecting to wM1, whereas we found the converse in naive mice [61]. Consistent with an important role for wS2 in whisker detection tasks [19,22,62], here we found that optogenetic inactivation of wS2, as well as wS1 inactivation, induced a strong impairment in task performance (Fig 4E).
Neuronal activity in wS1 and wS2 can directly influence frontal cortex through direct monosynaptic connections with wM1 and wM2, which we characterized anatomically in this study (Fig 5). Interestingly, neuronal activity in wM1 and wM2 changed profoundly across learning (Fig 6). RS units in wM1 decreased their sensoryevoked response, whereas RS units in wM2 increased their response across learning [22]. Trial-by-trial correlations ( Fig 6E) and spike-triggered connectivity analyses ( Fig   6F) both pointed to enhanced coupling between wS2-RS units and wM2-RS units, which could, at least in part, result from potentiation of monosynaptic inputs from wS2-RS units to wM2-RS units, although other more complex mechanisms could equally play a role. In contrast FS units in wM1 increased their response across learning, whereas FS units in wM2 decreased their evoked neuronal activity. Our data thus suggest differential change in the balance between excitation and inhibition with learning in wM1 and wM2, with enhanced sensory-evoked inhibition relative to excitation in wM1 but enhanced excitation relative to inhibition in wM2 (Fig 8). Changes in inhibitory neuronal activity could contribute importantly to task learning. Increased recruitment of fast inhibition in wM1 across learning could suppress the response of excitatory neurons in wM1. We speculate that suppression of activity in wM1 could enhance whisker detection performance by reducing whisker movements [63], which otherwise could cause confounding sensory-reafference signals. On the other hand, reduced firing of inhibitory neurons in wM2 across learning could allow the excitatory neurons to respond more strongly. Disinhibition of wM2 might be an important step allowing the propagation of whisker sensory information in higher order motor cortex, perhaps contributing to exciting ALM through local intracortical connections [22].
Interestingly, disinhibition of wS1 has previously been reported to contribute to execution of a whisker detection task without a delay [64], suggesting the general importance of considering changes in inhibitory neuronal activity for controlling goaldirected sensorimotor transformations [65][66][67]. Several mechanisms could contribute to disinhibition, including the activation of GABAergic neurons preferentially innervating other GABAergic neurons, as found in auditory cortex during fear learning [68].
In contrast to the divergent changes across learning in RS and FS unit activity in wM1 and wM2, RS and FS units changed their activity patterns in the same way in ALM and tjM1 (Fig 7). Suppression of tjM1 activity in Expert mice has a causal role in delayed licking behavior [22]. The rapid suppression of RS units across learning in tjM1 was mirrored by a rapid suppression of FS unit firing (Fig 7A and 7B). Overall there was thus no apparent change in the balance of excitation and inhibition in tjM1 across learning (Fig 8). The rapid decrease in firing of both RS and FS units evoked by the whisker deflection in Expert mice could result from many different mechanisms, including a possible reduced thalamic or other long-range input to orofacial sensorimotor cortex.
Neuronal delay period activity in ALM is of critical importance for motor planning of licking [20][21][22]. We found that both RS and FS units increase firing rate during the delay period in Expert mice, but not Novice mice (Fig 7). Similar to tjM1, there was therefore no apparent change in the balance of excitation and inhibition in ALM across learning (Fig 8). Thalamic activity has been shown to be necessary for maintaining ALM activity during delay periods [21,75,76], and increased thalamic input likely excites both RS and FS neurons either directly [41,[77][78][79][80][81][82][83] or indirectly through local cortical microcircuitry. ALM neurons in turn, project to thalamic nuclei [21]. In agreement with this, we observed larger delay activity in layer 6 of ALM where many corticothalamic neurons are located [84] (S15 Fig). In future studies, it will be of importance to better define the various classes of neurons beyond our current classification of RS and FS units. For example diverse classes of GABAergic neurons can be defined through expression of Cre and Flp recombinase under different promoters [85,86], enabling functional identification of these neurons through opto-tagging [87]. Different classes of excitatory neurons might be best classified through their long-range axonal projections, which could be functionally identified through optogenetic stimulation of axonal branches in target regions [88]. The current study thus takes a first step towards differentiating neuronal activity in various cortical regions across learning, but further experiments will be needed in order to gain a more complete understanding of neocortical cell type-specific changes, as well as, importantly, investigating subcortical regions which are likely to play profound roles in both learning and execution of goal-directed sensorimotor transformations.

Materials and Methods
The results in this study are largely based on further analysis of our recently published dataset available Open Access via the CERN database Zenodo (https://doi.org/10.5281/zenodo.4720013). The methods used to obtain the published dataset were fully described in the accompanying journal publication [22], and are only briefly introduced here. The new analyses are described in detail below. We also carried out two new series of experiments: i) optogenetic tagging of GABAergic neurons and ii) anatomical analysis of axonal projections from wS1 and wS2 to frontal cortex. All experimental procedures were approved by the Swiss Federal Veterinary Office (Licences VD1628.7 and VD1889.4) and were conducted in accordance with the Swiss guidelines for the use of research animals. The methods for obtaining the new data are described in detail below. The full data set and analysis code used to generate the figures and results described in this study will be made available via the Open Access CERN database Zenodo: https://zenodo.org/communities/petersen-lab-data.

Behavioral paradigm and electrophysiological recordings
Both Novice and Expert mice were trained in the first stage of the task, where in all trials a visual (trial onset) and auditory cues were presented, and licks during a 1second response window following the auditory cue were rewarded (Fig 1A and 1B).
To initiate a trial, mice needed to withhold licking (i.e. not touching the water spout) for a quiet period of 2-3 seconds following an inter-trial-interval of 6-8 seconds. Visual cue (200 ms, green LED) and auditory cue (200 ms, 10 kHz tone of 9 dB added on top of the continuous background white noise of 80 dB) were separated with a delay period which gradually was increased to 2 seconds over Pretraining days. Licking before the response period (Early lick) aborted the trial and introduced a 3-5 second timeout. The Expert mice went through a second training phase (Whisker-training), in which only Go trials (i.e. trials with a whisker stimulus) were rewarded. Whisker stimulus (10 ms cosine 100 Hz pulse through a glass tube attached to a piezoelectric driver) was delivered to the right C2 whisker 1 second after the visual cue onset in half of the trials.
Electrophysiological data from both groups of mice were acquired during the final task conditions (Fig 1C). Novice mice licked in both Go and No-Go trials; while Expert mice had learned to lick selectively in Go trials [22]. Mouse Common Coordinate Framework version 3 [47] using a python-based tool (Brainreg, https://github.com/brainglobe/brainreg) [90]. We then acquired 2-D maps of cortical projection patterns, by only considering layer 2/3 of cortex and calculating 99% intensity levels across cortical depth using custom-developed analysis routine (https://renkulab.io/projects/guiet.romain/brainreg/files/blob/notebooks/notebooks_na pari_brainreg.ipynb). Grand average 2-D maps of cortical projections (Fig 5E and F) were obtained by first normalizing each mouse's map to its global maximum (i.e. injection site intensity value), and then averaging across mice. The 95% and 75% contours (Fig 5H) for wS1 and wS2 frontal projections sites were calculated on these grand average maps. The center of frontal projection site for individual mice was identified by finding the local maxima in the frontal cortical region (Fig 5H).

Single neuron whisker-evoked response latency
When measuring the latency of the whisker-evoked response in the firing rate of individual neurons in all cortical areas (Fig 3C and 3D recalculated the latencies with higher temporal resolution (Fig 4D). We limited the analysis to 100-ms window following the whisker onset, and calculated latencies on smoothed peristimulus time histograms (1 ms non-overlapping bins filtered with a Gaussian kernel with σ = 5 ms).

Quantifying opto-tagged neurons
In recordings from VGAT-ChR2 mice (Fig 1J-O and S4), we quantified the effect of blue light stimulation on firing rates, on both slow and fast time scales. To quantify the effect of light on each individual neuron we first calculated an opto modulation index (OMI, Fig 1K). OMI was defined, in light trials, as the normalized difference between the average firing rate during the light window (100-500 ms after light onset) vs a baseline of similar duration (-400-0 ms prior to light onset): Subsequently, to measure the effect of light stimulation devoid of potential network effects, we focused on the first 10-ms immediately after light onset. We then quantified within this window the following parameters: fidelity, defined as the percentage of trials with at least one spike during this window; latency, as the average delay to first spike in trials with at least one spike during 10-ms window; and jitter as the standard deviation of the latency. We then labeled neurons as opto-tagged with fidelity > 20%, latency < 4.5 ms and jitter < 2 ms (Fig 1M-O and S4).

Inter-areal functional connectivity measures
Taking advantage of the subset of sessions with simultaneous paired recordings from whisker sensory and motor cortices, we used two separate methods to examine the changes across learning in the coordination of inter-areal neural activity (Fig 6E and   6F and S12). First, we measured Pearson correlation between trial-by-trial whisker evoked responses in pairs of individual neurons recorded from wS1/wS2 (5-55 ms window after whisker onset) and wM1/wM2 (10-90 ms window after whisker onset) ( Fig   6E). For the pair-wise correlation analysis, we only considered neurons with average firing rate > 2.5 Hz within the corresponding analysis windows. Similarly, the Pearson correlation in trial-by-trial average population responses in the same task epochs between pairs of simultaneously recorded areas were quantified ( Fig S12A).
Secondly, we identified directional functional connectivity from wS1 to wM1 and from wS2 to wM2 by calculating cross-correlograms (CCG) during a 1-second window centered on whisker stimulus (Fig 6F and S12B). The CCG was defined as: where M is the number of trials, N is the number of bins in the trial, 1 and 2 are the spike trains of the two units on trial , is the time lag relative to reference spikes, and window [91]. Neurons with firing rate > 1 Hz within the analysis window were included in this analysis.
To better capture fast timescale changes related to feedforward connections, crosscorrelograms were corrected by subtracting a jittered version [92,93] (Fig S12B): The jittered CCG was produced as the average of 100-times resampling the original dataset where spike times within each 25-ms window were randomly permuted across different trials. This method, removes the stimulus-locked and slow timescale correlations larger than the jitter window, while preserving the trial-averaged PSTH and number of spikes for each unit [94]. For each pair of recorded units, the significant directional connection from reference to target neuron was identified if the maximum CCG within time lags between 0 to 10 ms was larger than 6-fold standard deviation of the jitter-corrected CCG flanks (between ±50-100 ms).
For both analytical methods, in wS1/wS2 we focused only on the RS units, as they are known to have long-range projections. In wM1/wM2, we quantified correlations and directional connections separately for RS and FS units.

Quantifying learning modulation index
The learning modulation index (LMI) for each cell class ('cc', i.e. RS or FS) and cortical area ('a', i.e. wS1, wS2, wM1, wM2, ALM, or tjM1) was defined as the normalized difference of whisker-evoked response in Novice and Expert mice (Fig 8C and 8D): where ∆ is the grand average change in firing rate (compared to pre-whisker baseline) across all neurons from that mouse group, cortical region and cell class.

Data availability
The data used to generate figures that support the findings of this study will be made freely available in the Open Access CERN database Zenodo: https://zenodo.org/communities/petersen-lab-data with doi hyperlink.

Code availability
The Matlab code used to generate figures that support the findings of this study will be made freely available in the Open Access CERN database Zenodo: https://zenodo.org/communities/petersen-lab-data.