An adaptive behavioral control motif mediated by cortical axo-axonic inhibition

Genetically defined subgroups of inhibitory interneurons are thought to play distinct roles in learning, but heterogeneity within these subgroups has limited our understanding of the scope and nature of their specific contributions. Here we reveal that the chandelier cell (ChC), an interneuron type that specializes in inhibiting the axon-initial segment (AIS) of pyramidal neurons, establishes cortical microcircuits for organizing neural coding through selective axo-axonic synaptic plasticity. We found that organized motor control is mediated by enhanced population coding of direction-tuned premotor neurons, with tuning refined through suppression of irrelevant neuronal activity. ChCs contribute to learning-dependent refinements by providing selective inhibitory control over individual pyramidal neurons rather than global suppression. Quantitative analysis of structural plasticity across axo-axonic synapses revealed that ChCs redistributed inhibitory weights to individual pyramidal neurons during learning. These results demonstrate an adaptive logic of the inhibitory circuit motif responsible for organizing distributed neural representations. Thus, ChCs permit efficient cortical computation in a targeted cell-specific manner.

Genetically defined subgroups of inhibitory interneurons are thought to play distinct roles in learning, but heterogeneity within these subgroups has limited our understanding of the scope and nature of their specific contributions. Here we reveal that the chandelier cell (ChC), an interneuron type that specializes in inhibiting the axon-initial segment (AIS) of pyramidal neurons, establishes cortical microcircuits for organizing neural coding through selective axo-axonic synaptic plasticity. We found that organized motor control is mediated by enhanced population coding of direction-tuned premotor neurons, with tuning refined through suppression of irrelevant neuronal activity. ChCs contribute to learning-dependent refinements by providing selective inhibitory control over individual pyramidal neurons rather than global suppression. Quantitative analysis of structural plasticity across axo-axonic synapses revealed that ChCs redistributed inhibitory weights to individual pyramidal neurons during learning. These results demonstrate an adaptive logic of the inhibitory circuit motif responsible for organizing distributed neural representations. Thus, ChCs permit efficient cortical computation in a targeted cell-specific manner.
The reorganization of neural circuits during learning relies on a complex interplay between excitatory and inhibitory signals in the brain, accompanying highly specific synaptic modification. Various synaptic changes contributing to this interplay have been observed at the scale of individual cells and whole circuits. The observed formation and elimination of dendritic spines in cortical pyramidal neurons (PyNs) during learning suggests that learning is associated with changes in neuronal connectivity [1][2][3][4] . At the circuit level, neuronal activity is synchronized in a subpopulation of neurons, resulting in a high correlation between neuronal activity patterns and learned behaviors 3,5,6 . GABAergic inhibition plays a critical role in shaping learning-dependent circuit changes. Interneurons are categorized by anatomical and electrophysiological features, with genetically defined subtypes such as parvalbumin (PV)-expressing, somatostatin (SOM)-expressing and vasoactive intestinal polypeptide (VIP)-expressing neurons, demonstrating distinct functions during learning [7][8][9][10][11] . However, these subtypes still contain a remarkable degree of heterogeneity, such that the precise role of each interneuron type in mediating inhibition has yet to be determined.
The ChC (that is, 'axo-axonic cell') is a bona fide GABAergic interneuron subclass with distinct axonal geometry, subcellular synapse connectivity and fast-spiking electrophysiological properties 12,13 . A single ChC exhibits a characteristic axonal geometry with many prominent vertical branches, which contain strings of synaptic boutons exclusively aligned along the axon-initial segments (AISs) of neighboring PyNs. Because the AIS is the site of

Improved directional control of movement
Previous studies showed that ChCs increased activity during locomotion 17,18 . The premotor cortex (M2, anteromedial agranular cortex, homologous to supplementary motor areas in the primate brain) is involved in gating sensory inputs and motor outputs for movement planning, fine action control and decision-making [19][20][21] . To investigate the role of ChCs in controlling the activity of M2 neurons during locomotion, we used a spatial navigation task that requires goal-directed motor control 22 . Mice were trained to traverse a multi-textured ball maze with four distinctive tactile surface cues and to reach a goal spot on the ball, where a water reward was given (Fig. 1a, Supplementary Movie 1 action potential initiation, ChCs can have decisive control over spike generation in an ensemble of PyNs, thereby regulating network synchrony and oscillations. These functions are thought to be critical for higher-order cognitive processes, such as working memory [14][15][16] . In this study, using a transgenic mouse line specifically engineered to target ChCs, we examined the role of ChCs in sculpting cortical circuits involved in motor learning. We discovered that the ChC is essential for improving the direction-tuning of targeted cells by suppressing irrelevant activity at the population level. ChCs shaped this sophisticated inhibitory motif among a specific set of neuron types. Thus, ChCs primarily take a 'select and focus' strategy rather than serve as a uniform gain setter. and Methods). The task required directional motor control accurately aimed to the goal spot. While animals were navigating the ball maze, we recorded neuronal activity of the L2/3 premotor population using Ca 2+ imaging via two-photon microscopy. Mice with water restriction (experimental group) showed reward-seeking behavior on the ball maze, developed a preferred pathway and generated goal-oriented locomotion with learning, whereas mice with ad libitum water (control group) did not (Fig. 1b). The number of successfully reaching the goal spot increased in the experimental group but not in the control group (Fig. 1e). Time spent in the goal (rewarded) quadrant (Q1) increased with training (Fig. 1f). We further examined the relationship between motor control and reward-seeking behavioral performance by analyzing the parameters of motor control. To examine whether general movement parameters, such as speed and acceleration, could be the main cause for these improvements, we compared the motor control between experimental and control conditions. The movement of the control group showed similar general motor parameters (for example, speed and acceleration) to the experimental group (Fig. 1c,d). Overall latency to the reward decreased with training, indicating the increased effectiveness of the animals' movements at achieving rewards (Fig. 1g). We observed that mice showed increased proximity to the goal with learning, by tuning their movement to the goal (Fig. 1h). The movement accuracy as the percentage of goal-aimed movements increased with training ( Fig. 1i), indicating that the enhanced movement direction (MD) controls toward the goal spot. Mice in the experimental group showed better control in turning toward the goal during navigation than the control (Fig. 1j,k). These results indicate that the directional control of movement is improved with learning.

Motor learning refines direction coding
To determine how neurons mediate precise motor control with learning, we examined direction coding of M2 neurons at the cellular and population levels. To test whether M2 is required for neuronal adaptation to control task-related motor behavior, we used an adeno-associated virus (AAV)-based approach to express tetanus toxin light chain (TeTxLC), which abolishes presynaptic vesicle release 23,24 , in M2 excitatory neurons (Extended Data Fig. 1a and Supplementary Movie 2). Mice expressing TeTxLC in M2 excitatory neurons (CaMKII-TeTxLC mice) showed deficits in learning the task (Extended Data Fig. 1e). The reward-seeking behavioral parameters did not improve with training (Extended Data Fig. 1e-j), suggesting that M2 neurons play an essential role in mediating the motor learning required for the task. We performed two-photon Ca 2+ imaging in L2/3 of M2 with a genetically encoded calcium indicator, GCaMP6s, while mice navigated on the ball maze (Extended Data Fig. 2a). Consistent with the established role of M2 in motor planning, overall population activity in L2/3 correlated with locomotion (Extended Data Fig. 2b). Individual premotor neuron activities bi-directionally changed in a time-locked fashion at movement onset (Extended Data Fig. 2c). Most neurons were movement related (total 98.0%; positively correlated: 79.7 ± 3.3%; negatively correlated: 18.4 ± 3.2%; and not correlated: 2.0 ± 0.4%; see Methods for classification), and the proportion of movement-related neurons in the population remained relatively constant throughout training sessions (Extended Data Fig. 2d).
We next measured direction selectivity of individual premotor neurons over training and analyzed the changes. Distinct neuronal populations responded to different MDs ( Fig. 2a and Extended Data Fig. 2e-g). A subset of L2/3 neurons exhibited tuning to the MD, which was defined as its preferred direction (PD). Its topological map was arranged in a salt-and-pepper pattern in the M2 area (Extended Data Fig. 2i,j).
We estimated the likelihood distributions of neural tuning curves as a function of MD (Fig. 2b). Premotor neurons showed the highest likelihood to fire at their PD. We defined population tuning precision as the reciprocal of the variance of total neural activity given MD. Tuning of premotor neurons to MD became more precise over sessions. The precision of population responses increased for all MDs in the experimental group but not in the control group (Fig. 2c,d). We next estimated the probability of the cell being active as a function of the distance between MD and the cell's PD. When the MD was far from the cell's PD (distance from PD > 90°), the probability of being active decreased with learning (Fig. 2e). When the MD was opposite to the cell's PD, the probability of the cell being active was significantly lower in session 7 than in session 1 for mice in the experimental condition but not in the control condition (Fig. 2f).
We took a Bayesian approach to decode the MD from neural activity (Methods). We computed the posterior probability density function to provide the most likely estimate of the mouse's MD during navigation ( Fig. 2g and Extended Data Fig. 3a-c). Moment-to-moment MDs were decoded by the estimated MD corresponding to the maximum value of the posterior probability density function. During behavior, posterior probability density functions of MD sharpened over sessions in the experimental group, enhancing near the MD and waning at null MDs (Fig. 2h). In contrast, posterior functions were flattened over sessions in the control group. Consequently, we observed lower decoding errors in the experimental group (Fig. 2i). Similarly, we tested neural coding of MD based on a population vector (PoV) as a vector sum of PDs of a sparse population of active direction-tuned neurons at a given moment 25,26 (Extended Data Fig. 3d). In this coding scheme, MDs were also flexibly encoded in a moment-to-moment manner from the distinct sparsely distributed activity of neuronal ensembles (Extended Data Fig. 3e,f). The fraction of decoded direction (PoV around 0°) increased and that of anti-decoded direction (PoV around 180°) decreased in session 7 in the experimental group but not in the control group, indicating an increased coding accuracy associated with learning (Extended Data Fig. 3g-i). We further measured angular errors between the active neuron's PD and MD to see how directional neuronal activity was accurately aligned with MD on a moment-to-moment basis. Similar to the change in decoding error, the fraction of PD increased and that of anti-PD decreased in session 7 in the experimental mice, whereas the fraction of anti-PD increased in session 7 in the control mice, indicating that the fraction of irrelevant activity reduced with learning (Extended Data Fig. 3j,k). To test whether the motor learning mediates a direction-dependent change in network connectivity, we compared pairwise correlations between neuronal pairs of diametrically opposed PDs. The pairwise correlations of neuronal pairs decreased in the experimental group as a function of the difference in their PDs, whereas they increased over sessions in the control group (Fig. 2j). These results suggest that the observed reduction of incorrectly tuned responses shapes the direction coding of the M2 population.

Manipulation of PV interneurons disrupts global neural activity
To determine how neuronal ensembles suppress irrelevant activity during learning, we asked how interneurons might be uniquely involved. Several GABAergic interneuron subtypes have been hypothesized to serve specific roles in regulating cortical functions by forming circuit motifs with features such as recurrence and feedforward inhibition 27 . We tested the regulative role of two major interneuron groups that are known to form inhibitory synapses at specific compartments of excitatory PyNs and comprise 70% of all cortical interneurons 28 . Specifically, PV interneurons (PV-INs) inhibit perisomatic regions, and SOM interneurons (SOM-INs) target distal dendrites 29 . We bilaterally silenced activity of PV-INs or SOM-INs during behavior by expressing an inhibitory opsin, eNpHR3.0, in the M2. We found that inactivation of premotor PV-INs disrupted goal-directed motor performance but inactivation of SOM-INs did not, suggesting that perisomatic inhibition mediated by PV-INs may be involved in circuit motifs that guide task-related directional control of movement ( Fig. 3a and Extended Data Fig. 4).
Nature Neuroscience | Volume 26 | August 2023 | 1379-1393 1382 Article https://doi.org/10.1038/s41593-023-01380-x Perisomatic inhibition from PV-INs provides powerful inhibitory control over the principal neuron population [29][30][31][32] . To further examine the role of PV-IN perisomatic inhibition in local neuronal activity during motor control, we abolished presynaptic GABA release from PV-INs by expressing Cre-dependent TeTxLC virus in PV-Cre mice (PV-TeTxLC mice) and monitored the M2 neuron activity (Fig. 3b). Consistent with the notion that PV-INs are critical regulators of cortical excitatory and inhibitory (E/I) balance 33,34 , the abolishment of perisomatic inhibition in PV-TeTxLC mice led to excessively increased overall activity of M2 neurons during movement (Fig. 3c,d) 35 and hypersynchronization at movement initiation, which disrupted the propagation of sequential network activity and decreased the sparseness of neural activity during subsequent movements (Fig. 3e,f). Accordingly, the pairwise correlation and the proportion of pairs with positive correlations were significantly higher in PV-TeTxLC mice than in PV control mice (Fig. 3g,h). A significant proportion of PV-INs also showed increased activity for movement initiation (Fig. 3j), suggesting that the excessive activity of M2 neurons in PV-TeTxLC mice may result from unmasked responses of neurons that were previously inhibited by PV-INs ( Fig. 3k-n). These results suggest that PV-IN perisomatic inhibition is involved in task-related motor control, but this manipulation also leads to global excitability changes that limit the applicability of current approaches to specify mechanisms of directional motor control.

Sparse, sequential activity is preserved in ChC manipulation
In our attempt to specify the underlying mechanisms of perisomatic inhibition, we targeted ChCs by using the ChC-specific transgenic mouse line (Nkx2.1-2a-CreER::Ai14 as ChC control mice,     In contrast to the hypersynchronous neuronal activity in PV-TeTxLC mice, we did not observe a global change. Instead, we observed sparse, sequential activity propagation in both ChC-TeTxLC and control mice during movement (Fig. 4c,d). Pairwise correlation indicated local, not global, correlated activity between neuronal pairs in both groups (Fig. 4e). The proportions of pairs with positive and negative correlations were similar between the two groups ( Fig. 4f). In contrast to PV-INs, most ChCs showed increased activity during movement rather than movement initiation (Fig. 4g), and ChC-TeTxLC manipulation did not evoke the excessive activity of M2 neurons at movement onset shown in PV-TeTxLC mice ( Fig. 4h-j). These results demonstrate that ChCs have a distinct activity profile from PV-INs and that overall network excitability is not globally altered by silencing the activity of ChCs.

Inhibition of ChCs disrupts the direction selectivity
The TeTxLC experiments suggest that the major role of ChCs is not control of general network gain but more target-specific control of neighboring neurons. We tested whether ChC suppression would affect the direction tuning of M2 neurons during the behavioral task. We bilaterally expressed FlpO-dependent chemogenetic silencer (AAV9-CAG-dfrt-hM4Di-mCherry) in the M2 of ChC-Flp mice to suppress the activity of ChCs upon the application of clozapine N-oxide (CNO), an hM4Di agonist (Fig. 5a). We first verified the effectiveness of CNO in brain slices. Whole-cell electrophysiological recordings showed that CNO application reduced the activity of ChCs expressing hM4Di (Fig. 5b). After 7 d of training, we administered either saline or CNO. CNO administration in the ChC-Flp:hM4Di mice significantly impaired goal-directed navigation performance and turning movement ( Fig. 5c-f). CNO or saline injection alone had no effect on behavioral performance (ChC-Flp:hM4Di mice with saline, ChC-Flp mice with saline or CNO injection) (Fig. 5d).
To determine the role of ChC activity in the direction tuning of M2 neurons, we co-expressed AAV9-CAG-dfrt-hM4Di-mCherry and AAV1-hSyn-GCaMP6s into the L2/3 M2. We then used chemogenetic manipulations and performed Ca 2+ imaging of ChCs and their neighboring neurons during the behavioral task. In line with the ex vivo results, ChC activity was suppressed upon CNO administration during locomotion (Fig. 5g,h). Consequently, we observed that the co-activity of M2 neurons increased upon CNO application during locomotion but not during rest (Fig. 5i), consistent with recent work demonstrating the inhibitory postsynaptic effects of ChCs on M2 neurons in vivo 17,31 . We compared the likelihood distributions of neural tuning curves as a function of MD with and without CNO administration. We observed that neurons are more likely to be active at non-PDs in the CNO (ChC-silenced) condition than in the saline condition (Fig. 5j), resulting in less precise population responses to the MD (Fig. 5k,l). The probability of the cell being active at a certain MD increased upon CNO administration (Fig. 5m). When the MD was at the opposite of the cell's PD, the probability of the cell being active was higher after CNO administration than it had been in session 7 or in the saline condition (Fig. 5n). CNO application increased pairwise correlations between neuronal pairs as opposed to the enhanced decorrelation between pairs seen with learning (Fig. 5o). These results suggest that the suppression of ChC activity increased behaviorally irrelevant neural activity, impairing the precise coding of movement.

Variability of ChC activity increases during learning
To examine the activity dynamics of ChCs during learning, we expressed GCaMP6s in the L2/3 ChCs and recorded ChC activity while mice performed the behavioral task (Fig. 6a). Consistent with previous reports 17, 18 , ChCs displayed increased activity during episodes of locomotion (Fig. 6b), with a more synchronized pattern of activity in session 1. In session 7, activity patterns became more diverse and desynchronous, which led to the formation of subclusters of ChCs (Fig. 6c). To quantify this shift, we calculated the pairwise correlations between ChCs during the behavioral task and found that the correlation decreased and ChCs formed subclusters as learning progressed (Fig. 6d,e). We next examined how temporal relationships between ChCs and M2 neurons change with learning. Various temporal relationships in activity were shown between ChCs and neighboring M2 neurons (Fig. 6f). We calculated cell-to-cell activity correlations (Pearsonʼs correlation) in pairs of ChCs and M2 neurons during locomotion and rest epochs and compared their distributions of correlation coefficients. In session 1, the proportion of high correlation coefficient (corr(r) > 0.6) was decreased during locomotion compared to rest, reflecting the increased decorrelation. In session 7, the overall proportions of positive correlation coefficient (corr(r) > 0) and of negative coefficient (corr(r) < 0) were remarkably decreased during locomotion compared to rest, indicating the enhanced decorrelation in gross pairs of ChC and M2 neuron (Fig. 6g). These results suggest that ChC activity becomes more heterogeneous with learning, and such decorrelated temporal relationship between ChCs and neighboring M2 neurons implies an increased specificity of population activity control.

Abolition of ChC functions impairs refined direction coding
We asked if the abolition of ChC-mediated inhibition would affect the refinement of direction coding and learning ability. We abolished presynaptic ChC GABA release by expressing FlpO-dependent TeTxLC  Fig. 6a-c). The sparse, sequential activity was observed in sparse PV-TeTxLC mice similar to PV control (Extended Data Fig. 6d). However, in contrast to ChC-TeTxLC mice, the sparse PV-TeTxLC mice showed normal improvement of learned performance (Extended Data Fig. 6e,f).
To determine the specific role of ChCs in suppressing irrelevant activity, we analyzed the probabilistic distributions of neural tuning to MD as a function of learning. Compared to the decrease in activity responding to non-PDs seen with learning, ChC-TeTxLC mice did not show a reduced likelihood of non-PD activity over training (Fig. 7m). Although the estimated probability of the cell being active for non-PD movement (distance from PD > 90°) decreased in the ChC control mice with learning, such reduction was not observed in ChC-TeTxLC mice (Fig. 7n). When the MD was opposite to the cell's PD, the probability of the cell being active significantly decreased in the ChC control group but not in the ChC-TeTxLC group (Fig. 7o). Consistently, we found that the decreases in pairwise correlation of neural responses with learning were specific to ChC control but not ChC-TeTxLC mice (Fig. 7p). Additionally, posterior probability density functions of MD were flattened over sessions in the ChC-TeTxLC group, indicating impaired encoding of MD due to the abolition of ChC-mediated inhibition (Fig. 7q). Given that intact ChC inhibition mediated the suppression of incorrectly tuned responses with learning, these results collectively suggest a necessary role of ChCs in refining distributed neural codes for active locomotion control.

Heterogeneous axo-axonic synaptic plasticity during learning
Our imaging data raised the possibility that ChC inhibitory synaptic strength may not be uniformly altered by learning. To understand the cellular evidence in support of this claim, we examined the structural rearrangement of axo-axonic synapses as proxies for the synaptic strength changes in target neurons. We developed an automated detection algorithm to discern the individual structures of ChC innervation on AISs of target PyNs, by using volumetric images of M2 (Extended Data Fig. 7 and Methods). A large number of inhibitory presynaptic and postsynaptic ChC-AIS structures, ChC axonal boutons and gephyrin signals (GABAergic inhibitory synapse scaffolding protein) along the AISs were systematically analyzed in both the experimental group (n = 1,634 AISs in five mice) and the control group with ad libitum water (n = 3,116 AISs in six mice) (Fig. 8a-d). We estimated structural synaptic strength by measuring presynaptic structural efficacy (Pre-SSE) as a presynaptic feature and postsynaptic structural efficacy (Post-SSE) as a postsynaptic feature based on ChC-AIS contacts and the corresponding gephyrin intensity, respectively (Extended Data Fig. 8a). The Pre-SSE and Post-SSE distributions showed intrinsic heterogeneity in both control and experimental mice, indicating uneven inhibitory weights for connections between ChCs and M2 neurons ( Fig. 8d-h). These imaging results are consistent with early Golgi staining and recent electron microscopy data that show non-random distribution of ChC   18,38 . The strong correlation between Pre-SSE and Post-SSE showed the balance of presynaptic and postsynaptic strengths on AIS (Fig. 8i). A subset of ChCs in the prelimbic cortex was reported to selectively control PyNs located more superficially (<50 μm from L1/2 border) for their specific projection to the basolateral amygdala 31 . We tested whether the heterogeneity among axo-axonic synapses depends on the cortical depth of AIS location. The overall synaptic strengths were not different by the location of AISs in L2/3 of control mice and experimental mice (0-250 μm from L1/2 border, dotted and solid lines in Fig. 8j). However, we found that high and low portions of SSE distribution increased in the experimental group, suggesting that the increased heterogeneity in ChC-PyN connections with learning is not solely based on the cortical depth of AIS location (Fig. 8f,h).
To decipher how learning reorganizes axo-axonic inhibition on AISs, the cumulative density functions (CDFs) of SSEs in the experimental group of mice were compared to the control group (Fig. 8k,l). If a subset of neurons is more tightly controlled by ChCs with learning (reflecting a sparse and determinant inhibitory control), we expect to see an increased percentage of AISs largely covered or scarcely covered by ChC boutons, respectively. Indeed, we observed an increased portion of both weak and strong ends in the distributions of Pre-SSEs and Post-SSEs in the trained mice. Classifying AISs into three subgroups by their SSE strength (high, mid and low), 4-9% of ChC-AISs underwent structural changes from mid to high or low (Fig. 8m,n). To validate whether this alteration was a result of training and not of high variance among samples (Extended Data Fig. 8b-e), we performed a bootstrapping test (n = 3,000 random sampling) on the data from each mouse (Extended Data Fig. 8f-i). Obtained from multiple bootstrapping tests (n = 10), changes in the SSE distributions for trained mice showed increases in high (>1.5 for Pre-SSE, >0.6 for Post-SSE) and low (<0.5 for Pre-SSE, <0.1 for Post-SSE) value ranges (Fig. 8o,p). We found increased divergence only between the experimental and control groups (Extended Data Fig. 8f-i, Exp. versus Ctrl.) and not between other condition comparisons (Exp. versus Exp.; Control versus Control; Unlabeled versus Unlabeled). The alterations in each subgroup were analogous and tested as significant (Fig. 8q,r). Thus, these data suggest that ChCs differentially regulate the degree of inhibition applied to each axo-axonic synapse during learning (Fig. 8s).

Discussion
Given the diversity of interneuron types and their specific connectivity in neural circuits, it has been a longstanding belief that the impact of inhibition on neural computation depends on a combination of interneuron cell types and their connectivity patterns 30,[39][40][41] .
Genetically defined interneuron groups, such as PV, SOM and VIP, and their connectivity motifs have profoundly advanced understanding of cortical computation and psychiatric disorders. Different interneuron subtypes display their own circuit motifs, but subtypes remain widely heterogeneous. Therefore, the precise and unique roles of inhibition mediated by most single interneuron subtypes are still not fully understood.
Despite the discovery of ChCs over four decades ago 42 and their clinical relevance to neuropsychiatric disorders such as schizophrenia characterized by GABAa receptor dysregulation at AIS 43 , the functional role of ChCs in cognition and behavior has been enigmatic. Using a combination of chronic two-photon population imaging together with analyses on the structural plasticity at axo-axonic synapses, we demonstrated a critical role of the ChC in shaping the cortical coding of L2/3 M2 neurons during motor learning. ChC activity was necessary for improving the precision and accuracy of directional movement control. ChCs fine-tune the direction selectivity of individual premotor neurons and their collective tone. Notably, global population activity was not perturbed when ChCs were blocked. The necessary role of ChCs without perturbing overall network excitability implies that ChCs mediate their regulatory effect by establishing a specific neuronal connectivity pattern for learning. Quantification of a large number of ChC-AIS synapses uncovered revealed that subsets of them underwent modifications associated with learning. This analysis revealed a significant degree of heterogeneity, which provides evidence of unequal inhibitory weighting among ChC-PyN connections during learning.
Diverse interneurons have been shown to be involved in motor learning by shaping neuronal population activity. Particularly, it has been shown that SOM-INs targeting the dendrites and spines of PyNs in the primary motor cortex undergo plasticity during motor learning and control learning-dependent sequential activation of PyNs in a manner similar to what is attributed to ChCs here 44 . In addition, inhibiting SOM-INs during new learning destabilized previous learning-dependent sequential activity of PyNs, suggesting the importance of SOM-IN inhibition for maintaining previously learned sequential activation patterns and behavioral improvement when a new motor skill task is introduced. However, in our study, we observed that acute optogenetic suppression of SOM-INs did not significantly disrupt navigation task performance after learning had been established ( Fig. 3a and Extended Data Fig. 4). Given the reduced activity of SOM-IN activity during learning and partial restoration of naive-like activity by post-learning SOM-IN reactivation 45 , the acute post-learning inhibition of SOM-INs is less likely to dominantly regulate neural representations formed with learning. We cannot rule out the possibility that SOM-INs are involved in shaping learning by dendritic-specific computation and proportional changes (experimental versus control) in the probability of each subgroup (q,r), which is confirmed by 10 independent robust random samplings (n = 3,000 each). In both SSEs, high and low subgroups were increased. The results were compared to proportional changes between unlabeled random pairs. For bootstrapping statistics (o-r), the mean and error of each bin were calculated from 10 distributions generated by independent robust random sampling (n = 3,000). For each random sampling, the probability distribution of a mouse was randomly selected from each condition (experimental and control) and used to calculate differences. Error bars indicate s.d.; P = 2.0 × 10 −4 for all bins. s, Model for axo-axonic structural plasticity by heterosynaptic competition. The CDFs were tested by two-tailed two-sample Kolmogorov-Smirnov test, and the other distributions were tested by two-tailed Wilcoxon-Mann-Whitney test. Scale bars, 100 μm (a,e-h) and 5 μm (b,d). Every fluorescence image is presented by maximum intensity projection of the corresponding volumetric stack with pseudo-colors. ***P < 0.001; ****P < 0.0001; *****P < 0.00001. C, control; E, experimental; Exp., experimental.   through synaptic plasticity on the dendritic spines of PyNs. It is possible that the suppression of irrelevant activity that is attributed to ChCs in the present study can be partly mediated by SOM-INs via their recurrent connectivity 46 . Subpopulations of SOM-INs increase and decrease activities during motor learning in a task-specific manner 44 . It is likely that diverse and task-specific activity of SOM-INs may mediate the temporal shift of motor learning-induced sequential activity in PyNs, which can complement organized population coding in sequence during goal-directed navigation.
The abolishment of perisomatic inhibition in PV-TeTxLC mice excessively increased the overall activities of M2 neurons, consistent with the notion that PV-INs are critical regulators of cortical E/I balance 33,34 . Perisomatic inhibition from PV-INs provides powerful inhibitory control over the PyN population [29][30][31][32] . Fast-spiking PV basket cells (PV-BCs) are well suited for regulating the balance, gain and network oscillation of relatively broad PyN populations 47,48 . Balanced and delayed inhibition of fast-spiking INs with movement activity may provide temporal sharpening of motor command and suppress irrelevant activities 35 .
PV-BCs and ChCs have different dendritic arborizations and laminar locations of their soma. They receive spatiotemporally distinct patterns of excitatory synaptic inputs from local PyNs, long-range thalamocortical connections and neuromodulatory inputs and, in turn, form different recurrent feedback excitation and inhibition patterns in a microcircuit 49,50 . The distinct wiring features and output properties of PV-BCs and ChCs may give their differential control over the spike-timing of PyNs 51 . Different cholinergic modulatory effects of synaptic inhibition between ChCs and PV-BCs have been reported 52 . Notably, a previous in vivo study showed that ChCs significantly increase their firing rate during arousal when brain states switched from slow to theta oscillations in the hippocampus and showed a low-amplitude desynchronized field potential in the prelimbic cortex, whereas the firing rates of PV-BCs and PyNs remained unchanged 53 . Given that arousal is often associated with cholinergic signaling, differential modulation by cholinergic receptor activation between ChCs and PV-BCs may result in their distinct contributions to population activity control in a state-dependent manner. A future study is needed to further clarify the functional difference between ChCs and other types of BCs in behavior control, which is important to specify the role of perisomatic inhibitory circuit motifs.
Our findings support a model that ChCs exert differential strengths of control over subsets of PyNs after learning. There exists substantial variability in the magnitude of ChC input to PyN AISs 18,38 . This variability reflects the ability of ChCs to regulate their inhibitory strength based on the characteristics of its target cell and may have a role in shaping the functional properties of PyNs. Variability in the number of axo-axonic ChC synapses correlated with structural features of individual target PyNs, including laminar depth of the soma, other sources of perisomatic inhibition and size of soma and AIS 18 . The innervated PyNs are not distributed at random but, rather, show a clustered distribution in a spatially heterogeneous fashion 54 , supporting the existence of target selectivity and/or avoidance by ChCs on local PyNs. Two factors possibly select PyNs for stronger/weaker inhibition. First, ChCs differently inhibit PyNs based on the projection targets of the PyNs. Recent studies showed that a subset of L2 ChCs selectively innervates PyNs projecting to the basolateral amygdala over those projecting to the contralateral cortex in the prelimbic cortex 31 . Second, ChCs differentially inhibit PyNs in an activity-dependent manner during learning 55 . In this study, we analyzed a restricted subset of ChCs in the L2 and sampled neighboring PyNs in the shallow part of L2/3. Deeper L2/3 PyNs may have different projecting targets. Nevertheless, our findings on learning-dependent changes of axo-axonic synapses in the shallow L2/3 suggest that the difference in ChC-mediated inhibition does not solely result from the anatomical properties of target neurons. Given experimental evidence for the activity-dependent structural plasticity of axo-axonic synapses [56][57][58] , it is conceivable that the plasticity of axo-axonic synapses provides an activity-dependent regulatory mechanism in the cell-by-cell level to fine-tune neuronal excitability across diverse cells involved in different functional networks. This can be mediated through precise inhibitory synaptic plasticity, which has been theoretically suggested as essential for the formation and maintenance of functional cortical circuitry 59,60 . Our findings suggest that the learning-dependent synaptic plasticity of axo-axonic synapses provides individualized inhibition to each PyN, which is adjusted to precisely balance excitation and inhibition based on the relevancy of its activity to the task goal.
Our measures of direction selectivity and population vector coding of MD may not fully capture high-order representations, such as state-dependent action selection. It is presumed that multiple other inputs, such as cholinergic, thalamic and other cortico-cortical inputs, innervate ChCs and PyNs. Premotor mechanisms of direction selectivity coding, MD and inhibitory synaptic plasticity coming from different inputs remain to be studied.
Here we revealed a specialized inhibitory role for ChCs in experience-dependent plasticity of cortical coding, which allows for flexible and robust learned behavior. Given the unknown functions of a number of heterogeneous interneuron types, our results suggest that such heterogeneity may have evolved to serve specific functional needs. Unraveling the multitude of inhibitory effects on neural representation and signal transmission across all cell types is essential for understanding how cognitive functions are internally and externally governed to give rise to meaningful behavior. Precise balance and target-specific inhibitory synaptic plasticity by each inhibitory cell type are thought to contribute to the formation and retrieval of distributed memory, providing fundamental neural circuit architecture for learning. The heterogeneity of inhibitory cell types with their diverse receptors and innervation patterns offer a glimpse into how the intricate and versatile neural coding in the cortex can be adopted to generate complex and flexible behavior. Our work sheds light on the importance of future studies to investigate additional single-cell type-specific plasticity rules and their impacts on network activity and behavior.

Online content
Any methods, additional references, Nature Portfolio reporting summaries, source data, extended data, supplementary information, acknowledgements, peer review information; details of author contributions and competing interests; and statements of data and code availability are available at https://doi.org/10.1038/s41593-023-01380-x.
Publisher's note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.

Animals
C57BL/6J, PV-Cre (cat. no. 8069), SOM-Cre (cat. no. 13044), Vipr2-Cre (cat. no. 31332) and Ai14 (cat. no. 7914) mice from Jackson Laboratory and Swiss Webster (cat. no. 24) mice from Charles River Laboratories were used in this study (4-9 weeks old, both sexes). All mice were maintained on a 12-h light/12-h dark cycle. All experimental procedures were carried out in accordance with protocols approved by the Johns Hopkins University Animal Care and Use Committee, the Max Planck Florida Institute for Neuroscience Institutional Animal Care and Use Committee (protocol no. MO22M170) and National Institutes of Health guidelines. For genetically targeting ChCs, Nkx2.1-2a-CreER was mainly used throughout the study, and, when Vipr2-Cre mice became available, Vipr2-Cre mice were also used for the specifically mentioned experiments. Both lines targeted ChCs efficiently. Swiss Webster mice were used as the background strain for Nkx2.1-2a-CreER mice, and C57BL/6J mice were used as the background strain for Vipr2-Cre mice. Nkx2.1-2a-CreER and ROSA-Flex-FlpO mouse lines were generated in the laboratory of Hiroki Taniguchi at the Max Planck Florida Institute for Neuroscience. For Nkx2.1-2A-CreER mice, a 2A-CreER cassette was inserted in the frame immediately after an open reading frame of an Nkx2.1 gene. The targeting vector containing 5′ and 3′ homology arms, a 2A-CreER cassette, an frt-Neo-frt cassette and an HSV-TK gene was constructed. For FLEX-Flp mice, the targeting vector containing Rosa26 homology arms, a CAG promoter and a FLEX-Flp cassette was constructed. Both targeting vectors were generated using a PCR-based cloning strategy. 129SVj/B6 F1 hybrid embryonic stem (ES) cells (V6.5) were electroporated with the targeting vectors and subjected to drug resistance tests. Neomycin-resistant ES clones for Nkx2.1-2A-CreER and FLEX-Flp were screened by mini-Southern blotting and PCR, respectively, for correct targeting. Positive ES clones were used for tetraploid complementation to obtain male heterozygous mice following standard procedures. Nkx2.1-2a-CreER::Ai14 and Nkx2.1-2a-CreER::Flex-FlpO mice were generated by crossing Nkx2.1-2a-CreER with Ai14 and ROSA-Flex-FlpO mouse lines, respectively. Both created ChC mice showed no visible behavioral phenotypes and were able to learn the behavior task used in this study. Both male and female animals were randomly allocated to experimental groups. A group of animals treated by different genetic or pharmacological manipulations was randomly assigned for experiments. Data collection and analysis were not performed blinded to the conditions of the experiments.

Tamoxifen administration
Tamoxifen (Tmx) was administered to timed pregnant Swiss Webster females that were bred to Nkx2.1-2a-CreER::Flex-FlpO males by oral gavage at embryonic day 17 (E17) to induce CreER activity in the offspring. To achieve a high density of ChCs, the Tmx dose was adjusted to 3 mg per 30 g of body weight. Tmx solution was prepared at a working concentration of 20 mg ml −1 in corn oil (Sigma-Aldrich), kept protected from light and kept refrigerated for no longer than 1 month.

Behavior training in a floating ball maze
More than 2 weeks (19-25 d) after virus injection, mice were trained to perform a tactile-based spatial navigation task while head-restrained on a custom-made spherical floating ball maze 22 . Mice in the water-restricted group were water restricted at 1 ml per day for 1 week before training started. Mice in the control group were given ad libitum water access, and, in addition, 2 ml of 10% sucrose was given 30 min before training. The floating ball maze was made of an air-supported 8-foot-diameter spherical styrofoam ball with quadrants that have different tactile surface textures (for example, plain, grooved, striped and grid). A simple auditory tone (8 kHz for 2 s) was delivered at the beginning and end of training. During navigation, mouse movement was monitored by a CMOS camera (Thorlabs), and ball movement was continuously monitored and recorded by a Bluetooth motion sensor (LPMS-B, LP-Research) placed at the center of the ball. Mice were trained to navigate to find a hidden goal location (surface area of 30° solid angle) in which a 10% sucrose reward (~10 μl per reward) was delivered if they were on the location. To facilitate animals' exploration, a brief air puff (60 p.s.i., 200 ms) was applied to their hind limbs if they did not move for 30 s. The reward was delivered via a lick port positioned in front of the mouse's mouth, and its timing was controlled by a solenoid valve (NResearch). To prevent excessive stay within the goal location and excessive access to the goal, a 3-s refractory period was assigned for the reward. Either a stay in the goal location or a re-visit to the goal location within 3 s from the last reward did not provide an additional reward. The behavioral setup was controlled by a custom-written code in MATLAB (MathWorks). Daily training sessions lasted 800 s and occurred for 7 d.

Optogenetic inhibition of PV-positive and SOM-positive INs
We bilaterally injected AAV9-EF1a-DIO-eNpHR3.0-eYFP-WPRE-hGH (400 nl, Penn Vector Core) into the L2/3 M2 of PV-Cre mice or SOM-Cre mice and implanted fiber-optic cannulae (200-μm core, 0.37 NA, BFL37-2000, Thorlabs) with head plates. After 2 weeks of recovery from surgery and 1 week of water restriction, mice were trained on a floating ball maze for a session (800 s) per day for 7 d. After 7 d of training, mice were trained for a session and simultaneously received bilateral optogenetic inhibition using 589-nm light administration (continuous 800 s during the session, ~10 mW power at the optic fiber tip, MBL-FN-589, Changchun New Industries Optoelectronic Technology) through the fiber-optic cannulae. On the following day, mice were trained without optogenetic inhibition as a control.

In vivo two-photon imaging
Imaging was conducted with a two-photon microscope (Bruker) using two pulsed Ti:sapphire lasers tuned to a wavelength of 920 nm (MaiTai HP DeepSee, Newport Spectra-Physics) for GCaMP6 signals or a wavelength of 1,045 nm (HighQ-2, Newport Spectra-Physics) for tdTomato and mCherry signals. The calcium imaging dataset was motion corrected using a custom-written MATLAB code based on a full-frame cross-correlation image alignment algorithm. Regions of interest (ROIs) were semi-automatically drawn using a custom algorithm based on fluorescence intensity, cell size and cell shape by visually inspecting movies, average of movies and s.d. of movies and then selecting neurons that showed fluorescence transients at least once during a session. The same area was imaged across training days to trace changes from same ensembles, but, due to intrinsic tissue movement, neuronal activity was realigned when calcium signals were analyzed. All pixels within each ROI were averaged to create a fluorescence time series, F. Surrounding 'neuropil ROIs' were drawn from 0.3 μm outside of the border of each neuronal ROI to 10.0 μm outside. Neuropil ROIs excluded adjacent neuronal ROIs. Pixels within neuropil ROIs that showed apparent calcium transients exceeding 3 s.d. of the difference in fluorescence between each neuropil ROI pixel time series and the neuronal ROI time series were excluded from further analysis. The remaining neuropil ROI pixels were considered as background fluorescence and averaged to create a time-varying background fluorescence trace. The time-varying baseline (F0) of a fluorescence trace was estimated by the following procedure. A preliminary baseline fluorescence time series, Pre F0, was LOESS smoothed with 120 frames. Preliminary ΔF, Pre ΔF, was obtained by subtracting Pre F0 from F. Noise of Pre ΔF was estimated by subtracting LOESS-smoothed Pre ΔF from the s.d. of Pre ΔF. The offset of ΔF was determined by the mean of the distribution of Pre ΔF that did not exceed two times the noise. The baseline fluorescence trace, F0, was estimated by adding the offset to Pre F0. ΔF/F for neuronal ROIs was obtained by subtracting F0 from F and dividing it by F0. The background fluorescence trace ΔF/F for neuropil ROIs was estimated in the same manner-that is, as the ΔF/F for neuronal ROIs. The background fluorescence trace was subtracted with a 0.7 weight from the neuronal ROI fluorescence trace for each neuronal ROI. For pixel-based imaging analysis of MD, fluorescence change maps of images were color-coded by MD and averaged. For pixel-based analysis of different movement paths, fluorescence change maps of images for each movement path were differently color-coded and overlaid.

Tissue fixation, immunohistochemistry and acquisition of confocal and light-sheet microscope images
Animals were deeply anesthetized with a mixture of ketamine and xylazine and then perfused transcardially, first with PBS (pH 7.4) and next with 4% paraformaldehyde (PFA) dissolved in PBS. The brains were removed and post-fixed in 4% PFA overnight at 4 °C. For confocal microscope images, the brains were embedded in 10% melted gelatin solution for 50 min at 50 °C. Melted gelatin solution was then refreshed, and the gelatin solution with the embedded brains was solidified at 4 °C for about 30 min. Then, the solidified gel was trimmed around the embedded brain to a small cube shape, and the cube was stored in 4% PFA overnight. The gelatin cube brain was coronally sectioned (100 μm thick) using a vibratome (Leica Biosystems). For PV immunohistochemistry, after blocking with a solution (1% normal donkey serum/0.1 Triton X-100 in PBS), brain slices were incubated in primary antibodies (1:500 mouse anti-PV, P3088, Sigma-Aldrich) for 48 h at 4 °C. After washing three times in PBS, the brain slices were incubated in a secondary antibody (Cy5-conjugated donkey anti-mouse IgG, cat. no. 715-585-150, diluted 1:1,000 in PBS, Jackson ImmunoResearch) for 2 h at room temperature, followed by three washes in PBS. The brain slices were mounted on the slide glass with a DAPI-containing mounting solution (DAPI Fluoromount-G, SouthernBiotech). For Nkx2.1-2a-CreER::Ai14 and Nkx2.1-2a-CreER::Flex-FlpO mice immunohistochemistry, after i.p. administration of ketamine/xylazine mixture (50 mg kg −1 ketamine, VETCO, 5 mg kg −1 xylazine, AKORN) and a foot pinch to check adequate sedation, the mice were trans-cardially perfused with 15 ml of cold saline solution, followed by 20 ml of cold 4% PFA solution in PBS. After post-fixation in 2% PFA in PBS overnight, 60-μm brain sections were prepared using a Leica vibratome and collected in PBS, permeabilized in 0.5% Triton X-100 in PBS followed by washing for 1 h in blocking reagent (BR: 0.1% Triton X-100 and 10% donkey serum in PBS). The sections were treated in primary antibody solution in BR overnight at 4 °C. The following primary antibodies were used: rat anti HA (1:500, Roche, cat. no. 11-867-423-001), chicken anti GFP (1:800, abcam, cat. no. ab13970) and mouse anti-AnkG (1:500, UC-Davis/NIH NEUROMAB,

Nature Neuroscience
Article https://doi.org/10.1038/s41593-023-01380-x cat. no. clone N106/36 75-146). After three washes (10 min) in PBS, the slices were incubated in BR with secondary antibodies ( Jackson ImmunoResearch) for 2 h at room temperature containing appropriate fluorophores (CyX or Alexa) at 1:1,000. The slices were embedded in Fluoromount-G (Thermo Fisher Scientific) (K1) after two final washing steps in PBS. The fixed and immuno-stained brain slices were imaged using an upright confocal microscope (Zeiss LSM880). For light-sheet microscope images, brains were perfused as described above and coronally sectioned (2 mm thick) using a vibratome (Leica Biosystems). The brain slices were cleared using the Passive Clarity protocol 61 . Images of the cortex were collected with a Zeiss light-sheet microscope at ×25 magnification. Light-sheet microscope image processing and three-dimensional rendering were performed with arivis Vision4D.

Data acquisition and analysis
All data analysis was performed using Excel (Microsoft) and custom codes and toolboxes in MATLAB. Behavioral sessions in which the mouse made more than three successful accesses to the goal were analyzed. The movement signals of the ball maze, including quaternion and angular velocity, were sampled at 100 Hz and smoothed using a LOWESS regression of 500 ms width. We extracted animals' virtual coordinates on the ball relative to the center of the hidden goal spot. We acquired mouse movement-related information based on translational movement (forward and backward; right and left) by using a precise Bluetooth motion sensor (LPMS-B, LP-Research).

Identification of movement bouts
We classified each behavior frame (sampled at 100 Hz, 1-ms bin size) as occurring during either rest or movement. We defined rest frames as those in which the movement speed is less than 0.02 m s −1 and acceleration is less than 0.2 m s −1 . We defined movement frames as those in which a movement speed is greater than 0.03 m s −1 and not classified as rest frames. Parameter values were determined by visually comparing videos with movement speed and acceleration traces. The uncategorized frames that did not meet the above criteria were further categorized as follows. If both ends of the bout of uncategorized frames were connected to rest frames and the duration of the bout of uncategorized frames was less than 1 s, the uncategorized frames were identified as rest frames. If either both ends of the bout of uncategorized frames were connected to movement frames or the state of connected frames of one end of the bout was different from that of the other end, the uncategorized frames were identified as movement frames.

Movement direction
Movement direction (MD) was determined by the inverse tangent of forward-backward speed over right-left speed. Goal angle was defined as the angle passing through the goal spot from the mouse's two-dimensional virtual position. Goal-directed movement epochs were determined if the mouse's MD was within the goal angle. Percentage of goal-directed movement was determined by the ratio of goal-directed movement epochs to overall movement epochs. Goal-directed movement bout was identified as a bout of movement in which mice pursued the hidden goal location and received the reward. Non-goal-directed movement bouts were defined as bouts wherein the animal does not reach the goal.

Classification of movement-related neurons
Modulation of neural activity was frequently observed between movement and rest epochs. We classified individual neurons into three categories: movement-positive, movement-negative and non-movement. Movement-positive or movement-negative neurons were identified if their mean activity during movement epochs was significantly higher or lower than during rest epochs, respectively. If there was no significant difference in mean neuronal activity between movement and rest epochs, neurons were classified as non-movement cells.

Estimation of probabilistic neural tuning curves
To estimate calcium events, calcium signals were deconvolved using an Online Active Set method to Infer Spikes (OASIS) with FOOPSI approach and auto-regressive models with order 2. The values of calcium event estimate s were thresholded to 0, producing binary events that represent estimated calcium events. To focus on the tuning curves of premotor neurons to MD, we, therefore, excluded periods of immobility. Using this event estimate, we computed the probability of a neuron to be active, P(active), as the period of activity of a neuron over the total period of a recording session, which corresponds to the marginal likelihood probability distribution in a Bayesian approach. We divided the MD in 5° bins. Each bin represents a discrete state of MD. We then computed the likelihood probability distribution that a cell is active given MD, P(active|MD i ), as the period of activity in direction state MD i over the total period in state MD i . The distribution was smoothed with a Savitzky-Golay filter. To test s.d. from random firing patterns, we carried out a bootstrapping procedure as follows. For each cell, deconvolved data were circularly shifted by different random values of shifts, and the likelihood probability distribution of the randomized data was estimated. This procedure was repeated 100 times with different random values of shifts. The mean value and s.d. of the randomized dataset were used to compute the z-scored likelihood distribution of actual data. A cell is defined as an active cell if the likelihood distribution of actual data is significantly deviated from that of the randomized dataset (P < 0.05).
Neurons were considered to be directionally tuned if they showed significant tuning with MD (ANOVA, F-test, P < 0.05), and they showed a good fit of tuning function. To obtain the tuning curve, the z-scored likelihood distribution of actual data was fitted with the sum of two von Mises distributions 62 : where R is the response to movement in a direction θ; θ 0 is the PD; and a 0 , a 1 , a 2 and k are fitting parameters. We estimated fitting parameters by using lsqcurvefit in the MATLAB function. The preferred direction PD i for neuron i was defined as the MD corresponding to a peak in the tuning curve response. Neurons were considered to be direction selective if they fit the von Mises distribution well (P < 0.05), and if their Nature Neuroscience Article https://doi.org/10.1038/s41593-023-01380-x direction-selective index (DSI) defined as DSI = R pref −R oppo R pref +R oppo was greater than 0.4, where R pref and R oppo are the mean of the normalized response to the PD and that of the opposite direction (the PD + π), respectively.

Bayesian decoding analysis
In addition to the estimation of the likelihood distribution, P(active|MD i ), we computed the probability of being in a given state of movement direction, MD i , P(MD i ), as the period in the direction MD i over the total period of a recording session, which corresponds to the prior probability distribution. Using Bayesian approaches 63 , we inferred the posterior probability distribution function that the animal is in an MD given the activity of active neuron k at a given time point t.
where P(MD|active) is a vector of a posterior probability distribution of behavioral states, and N corresponds to the number of neurons used.
To decode the direction of movement, we considered the direction associated with the maximum a posteriori (MAP).

S = argmaxP(MD|active) = argmax P(active|MD)P(MD) P(active)
where Ŝ is the decoded MD. The decoding error was computed as the angular difference between the decoded and actual MD at the observed time.

Pairwise correlations
We calculated pairwise correlations between neuronal pairs by measuring coincident events 64 . For neuron i, the events E i were vectorized in a binary manner. The pairwise correlation for the pair i and j is given by where N is the number of image frames, and ⟨E i ⟩ is the expected number of events for neuron i. We categorized positively and negatively correlated pairs if the confidence interval is greater than 0 and less than 0, respectively.

Automated detection of ChC-AIS
To label ChCs in M2, we injected AAV1-CAG-Flex-TdTomato (400 nl, Addgene, cat. no. 28306) into L2 of M2 in Vipr2-Cre mice. Once the brain slices were stained with immunohistochemistry and imaged through the confocal microscope described in the 'Tissue fixation, immunohistochemistry and acquisition of confocal and light-sheet microscope images' subsection, each stack of tiled confocal images (generally 3,800 × 1,950 × 10 in pixel or 400 × 206 × 10 in μm) from three different fluorescence channels (green for gephyrin puncta antibody, red for TdTomato expressed in ChC projection and far-red for ankyrin G (AnkG) antibody targeting AIS) was processed simultaneously to detect AISs innervated by axonal cartridges of ChC and co-localized gephyrin puncta using a custom-written program in MATLAB. Features of processed images were segmented automatically by boundary detection (bwboundaries function, MATLAB) in each planar image of red and far-red channels after binarization by adaptive threshold (adaptthresh function, MATLAB, sensitivity = 0.08 and neighborhood size = 19 for AIS, sensitivity = 0 and neighborhood size = 15 for ChC). Segments in different axial planes were then filtered through several criteria, including intensity, size and width, and registered to recover the whole AISs or ChC cartridges. Only AISs longer than 10 μm were selected for the further analysis. For each registered AIS, we overlaid its segment on detected ChC cartridges in each axial plane and classified it as a ChC-AIS when any co-localized area existed. For demonstration purposes, fluorescence images shown in figures are maximum intensity projections of corresponding volumetric stack with pseudo-colors.

Quantification of characteristic parameters
For each detected ChC-AIS segment, we calculated the lengthwise axis. Projected intensity profiles of ChC and AIS on the axis were then applied to measure the total AIS length (L AIS ), the ChC cartridge length (L ChC ) and the AIS length covered by ChC (L ChC_AIS ). To ensure the exact L ChC measurement, we extended the ROI 5 μm longer than the detected AIS segments that we identified. Half of the maximum intensity for each profile was used as a threshold for measurement. The area of ChC on AIS (A ChC-AIS ) was calculated as the mask size for segmentation. We computed the normalized ChC-AIS size, the presynaptic parameter, as from these morphological quantities. We used the particle detecting algorithm u-track 65 to identify gephyrin puncta in each plane of the green channel. This algorithm fitted Gaussian kernels approximating the two-dimensional point spread function of the microscope (σ = 1.5 pixel or 234 nm) around local intensity maxima, where both position and amplitude were free parameters in the fit. The intensity of detected gephyrin punctum is represented by a modified z-score calculated from the median and s.d. of all the detected gephyrin puncta from the tiled image.
To evaluate the postsynaptic strength, a detected gephyrin punctum was classified as AIS-associated when its detected position resides in the boundary of a registered AIS. In the same manner, an AIS-associated gephyrin punctum was labeled ChC-AIS-associated when its position co-localizes in the boundary of ChC on AIS simultaneously. Summation of the z-score of gephyrin puncta associated with the total AIS (Z AIS ), and only a portion of ChC-AIS (Z ChC-AIS ) was used for calculation of the corresponding gephyrin intensity, the postsynaptic parameter, as follows: The corresponding gephyrin intensity equals 1 when all the gephyrin puncta on the AIS are located on the corresponding ChC. When the ChC does not have corresponding gephyrin puncta on the bound AIS, its value is 0.

Statistics
Statistical analyses were performed using either MATLAB (Math-Works) or OriginPro (OriginLab). No statistical methods were used to pre-determine sample sizes, but our sample sizes are similar to those reported in previous publications 64 . All statistical tests are described in the corresponding figure legends. Normality of distributions was tested for each dataset using Lilliefors test to decide whether to use parametric or non-parametric tests. For parametric tests, two-tailed Student's t-test, two-sample t-test, two-tailed paired t-test, one-way ANOVA, one-way repeated-measures ANOVA and two-way repeated-measures ANOVA were performed to compare population means across animals and conditions except where noted. For ANOVAs, Fisher post hoc tests were used for multiple comparisons. When sphericity was violated, we used Greenhouse-Geisser correction. Chi-square analyses were used to compare proportions. Pearson's linear correlation coefficient was used to measure the correlation between two variables. For non-parametric tests, two-tailed Wilcoxon-Mann-Whitney test and Friedman test with Dunn post hoc tests were performed to compare the population median and differences with dependent variables across animals and Nature Neuroscience Article https://doi.org/10.1038/s41593-023-01380-x conditions, respectively. Two-sample Kolmogorov-Smirnov test was performed to compare probability distributions between groups. The number of animals and the number of cells used for analysis are specified in the figures, the figure legends and the text.

Reporting summary
Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.

Data availability
The data analyzed for this study are available at https://github.com/ KanghoonJ/Jung_NatNeuro_2023. Additional data that support the findings of this study are available from the corresponding author upon reasonable request. Source data are provided with this paper. Last updated by author(s): Jun 5, 2023 Reporting Summary Nature Portfolio wishes to improve the reproducibility of the work that we publish. This form provides structure for consistency and transparency in reporting. For further information on Nature Portfolio policies, see our Editorial Policies and the Editorial Policy Checklist.

Statistics
For all statistical analyses, confirm that the following items are present in the figure legend, table legend, main text, or Methods section.

n/a Confirmed
The exact sample size (n) for each experimental group/condition, given as a discrete number and unit of measurement A statement on whether measurements were taken from distinct samples or whether the same sample was measured repeatedly The statistical test(s) used AND whether they are one-or two-sided Only common tests should be described solely by name; describe more complex techniques in the Methods section.
A description of all covariates tested A description of any assumptions or corrections, such as tests of normality and adjustment for multiple comparisons A full description of the statistical parameters including central tendency (e.g. means) or other basic estimates (e.g. regression coefficient) AND variation (e.g. standard deviation) or associated estimates of uncertainty (e.g. confidence intervals) For null hypothesis testing, the test statistic (e.g. F, t, r) with confidence intervals, effect sizes, degrees of freedom and P value noted

Data analysis
All quantification methods used in the custom scripts are described in Method Details. The code for semi-automated ROI selection can be found at https://github.com/fitzlab/CellMagicWand. All custom MATLAB codes and the data analyzed for this study are available at https://github.com/KanghoonJ/Jung_NatNeuro_2023. Source data are provided with this paper. . Further requests for data used in this study can be directed to the corresponding author (hkwon29@jhmi.edu).
For manuscripts utilizing custom algorithms or software that are central to the research but not yet described in published literature, software must be made available to editors and reviewers. We strongly encourage code deposition in a community repository (e.g. GitHub). See the Nature Portfolio guidelines for submitting code & software for further information.
nature portfolio | reporting summary

Wild animals
Our study did not involve wild animals.

Reporting on sex
Both male and female animals were used in this study and were randomly allocated to experimental groups. The number of male and females was about the same, 50% each.
Field-collected samples Our study did not involve field-collected samples.

Ethics oversight
All experimental procedures were carried out in accordance with protocols approved by Johns Hopkins University Animal Care and Use Committee, the Max Planck Florida Institute for Neuroscience Institutional Animal Care and Use Committee, and National Institutes of Health guidelines.
Note that full information on the approval of the study protocol must also be provided in the manuscript.