Introduction

The ability to adjust behavioral strategies in response to changing external contexts and internal needs, termed behavioral/cognitive flexibility, requires adaptive processing of environmental cues and internal states to guide goal-oriented behavior, and is vital to the survival of organisms. Inappropriate behavioral adjustments, such as deficits in modifying responses to a rule change, are hallmarks of impaired executive functions and are observed in a broad spectrum of psychiatric disorders 1,2.

Decades of research have strived to uncover the neural substrates of behavioral flexibility (e.g., see reviews 16). Set shifting, a type of rule switching that requires attending to or ignoring a stimulus feature in a context-dependent way, is commonly used to assess flexibility. The Wisconsin Card Sorting Test, the Intra-Extra Dimensional Set Shift Task and their analogs have been widely used to test the ability of attentional switching in human and animal subjects 714. Importantly, prior research using lesion and pharmacology approaches has provided compelling evidence that the medial PFC (mPFC) plays an important role in set shifting (e.g., 5,1519). The mPFC interacts with various brain regions to support cognitive functions 2,2023, and lesion and pharmacology work has pointed to the importance of the locus coeruleus-norepinephrine (LC-NE) input 2427. However, the precise cellular and circuit mechanisms underlying LC-NE modulation of the mPFC in the context of set shifting are not well understood.

We trained mice to perform a set-shifting task, where they learned to switch attention to discriminate complex sensory cues. Inhibiting genetically-defined LC-NE neurons or their projections to the mPFC severely impaired switching behavior, highlighting the importance of the LC-mPFC circuit. Next, to reveal the neurophysiological substrates, we combined chemogenetic inhibition of the LC with calcium imaging of the mPFC in task-performing mice. We discovered that mPFC prominently responded to attentional switching from single cell to population levels, and that LC inhibition dramatically affected mPFC processing across several domains: 1) a greater proportion of mPFC neurons became responsive to switching-related variables; 2) the tuning of individual neurons was broadened; 3) population dynamics associated with attentional switching was disrupted; and 4) population encoding of switching was impaired. Together, our data provide new cellular and circuit-level insights into LC-NE modulation of mPFC activity that support attentional switching.

Results

We trained mice to perform the freely-moving attentional set-shifting task 17,2830 based on procedures described in previous studies 31,32 (Methods). In brief, mice learned to discriminate complex sensory cues by associating a relevant stimulus feature to reward (Supp. Fig. 1). In most stages of the task (simple discrimination, compound discrimination, intra-dimensional reversal, intra-dimensional shift), the rules change but the relevant stimulus remained in the perceptual dimension of digging medium. In the stage of extra-dimensional shift, the relevant stimulus shifted to the dimension of odor. Mice learned each rule change in a single session, but typically took more trials to complete extra-dimensional shift (Supp. Fig. 1c) 28,3234. According to learning theories, the improved performance in intra-dimensional shift (fewer trials to reach performance criterion when all cues are novel but the relevant stimulus feature remains in the same perceptual dimension as previous rules) strongly suggests that mice attended to the perceptual dimension of digging medium while ignoring the perceptual dimension of odor, and that solving extra-dimensional shift involves a switch in the attended perceptual dimension (attentional switching), rather than purely responding to specific exemplar cues 9,35. Our current work is focused on revealing the neural substrates underlying such attentional switching across perceptual dimensions.

Inhibiting LC-NE neurons or their input to the mPFC impairs switching behavior

First, we wanted to determine whether the LC-mPFC circuit was required for attentional switching. Previous studies suggested the importance of this circuit by lesioning ascending NE fibers or applying local pharmacology in the mPFC 24,25,27,34,36, which broadly targeted NE signaling. To selectively target and perturb genetically-defined LC-NE neurons, we employed a transgenic approach to conditionally express the Cre-dependent inhibitory DREADD receptor hM4Di in the LC of DBH-Cre mice (Test group, Fig. 1a). Dopamine Beta Hydroxylase (DBH) is a key enzyme for NE synthesis and downstream of dopamine. Thus, DBH serves as a specific marker for NE-synthesizing neurons. Control group mice were DBH-littermates and received Clozapine N-oxide (CNO) administrations the same way as test group. DREADD inhibition of LC-NE neurons impaired switching behavior as test group mice took more trials to reach performance criterion (Fig. 1b, trials to reach performance criterion: control vs. test, 14 ± 2 trials vs. 25 ± 2 trials, P = 0.029). Similar behavioral effects were observed when a second control group mice were DBH-Cre expressing Gi-DREADD but received saline injections (Supp. Fig. 2). Together, these data strongly implicate that the behavioral impairment is specific to LC inhibition, instead of nonspecific effects of genetic background, viral expression, or DREADD agonist.

Inhibiting LC-NE neurons or their terminals in the mPFC impair switching behavior.

(a) Schematic of DREADD inhibition in the LC and histological images showing DREADD(Gi) and TH (Tyrosine Hydroxylase) expression in the LC of a DBH-Cre mouse. (b) Task performance in the control (n = 4, WT) and test (n = 5) groups. Following systemic CNO injections, test group mice took more trials to complete extra-dimensional shift (EDS. Trial to reach the criterion: control vs. test, 14 ± 2 trials vs. 25 ± 2 trials, P = 0.028, t = -2.7). (c) Histology showing the expression of EYFP in LC-NE cell bodies (left) and their terminals (right) in the mPFC. AAV carrying Cre-dependent EYFP was injected in the LC of a DBH-Cre mouse. Scalebars: 100 μm. (d) Schematic of inhibiting LC terminals in mPFC and histology displaying cannula placement in the mPFC. (e) Task performance in the control (n = 7, WT) and test (n = 8) groups. Following localized CNO injection, test group mice took more trials to complete EDS (Trial to reach the criterion, control vs test: 16 ± 1 trials vs. 24 ± 2 trials, P = 2.0e-3, t = -3.9).

LC-NE neurons innervate the mPFC (Fig. 1c), but the specific role of their direct input has not been fully explored. To address this question, we expressed Gi-DREADD in the LC (as in Fig. 1a) and locally infused CNO in the mPFC via bilateral cannula implants to perturb the terminals of LC neurons (Fig. 1d, as in 37,38). This approach allows for targeted and specific perturbation of LC-NE input to the mPFC. Control group mice (DBH-) also had cannula implants and received CNO injections in the same manner. Suppressing LC-NE terminals in the mPFC also induced pronounced behavioral deficits, with test group mice requiring more trials to switch to the new perceptual dimension (Fig. 1e. Trial to reach the criterion, control vs. test: 16 ± 1 trials vs. 24 ± 2 trials, P = 2.0e-3). Video analysis suggested that the behavioral impairment was not due to apparent motor or motivational changes (Supp. Fig. 3). Importantly, task performance across different control groups was not different (control group in Fig. 1b vs. Supp. Fig. 1c, P = 0.14; control group in Fig. 1e vs. Supp. Fig. 1c, P = 0.45; control group in Fig. 1b vs. Fig. 1e, P = 0.35). The behavioral impairment of DREADD inhibition was also robust against this insignificant variability across control groups (e.g., LC inhibition group in Fig. 1b vs. Supp. Fig. 1c, P = 8.7e-4; terminal inhibition group in Fig. 1e vs. Supp. Fig. 1c, P = 3.2e-3). Our results add further to recent gain-of-function work 39, providing compelling evidence for the critical involvement of the LC-mPFC circuit in attentional switching.

LC inhibition enhances mPFC engagement and broadens single-neuron tuning

To assess the neurophysiological effects of LC-NE signaling on mPFC activity, we simultaneously induced the expression of Gi-DREADD in the LC and GCaMP6f in the mPFC (Fig. 2a-c). We monitored mPFC activity while inhibiting LC-NE neurons in task-performing mice (446 neurons from 5 test mice). Control mice (DBH-) expressed GCaMP6f in the mPFC and received agonist injections in the same manner (593 neurons from 4 control mice). We first evaluated the overall effect of LC inhibition on calcium activity of mPFC neurons. The frequency and amplitude of calcium transients did not differ between test and control groups, but the test group exhibited a small (∼5%) reduction in transient duration (Supp. Fig. 4).

LC inhibition enhances mPFC engagement and broadens tuning.

(a) Illustration of miniscope recording in the mPFC with DREADD inhibition in the LC. (b) Top: Histology showing lens implant and GCaMP6f expression in the mPFC (prelimbic). Bottom: Snapshot of miniscope recording during behavior. (c) Example time series of fluorescence signals. Over 50 ROIs were acquired from this session. (d) Left to right: Example traces of individual mPFC neurons responding to choice (left), trial history (middle) and switch (right) based on activity prior to choice (gray bars). (e) Example behavioral progression. Each dot represents a trial. We define the initial mixed correct and incorrect trials (rule-learning) and the last set of consecutive correct trials (rule-following) as two different states in switching behavior. (f) Bar plots showing the percentage of mPFC neurons responding to task-related variables in the control (black) and test (red) groups. Control vs. test, choice responsive: 10% (59/593) vs. 17% (76/446), P = 7.7e-4; history responsive: 6% (34/593) vs. 13%, (57/446), P = 7.0e-5; switch responsive: 17% (102/593) vs. 25%, (111/446), P = 2.4e-3; overall fraction of responsive neurons: 27% (159/593) vs. 40% (178/446), P = 8.1e-6; the fraction of mixed tuning neurons among all responsive neurons: 20% (31/159) vs. 33% (59/178), P = 4.7e-3, Chi-squared test.

Next, we examined how single-neuron response during attentional switching was affected by LC inhibition. Following recent work 40,41, we used the time of choice (digging) to infer decision formation and classified the representation of individual mPFC neurons based on their pre-choice activity. We first presented the results from the control group. We identified subgroups of mPFC neurons whose activity was tuned to different task-related variables, such as choice, trial history and the putative switch of attention (Fig. 2d, Methods), consistent with a series of previous work (e.g., 4248). Since the rule change was not cued, at the beginning of extra-dimensional shift, animals followed the previous rule and attended to the perceptual dimension of digging medium and ignored odor cues 28. Through trial- and-error learning animals eventually switched their attention to the perceptual dimension of odor 42,44. Following prior studies 49,50, we thus inferred the early mixed correct and incorrect trials and the late set of consecutive correct trials as different states of switching behavior (Early: trial-and-error learning; Late: rule following. Fig. 2e). Notably, more neurons responded to switch than to choice or trial history (fraction of neurons, switch vs. choice: 17% (102/593) vs. 10% (59/593), P < 1e-3; switch vs. history: 17% (102/593) vs. 6% (34/593), P < 1e-3, chi-squared test. Fig. 2f), suggesting the importance of representing this task-related variable in the mPFC. We further noted that a considerable fraction of mPFC neurons responded to more than one task-related variable (mixing tuning 42,45,5153, Supp. Fig. 5). To better determine choice-related behavior, a second side-view camera was set up, and the temporal difference between digging onset estimated from the two cameras was minimal (Supp. Fig. 6), confirming the fidelity of the timestamps used for data analysis.

During LC inhibition, we also observed more mPFC neurons tuned to switch (fraction of neurons in the test group, switch vs. choice: 25% (111/446) vs. 17% (75/446), P = 3e-3; switch vs history: 25% (111/446) vs. 13% (57/446), P < 1e-3, chi-squared test). More importantly, in comparison to the control group, LC inhibition engaged a greater fraction of mPFC neurons responding to task-related events (Fig. 2f, control vs. test, choice responsive: 10% (59/593) vs. 17% (75/446), P < 1e-3; history responsive: 6% (34/593) vs. 13% (57/446), P < 1e-3; switch responsive: 17% (102/593) vs. 25% (111/446), P = 2.4e-3; overall fraction of responsive neurons: 27% (159/593) vs. 40% (178/446), P < 1e-3, chi-squared test). The fraction of mixed-tuning neurons was also enhanced with LC inhibition (20% (31/159) vs. 33% (59/178), P = 4.7e-3). Our results show that LC inhibition increases mPFC engagement in the task and broadens the tuning of individual neurons.

LC inhibition impedes dynamic changes in population activity during switching

Our single-neuron analysis suggests the importance of encoding the switch of attention in the mPFC as more neurons were tuned to this parameter in both control and test groups (Fig. 2f). Neuronal ensembles have been proposed to be the functional unit of the nervous system 5457. They can better represent information than single neurons 46,58,59, especially in higher-order association areas where single neurons exhibit mixed tuning 51,60,61. Thus, we sought to determine whether and how switch was represented at the population level. We first employed a dimensionality-reduction approach to assess mPFC population dynamics (Methods). Specifically, we examined whether mPFC dynamic processes represent the putative switch of attention. Principle component analysis (PCA) was applied to population activity of mPFC neurons around the time of choice in the early and late switching states (Fig. 2e), and the degree of separation between the resulting low-dimensional state vectors was quantified. In the control group mice, we identified an overall prominent separation between the two population vectors representing early and late states (Fig. 3a, b, gray vs. black traces), strongly suggesting that a shift in population dynamics is associated with attentional shifting across perceptual dimensions. The vector separation also exhibited transient fluctuations prior to choice, first increasing and then decreasing (Fig. 3c, black), suggesting a dynamic decision-related population encoding process underlying the behavioral transitions. Overall, our results suggest that mPFC dynamics reflect the changes in switching behavior and learning of the new rule.

LC inhibition dampens mPFC population dynamics during switching.

(a) Population vectors of mPFC activity representing early (light color) and late (dark color) states in control (black, left) and test (red, right) groups. Each line represents a population vector from a subset of neurons. (b) Projection of population vectors in (a) onto the first two PCs. (c) Left: Euclidean distance (mean ± SEM) between state vectors aligned to choice for control (black) and test (red) groups. Arrows indicate maximal fluctuations prior to choice (peak). Right: Comparison of Euclidean distance quantified prior to choice for control (black) and test (red) groups. Control vs. test, 12.8 ± 0.05 vs. 8.9 ± 0.03, P = 6.8e-8, rank sum = 610, n = 20. Sample size represents number of bootstraps. (d) Comparison of peak Euclidean distance quantified prior to choice for control (black) and test (red) groups. Control vs. test: 4.1 ± 0.14 vs. 2.0 ± 0.07, P = 6.8e-8, rank sum = 610, n = 20. (e) Comparison of vector similarities between the early and late states for control and test groups. Correlation coefficient, control vs. test: 0.15 ± 0.03 vs. 0.95 ± 0.01, P = 6.8e-8, rank sum = 210, n = 20). Black and red dots indicate group mean in (c-e).

How would LC-NE input affect mPFC dynamics during switching? In test group mice, the same dimensionality-reduction analysis revealed that the low-dimensional population state vectors (early and late) were less separable (Fig. 3a, b, light and dark red traces), and the distance between the two state vectors was greatly reduced compared to the control group (Fig. 3c, control vs. test, 12.8 ± 0.05 vs. 8.9 ± 0.03, P < 1e-3). In addition, LC inhibition prominently dampened the pre-choice dynamic fluctuations (Fig. 3c, d. Peak, control vs. test: 4.1 ± 0.14 vs. 2.0 ± 0.07, P < 1e-3). LC inhibition also rendered the population state vectors more similar to one another (Fig. 3e, Supp. Fig. 7. Correlation coefficient between early and late state vectors, control vs. test: 0.15 ± 0.03 vs. 0.95 ± 0.01, P < 1e-3). Together, our results show that LC inhibition dampens and impedes mPFC dynamics during switching.

LC inhibition impairs population encoding of switching

To gain further insights into mPFC representation of attentional switching and the effects of LC inhibition, we turned to the hidden Markov model (HMM), which has been successfully implemented to link neuronal activity patterns to animal behavior (e.g., 48,6264). In brief, we assume that population activity vectors, represented as calcium signals from simultaneously recorded neurons, are adjacent to one another in the neuronal state space when the same behavior is executed. We clustered mPFC population vectors into a set of discrete states (hidden states), and assessed the relationship between these neuronal states and the observed behavioral patterns/states of the mice. Specifically, the behavioral states are the early rule learning state and the late rule-following state (as depicted in Fig. 2e). We identified low-dimensional factors from the high-dimensional population vectors, and fitted HMM to these factors to infer the hidden state of each trial (Methods). We quantified model performance by comparing each trial’s neuronal state to the behavioral state with two measures: 1) the overall accuracy of predicting the state of individual trials (early or late) in each session; and 2) the accuracy of predicting where state transition occurred (the onset of late state: switch point, Fig. 2e). Both measures showed that model prediction was less accurate when LC was inhibited (Fig. 4a, b, state prediction accuracy, control vs. test: 89 ± 2% vs. 74 ± 3%, P < 1e-3; Δ switch point, control vs. test: -4 ± 1 trials vs. -8 ± 1 trials, P < 1e-3).

LC inhibition impairs mPFC encoding capacity of switching.

(a) Example behavioral state progression (solid curve: 0-early, 1-late) and hidden Markov model (HMM) predicted state progression (dashed curve) in a control session (black, left) and a test session (red, right). State prediction accuracy is 85% (control) and 71% (test). (b) Left: Cumulative distribution of the accuracy of predicting behavioral states in control (black) and test (red) groups. Sample size represents the total number of iterations that the model was tested (20 times per recording, 4 control mice and 5 test mice). Control vs. test: 0.89 ± 0.01 vs. 0.74 ± 0.02, P = 5.8e-7, rank sum = 9.0e3. Right: Cumulative distribution of the accuracy of predicting switch point in control (black) and test (pink) groups. Control vs. test: -4 ± 1 trials vs. -8 ± 1 trials, P = 4.2e-4, rank sum = 8.5e3. (c) Example sequences of animals’ choices (solid, top) and generalized liner model (GLM) predicted choices (dashed, bottom) in a control session (black, left) and a test session (red, right). Prediction accuracy is 82% (control) and 60% (test). (d) Cumulative distribution of the accuracy of predicting trial-by-trial choices in control (black) and test (red) groups. Control vs. test: 0.75 ± 0.01 vs. 0.68 ± 0.01, P = 6.0e-8, rank sum = 8.0e3.

We further assessed whether mPFC activity can track animals’ choices on each trial (correct vs. incorrect). We applied a generalized liner model (GLM) to predict the upcoming choice on individual trials. Specifically, we included the first 3 principle components of pre-choice population activity as regressors (Methods). We discovered that LC inhibition reduced the accuracy of trial-by-trial choice predictions (Fig. 4c, d, control vs. test: 75 ± 1% vs. 68 ± 1%, P < 1e-3). Video analysis found no significant difference in overall locomotion or reaction time between test and control group mice (Supp. Fig. 8), strongly implicating that the observed neurophysiological effects were not due to apparent changes in motivation or motor functions. Together, our data show that LC inhibition produces a marked deficiency in mPFC population encoding of attentional switching processes, suggesting that impaired mPFC dynamics and encoding capacity underlie the behavioral deficits.

Discussion

Our current work is aimed to uncover the neurophysiological substrates underlying set shifting (attentional switching) processes. We trained mice to switch attention to discriminate complex stimulus features comprising perceptual dimensions of digging medium and odor. Inhibiting genetically-defined LC-NE neurons or their projections to the mPFC similarly impaired switching behavior, highlighting the importance of the LC-mPFC circuit. To reveal the neurophysiological substrates, we combined chemogenetic inhibition of the LC with calcium imaging of the mPFC in task-performing mice. We discovered that the putative switch of attention was prominently represented in mPFC, and LC inhibition dramatically altered mPFC activity from single cell to population levels. A greater proportion of mPFC neurons became responsive to task-related variables, and the tuning of these neurons was broadened. Furthermore, LC inhibition disrupted mPFC population dynamics and impaired the encoding capacity of switching. Together, our data provide new cellular and circuit-level insights into LC-NE modulation of mPFC activity during set shifting.

Our analysis revealed that LC inhibition enhanced the engagement of mPFC neurons in the task. This observation may appear counterintuitive at first glance, but amplification of neuronal responses in a brain region could induce the transmission of noisy information to downstream circuits 6568, impairing brain functions. Furthermore, the link between broadened tuning and impaired switching behavior is reminiscent of the relationship between the changes in tuning properties of sensory neurons and perceptual behavior (e.g., 6972). It is plausible that similar to sensory areas, an appropriate level of mixed tuning in association areas is optimal for population coding of cognitive processes 61, and that too broad tuning would deteriorate population representations of task-and decision-related features. This prediction needs to be tested in future computational work.

Given that inhibiting LC-NE terminals impaired switching behavior in a similar manner as inhibiting LC-NE neurons (Fig. 1b, e), we interpret the observed neurophysiological effects in the mPFC during LC inhibition (Fig. 2-4) as at least partially mediated by the direct LC-NE input. NE exerts both excitatory and inhibitory influences through distinct types of adrenergic receptors expressed in different cell types 73. By preferentially binding to specific types of adrenergic receptors in a concentration-dependent way, NE is proposed to mediate downstream neuronal activity and behavior in a non-linear manner 21. Interestingly, a recent study in the orbital prefrontal cortex showed that the reduction of NE and downregulation of alpha-1 receptors led to decreased activity in GABAergic interneurons 74. In addition, prominent gamma synchrony between bilateral mPFC was important to support set shifting and population dynamics 40,41. It is thus plausible that the lack of LC-NE input diminishes the engagement of GABAergic interneurons in the mPFC, leading to elevated noisy neuronal activity, broadened tuning, and reduced population representations. Future studies are needed to better delineate the involvement of specific cell types and receptors in flexible decision making.

Our analysis suggests that attentional switching was prominently represented at both single-cell and population levels in the mPFC, and that LC inhibition led to pronounced changes in neuronal coding and population dynamics. Abrupt network transitions have been observed in the mPFC of rats performing set-shifting or probabilistic alternative choice task 48,75. Disrupted mPFC encoding or population activity patterns were reported when perturbing thalamic drive or callosal PV projections in mice 48,75. Together, these findings underscore a key insight: while many brain circuits can influence mPFC function, their effects may converge onto a small set of general operational principles, such as modulating the tuning properties of individual neurons and/or orchestrating ensemble dynamic transitions during complex cognitive processes. Identifying these principles is vital for advancing our understanding of how prefrontal cortex contributes to higher-order cognition and how its functions can be affected in various contexts.

In both intra-dimensional shift and extra-dimensional shift, all cues are novel but the rules differ. Learning theories posit that improved performance in intra-dimensional shift (fewer trials to reach performance criterion when all cues are novel but the relevant stimulus feature remains in the same perceptual dimension, e.g., digging medium in our task) is due to subject’s ability to readily attend to the superordinate features of sensory cues (perceptual dimensions - digging medium vs. odor), and that solving the extra-dimensional shift rule requires a switch in the attended perceptual dimension, rather than merely responding to individual novel cues 9,35. Thus, the behavioral changes observed in extra-dimensional shift (more trials to reach performance criterion) reflect the adaptive processes underlying the reallocation of attention, instead of novelty response. Based on this understanding, our current work builds on a longstanding tradition in the field that uses a single extra-dimensional shift to test attentional switching (e.g., 15,17,24,27,28). In this context, animals are naïve to the rule change and would solve the problem ‘on the fly’, without relying on prior learning or knowledge. Our findings shed new light on how the LC-mPFC circuit supports such de novo attentional switching processes. Furthermore, limited evidence suggests that solving the switching problem ‘on the fly’ (initial encounter) or based on experience/internal models (repeated testing) involves different mechanisms 19. A comprehensive comparison between these settings could provide valuable insights and further advance our understanding of cognitive flexibility.

Our work contributes to the growing interest in revealing neural mechanisms underlying more natural, ethologically relevant behavior 76,77. Admittedly, such behavioral paradigms may not afford the level of task control more commonly seen in restrained, operant paradigms. Nevertheless, the challenge of dissociating movement-related signal from sensory- or decision-related signal is present not only in freely-moving, but also restrained settings 7881. Comprehensive behavioral tracking and motif analysis (e.g., 82,83) will help to identify whether specific behavioral patterns are associated with attentional switching behavior. Ultimately, cognitive processes are not independent from sensory or motor processes. Cognition, perception and action may be implemented in a distributed rather than isolated manner 77,78,84.

Methods

Surgery

All experimental procedures were approved by the UC Riverside Animal Care and Use Committee (AUP20220030). Mice of mixed sex, aged 8-16 weeks were included in the study. Mice were C57BL/6J and DBH-Cre (B6.FVB(Cg)-Tg(Dbh-cre)KH212Gsat/Mmucd, 036778-UCD, MMRRC), singly housed in a vivarium with a reversed light-dark cycle (9a-9p). All surgical procedures were conducted under aseptic conditions, maintaining body temperature with a heating pad. Anesthesia was induced using a mixture of isoflurane (2–3%), and mice were positioned within a precise digital small-animal stereotaxic apparatus (Kopf Instruments and RWD). Before surgery, hair was gently removed from the dorsal head area, ophthalmic ointment was applied to protect the eyes, and the incision site was sanitized with betadine. All measurements were referenced to bregma for virus/implant surgeries. Viral injections were accomplished using a microinjection needle coupled with a 10 μl microsyringe (WPI). The virus was delivered at a controlled rate of 0.03 μl/min via a microsyringe pump (WPI). Following the completion of the injection, a 10-minute interval was allowed before slowly withdrawing the needle. Subsequent to viral infusions, nylon sutures were used to close the incision. Animals received 0.10 mg/kg buprenorphine and 0.22% enofloxacin and were placed in their respective home cages over a heating pad at 37°C. After full recovery from anesthesia, the subjects were returned to vivarium.

For LC inhibition, dopamine-β-hydroxylase (DBH)-Cre mice received bilateral injections of AAV carrying Gi-DREADD receptors (AAV5-EF1a-DIO-hM4D(Gi)-mCherry) into the LC (AP: -5.1, ML: 0.95, DV: -3.5 and -3.7 mm, 0.3 μl each depth). For calcium imaging, AAV containing GCaMP6f (AAV1-Syn-GCaMP6f-WPRE-SV40) was injected into the medial prefrontal cortex (Prelimbic; AP: 1.8, ML: 0.3, DV: -2.0 and -2.4 mm, 0.3 μl). Following injections, a 30-gauge needle was inserted to create space and reduce tissue resistance to facilitate lens insertion; however, no tissue was aspirated. A gradient refractive index lens (GRIN lens, Inscopix) with a diameter of 0.5 mm and approximately 6 mm in length was gradually lowered through the craniotomy, allowing tissue decompression. This lens was positioned to target AP: -1.8, ML: 0.3, DV: 2.2 mm. The same coordinates were applied for the cannula implantation used in LC terminal inhibition. Lens implants were securely attached to the skull using a layer of adhesive cement (C&B Metabond, Parkell), followed by dental cement (Ortho-Jet, Lang Dental). To protect the lens, a layer of silicone rubber was applied as a protective cover.

Following virus incubation, mice were once again anesthetized under isoflurane and securely positioned in the stereotaxic setup. Baseplates were affixed around the GRIN lens to provide structural support for the attachment of the miniaturized microscope. The top surface of the exposed GRIN lens was meticulously cleaned using a cotton-tipped applicator dipped in a solution of 15% isopropyl alcohol diluted with ddH2O. A miniaturized microscope, equipped with a single-channel epifluorescence and a 475-nm blue LED (Inscopix), was then carefully positioned over the implanted GRIN lens. Adjustments were made along the dorsal-ventral axis to achieve the optimal focal plane for imaging. Subsequently, the microscope/baseplate assembly was secured in place using adhesive cement. The microscope was detached from the baseplates, and a final layer of dental cement was applied to prevent light leakage. A protective plate was placed over the implant until imaging sessions. Mice were singly housed after lens implant.

Behavior and data acquisition

To assess flexible decision-making in freely moving mice, we adopted the 5-stage testing paradigm of the attentional set-shifting task (AST) 31,32. Two weeks before training, mice were food restricted (85% of initial weight) and handled by the experimenter for 5-7 days. Next, mice were acclimated to the behavioral box (25 x 40 cm) and experimental setup for 3-4 days, followed by a brief training session to stimulate the innate burrowing/digging behavior to retrieve food reward from the ramekins. Two ramekins were placed at two corners of the behavioral box, both containing 25 mg of cheerios. Throughout the training session the reward was gradually buried in clean home cage bedding. In each trial mice were allowed 3-4 minutes to explore. Mice were considered well trained once they could consistently dig and retrieve the reward from both locations for 15-20 trials.

The AST consisted of the following stages: 1) simple discrimination (SD), in which animals choose between two digging mediums associated with distinct textures (first dimension), only one of the two stimuli predicts food reward; 2) compound discrimination (CD), in which a second stimulus dimension (two odor cues) is explicitly introduced. Each odor cue is randomly paired with a digging medium in every trial, but the reward is still predicted as in SD; 3) intra-dimensional reversal (REV), which preserves the task-relevant dimension (digging medium) but swaps cue contingencies; 4) intra-dimensional shift (IDS), which preserves the task-relevant dimension (digging medium), but replaces all four cues with novel ones (a new digging medium predicts reward); 5) extra-dimensional shift (EDS), which swaps the previous task-relevant and task-irrelevant dimensions with all cues replaced (a new odor cue predicts reward). All stages were performed within a single day, lasting 3-4 hours. In each trial, the ramekin associated with the relevant stimulus contained a retrievable reward. To avoid the possibility that mice used food odor cues to solve the task, the other ramekin contained a non-retrievable reward (trapped under a mesh wire at the bottom). The two ramekins were placed randomly in the two locations every trial. Mice were allowed to complete a trial (dig one ramekin) within 3 minutes. Once mice started digging, the other ramekin was immediately removed from the behavioral box. To reach the criterion the animal has to dig in the correct ramekin six times consecutively and correctly rejecting the incorrect ramekin on at least two occasions.

An overhead CCD camera (Basler acA1300-200um) was set to capture behavior at 20 Hz, controlled by Pylon Viewer Software. Video and calcium recordings were synchronized via a common TTL pulse train (Arduino). Behavioral annotations were done manually post hoc. On the recording day, mice were attached to the miniaturized microscope. Grayscale images were collected at 20 frames per second using 0.01 mW/mm2 of excitation light. Snout, head, tail, and ear tracking were measured using DeepLabCut 85. The network was initially trained with 100 uniformly distributed frames from 5 videos, followed by an additional iteration to rectify outlier detections. The measurements for distance and speed were computed using the head, where the likelihood of accuracy exceeded 95 percent. After the test, animals were allowed to access food and water ad libitum for 3 days before to be transcardially perfused. Following dissection, brains were post-fixed for 24 h at 4°C in 4% PFA, and sectioned for immunohistochemistry to label TH+ neurons.

Locus coeruleus inactivation

On the test day, Clozapine-N-oxide (CNO) was freshly prepared for systemic or local infusions. For systemic injection we used a concentration of 0.03 mg/kg to minimize potential confound8688. CNO was injected 60 min before EDS test in both test (Gi-DREADD) and control (DBH-) group mice. A second control group mice (DBH-Cre expressing Gi-DREADD) received saline injections in the same manner. For LC terminal inhibition we used a CNO concentration of 0.5 mM89 diluted in cortex buffer. Mice were bilaterally implanted with stainless steel cannula guide (26 gauge; RWD) targeting the mPFC. Dummy cannulas were used to fill the guide and removed only during the injection period. CNO was infused at a rate of 0.03 μl/min. After infusion, injecting cannulas were left in place for 5 min to allow drug diffusion.

Image processing

Image processing was executed using Inscopix data processing software (version 1.6). Prior to data analysis, raw imaging videos underwent preprocessing, including a x4 spatial down sampling to reduce file size and processing time. No temporal down sampling was performed. The images were then cropped to eliminate post-registration borders and areas where cells were not visible. Prior to the calculation of the dF/F0 traces, lateral movement was corrected. For ROI identification, we used a constrained non-negative matrix factorization algorithm optimized for endoscopic data (CNMF-E) to extract fluorescence traces from ROIs. The detected ROIs were then manually evaluated based on neuronal morphology, ensuring adequate separation from neighboring cells.

Single cell analysis

Calcium signals for each ROI were z-scored and aligned to behavioral events (i.e., trial start, digging) using MATLAB (MathWorks). In order to classify neuronal representations of different task-related variables, we performed Receiver-Operating-Characteristic (ROC) analysis 90 on the activity of each neuron prior to choice. Switch representation was defined as significant calcium responses between early (trial-and-error rule learning) and late (rule-following) trials during a pre-choice time window (-5 to 0 s). Similar analysis was performed to classify trial history encoding, comparing calcium activity during the same time window (-5 to 0 s to from choice) after correct trials against after incorrect trials; and choice encoding, comparing calcium activity (-5 to 0 s from choice) when the upcoming choice on the current trial is correct or incorrect.

Dimensionality reduction

We concatenated neuronal activity across recordings, and constructed population vector in the early and late states by averaging calcium signals from all recorded neurons in all trials of a given state (in 50-ms bins, without overlap) over a period of ten seconds centered at the choice point (digging). These calcium values were extracted from 80% of recorded neurons randomly selected. This process was reiterated 20 times to account for the inherent variability in the dynamics of the population vector. The resultant high-dimensional trajectories were smoothed and embedded into a lower-dimensional space through principal component analysis (PCA). The explained variance was calculated for the first six principal components, which collectively accounted for over 80% of the total variance. Projections into a low-dimensional space (n = 3) were generated for visualization purposes. Additionally, to evaluate the degree of similarity between state vectors, Pearson’s correlation was computed for the time series of individual principal components. Subsequently, these correlation coefficients were averaged to derive an overall measure of vector similarity.

Hidden Markov model

Following prior work (e.g., 6264), we assume population neuronal activity can be clustered into two distinct (hidden) states, corresponding to the early learning state and the late learned state as observed in mouse behavior (Fig. 2e). For each trial, calcium activity from simultaneously recorded neurons was segmented into non-overlapping 50-ms windows and averaged over the 5-s period preceding the animal’s choice (digging). Principal component analysis (PCA) was applied to identify low-dimensional representation of population activity of each trial. Based on these PCs, K-means was applied to group trials into clusters, initializing the parameters for HMM. The core assumption was that activity vectors corresponding to the same behavioral state would cluster together in the neuronal state space. An HMM was then fitted to estimate emission and transition probabilities between states. To ensure robustness, the clustering and modeling process was repeated 1000 times, with each iteration consisting of a randomly selected 40% of neurons. Model parameters were optimized using the Baum-Welch algorithm on 90% of the data, and performance was tested on the remaining 10% using the Viterbi algorithm 91 to infer the most likely sequence of hidden states. To account for the potential confound that different number of trials affect model performance (LC inhibition typically required more trials than the control condition), we used a bootstrapping method to balance trial numbers. Specifically, we matched the total number of trials in each session to the highest possible number (31 trials).

Generalized linear model

We conducted a logistic regression analysis on the population vectors to predict current trial outcomes (correct or incorrect) based on population activity patterns. To construct the population vector for each session, we initially computed the average activity of all recorded neurons in the 5-s window prior to choice. We then randomly selected 40% of neurons and applied principal component analysis. The first three principal components were retained as predictors for the regression model. We also matched trial numbers, following the methodology described earlier for HMM. To address variability and ensure robustness, we conducted 1000 bootstrap procedures. Subsequently, we partitioned 90% of the dataset for model training and tested the model on the remaining 10% of unseen data. A threshold of 0.5 was used to binarize the model probability. Values above 0.5 were assigned a label of 1 (correct choice), while values below 0.5 were assigned a label of 0 (incorrect choice). Model accuracy was assessed by comparing the actual behavioral sequence with model predicted sequence.

We note that incorrect choices likely reflect the early rule learning state, and correct choices likely reflect the late rule acquisition state. Thus, the two measurements of behavior, namely state change and trial-by-trial choice, are not completely orthogonal to each other.

Statistical analysis

Data were reported as mean ± SEM unless otherwise noted. We did not use statistical methods to predetermine sample sizes. Sample sizes were similar to those reported in the field. We assigned mice to experimental groups arbitrarily, without randomization or blinding. Unless otherwise noted, statistical tests were two-tailed Wilcoxon rank-sum when sample sizes were >7. When sample sizes were ≤ 7, two-tailed t tests were used.

Acknowledgements

We thank Shaorong Ma for helping with the behavioral paradigm, and Edward Zagha, Martin Riccomagno, Sachiko Haga-Yamanaka for commenting on the manuscript. N.E.Z. was supported by NIH grant R00DA047419. H.Y. was supported by Klingenstein-Simons Fellowship Awards in Neuroscience, and NIH grants R01NS107355 and R01NS112200.

Additional information

Author contributions

M.N., L.S.T. and H.Y. planned the project and built the apparatus. M.N. performed experiments. L.S.T. assisted with LC inhibition experiments, M.G. assisted with histology, and N.E.Z. assisted with data analysis. M.N., M.G. and H.Y. analyzed data. M.N. and H.Y. wrote the manuscript with input from all authors.

Additional files

Supplementary figures