Introduction

To maximise survival, animals need to make adaptive food-seeking decisions according to their internal physiological needs and external conditions, including the presence of potential threats. When animals encounter cues associated with food availability, internal and external signals associated with satiation or threat states modulate their behavioural responses1,2,3,4,5,6. However, food cues can sometimes override homeostatic control by eliciting hedonic feeding in satiated animals or risk-taking responses to obtain food despite threats or punishment7,8,9,10, both behaviours associated with eating disorders and obesity11,12. Yet, the neural circuits that integrate food-cue information with distinct internal states to regulate cued food seeking remain poorly understood.

One candidate region is the prelimbic (PL) subregion of the medial prefrontal cortex. PL neurons and their projections to the paraventricular nucleus of the thalamus (PVT) or the nucleus accumbens (NAc) encode reward-associated cues10,13,14,15,16,17, and monitor internal metabolic18,19 or threat-related emotional states20,21,22. Previous studies have shown that activity in PL neurons drives conditioned cue-induced food consumption in satiated animals23,24, but the neural dynamics and circuit mechanisms that underlie persistent food seeking or food suppression following satiation remain unclear. PL is also recruited during motivational conflict when reward seeking is suppressed by conditioned threats10,22,25,26,27,28. However, the downstream targets of PL neurons that regulate approach-avoidance conflict remain largely unexplored. Also unknown is whether the suppression of cued food seeking during the transition from hungry to satiated states involves similar PL activity and circuits as those observed during the transition from safe to threat states.

Here, we used microendoscopic calcium imaging to longitudinally track changes in PL neuronal population dynamics and food-cue responses in the same rats exposed to voluntary satiation or predator-odour threat during cued food-seeking. Using single-unit recordings combined with optogenetic photoidentification, chemogenetic manipulation and machine-learning neuronal analyses, we investigated the distinct roles of PL-aPVT and PL-NAc neurons in modulating cued food-seeking behaviour during satiation- or threat-induced food suppression.

Results

Satiation and predator threat induce food suppression

We designed a protocol to characterise changes in cued food-seeking responses following satiation or predator-threat exposure in the same cohort of rats. In satiation test, food-restricted animals initially trained to press a lever during the presentation of an audiovisual cue (i.e. food cue) to receive a sucrose pellet voluntarily transitioned from a hungry to a satiated state. Rats were presented with the food cues during a hungry phase, followed by 50 min of free access to sucrose in the same apparatus, and a subsequent satiated phase in which the same food cues were presented again (Fig. 1a). Animals exhibited a significant reduction in food-seeking responses from hungry to satiated phases, characterised by decreased percentage of time spent in the food area, reduced percentage of rewarded trials, increased latency to press the lever and attenuated locomotor speed during food-cue presentation (Fig. 1b, c). Male and female rats exhibited similar levels of food suppression after satiation, except for a greater reduction in the percentage of rewarded trials in males compared to females (Supplementary Fig. 1a–e).

Fig. 1: Rats showed variable food-seeking suppression during satiation or predator threat exposure.
figure 1

a Timeline and schematic of the satiation test. b Ethogram of a representative animal during satiation test. c Reduced food seeking behaviour and average locomotor speed during cue presentation of satiated rats (n = 20; circle, male, n = 9; triangle, female, n = 11). d Timeline and schematic of the threat test. e Ethogram of a representative animal during threat test. f, g Reduced food-seeking behaviour, increased defensive behaviour and reduced average locomotor speed of rats exposed to cat odour (n = 21; circle, male, n = 10; triangle, female, n = 11). h Left, visualisation of K-means cluster boundaries and group separations in PCA spaces during the satiation test (Aquamarine, Suppressed Pressers (SP), n = 12; Salmon, Persistent Pressers (PP), n = 8); right, radar chart representing the behavioural patterns of hungry (darker colours) and satiated (lighter colours) states in SP and PP. i During the satiation test, SP, but not PP, showed a significant reduction in the food area approaching. SP showed a significantly lower percentage of rewarded trials and higher latency to lever press after cue onset when compared to PP in satiated states (Aquamarine, SP, n = 12; Salmon, PP, n = 8). j same as (h) but for the threat test. k, l SP, but not PP, showed a significant increase in freezing levels after transitioning from hungry to satiated states. SP showed a significantly lower percentage of time spent in the food area compared to PP in both safe and threat states. SP also showed a significantly lower percentage of rewarded trials and average locomotor speed during cue presentation, and a significantly higher latency to lever press after cue onset and percentage of time spent avoiding the predator odour compared to PP after transitioning from hungry to satiated states (Aquamarine, SP, n = 6; Salmon, PP, n = 15). c, f, g Paired Student’s t test or Wilcoxon’s signed-rank test. i, k, l Two-way repeated measures ANOVA followed by Sidak post hoc test. Data shown as mean ± SEM, *p < 0.05. Source data are provided as a Source Data file.

After ~5 days, the same food-restricted rats previously exposed to the satiation test underwent an approach-avoidance conflict test29, which was adapted to compare food-seeking suppression during predator odour (cat saliva) exposure (Fig. 1d). Predator odour induces innate defensive behaviours and suppresses reward-seeking responses in rodents29,30,31. Consistent with previous studies, rats displayed attenuated food-seeking responses and increased defensive behaviours after predator odour exposure (Fig. 1e–g). Similar to the satiation test, suppressed food-seeking behaviour was characterised by decreased percentage of time spent in the food area, reduced percentage of rewarded trials and increased latency to press the lever (Fig. 1f), whereas enhanced defensive behaviours were characterised by increased percentage of avoidance and freezing time and decreased locomotor speed during the food cue presentation (Fig. 1g). Both male and female rats exhibited threat-induced defensive behaviours and food-seeking suppression. However, males showed a greater reduction in the percentage of rewarded trials and a higher increase in the latency to press compared to females, whereas females showed similar levels of food approaching and freezing during safe and threat phases (Supplementary Fig. 1i–o).

Rats display individual variability in food-seeking responses during satiation and threat states

Despite the overall suppression in food-seeking, we observed variable degrees of food-seeking inhibition during both satiation and threat tests in male and female rats. To characterise this behavioural variability, we applied K-means clustering to the behavioural parameters described above and identified two distinct clusters of rats in each test.

In the satiation test, the first cluster of rats, termed Suppressed Pressers, showed a nearly complete reduction in food-seeking behaviour during the satiated phase. In contrast, the second cluster, termed Persistent Pressers, maintained a similar food approaching time after transitioning from hungry to satiated states and showed a smaller reduction in the percentage of rewarded trials and a smaller increase in the latency to press the lever compared to Suppressed Pressers (Fig. 1h, i and Supplementary Fig. 1f, g). We separately clustered behaviours in the threat test and observed that Suppressed Pressers completely shifted from food seeking to defensive behaviours in the presence of predator odour, whereas Persistent Pressers showed a partial, yet significant, increase in avoidance behaviour and continued to press the lever for food in some trials (Fig. 1j–l and Supplementary Fig. 1p, q). Males and females displayed similar proportions of Suppressed Pressers and Persistent Pressers, suggesting comparable levels of food-seeking variability between sexes (Supplementary Fig. 1h, r). Interestingly, over half of the Suppressed Pressers during the satiation test switched to Persistent Pressers during the threat test, whereas the majority of Persistent Pressers during the satiation test retained the same classification during the threat test, indicating that distinct behavioural strategies may underlie the variability in food-seeking suppression during satiated vs. threat states (Supplementary Fig. 1s). Together, these results reveal sex-independent individual variability in food-seeking suppression in response to both metabolic satiation and predator-threat exposure.

PL population dynamics represent task-relevant variables as well as changes in metabolic and emotional states

Given that the PL monitors internal metabolic18,19 or threat-related emotional states20,21,22, we hypothesised that PL neurons encode behavioural decisions in response to food cues under distinct internal states. We used a viral vector under the control of the CaMKII promoter32,33 to favour the expression of the calcium indicator GCaMP6f in PL glutamatergic neurons. A GRIN lens was unilaterally implanted in PL for microendoscopic imaging of calcium activity from PL neurons in freely moving rats during the previously described behavioural tests (same rats shown in Figs. 1 and 2a–c; Supplementary Fig. 2a, b). We first asked whether PL neuronal population dynamics encode task-relevant behavioural outputs (e.g. food approaching) and stimuli (e.g. food cue) versus general locomotor speed across the entire experiment. We trained supervised encoder models with Consistent Embeddings of High-Dimensional Recordings using Auxiliary Variable (CEBRA)34 using the calcium transients of all recorded neurons per each selected animal with different combinations of test variables as auxiliary labels, including food-seeking behaviour (food approaching and lever presses), food cue presentation, locomotor speed and for threat test, defensive behaviour (avoidance and freezing; Fig. 2d, see ‘Methods’ section for details). We observed well-separated latent structures shaped by the occurrence probability of the task variable in each time bins in CEBRA-behaviour models trained with food-seeking behaviour, food cue presentation and defensive behaviour, which was not observed when trained on shuffled data (Fig. 2e, f). These models showed higher convergence compared to their shuffled models, with high consistency across animals (Supplementary Fig. 3a, b, g, h), suggesting reliable representation of task-relevant behavioural outputs or stimuli. Notably, models trained on locomotor speed could not be separated by the normalised speed and displayed similar levels of convergence as shuffled models (Fig. 2e, f and Supplementary Fig. 3a, g), indicating that PL population activity does not simply reflect general locomotion. Using K-nearest neighbour (KNN) decoders on the latent spaces, we further confirmed a higher accuracy for models trained with food-seeking behaviour, food-cue presentations and defensive behaviour in decoding the labels, compared to their shuffled models or models trained with locomotor speed, which showed similar performance to shuffled speed models (Fig. 2g–j and Supplementary Fig. 3c–e, i–m). These results indicate that PL population dynamics primarily represent task-relevant variables rather than general locomotion during cued food seeking.

Fig. 2: PL population activities encode food cue presentations and changes in internal states.
figure 2

a Schematic of microendoscopic imaging. Created in BioRender. Zhang, X. (2025) https://BioRender.com/30ckzl8. b Representative image of GCaMP6f viral expression and GRIN lens implantation in PL. Red dash lines indicating track of GRIN position. Scale bar: 200 µm. c Representative field of view from one animal. d Schematics of the analysis pipeline of the PL population activities. See ‘Methods’, for details. Latent structure of CEBRA models trained with (top) different task variable combinations during e satiation and f threat test, as well as (bottom) models trained with their corresponding shuffled labels. g, h The observed (top) and predicted timestamps from the CEBRA-Behaviour models (middle) or the shuffled model predictions (bottom). Representative results of one animal in g satiation test and h another from threat test. i, j Left, the observed speed (top) differs from predicted speed (middle) from the CEBRA-Behaviour models as well as the shuffled model predictions (bottom). Representative results of one animal in i satiation test and j another from threat test. Right, decoding accuracy for models trained with each label combination and their shuffled labels as measured by median absolute error (MedAE) in satiated test (n = 5 rats) and threat test (n = 8 rats). Time course of the decoding accuracy (auROC) of LDA for the classification of k the hungry vs. satiated states, or n safe vs. threat states. Decoding accuracy (auROC) for the classification of l hungry vs. satiate states, or o safe vs. threat states (n = 8 folds). PL population activity of neurons recorded from m SP and PP in satiation test and p threat test (n = 8 folds). Neural trajectories of q hungry vs. satiated trials, or r safe vs. threat trials (thinner lines) and the average trajectories (thicker lines) in 3-dimensional (top) and 2-dimensional (bottom) PCA spaces. Dashed lines represent the pre-cue period, and solid lines represent the post-cue-onset period. i, j One-way ANOVA followed by Sidak post hoc test; l, o Two-sided Wilcoxon signed-rank test; m, p Two-sided Mann–Whitney u test. Data in g, h, kp are shown as mean ± SEM, * p < 0.05. Box plot centre line, median; box limits, upper and lower quartiles; whiskers, 1.5× interquartile range; points, outliers. Source data are provided as a Source Data file.

Since PL population dynamics precisely represent food-cue presentations, we next assessed whether the dynamics around cue presentation reflect changes in metabolic or emotional states. We combined all recorded neurons across animals in a Linear Discriminant Analysis (LDA) classifier to categorise hungry vs. satiated and safe vs. threat states on a trial-by-trial basis, similar to previous studies35,36. Both internal states were reliably decoded using PL population activity within the 1-s window post cue-onset, compared to shuffled control (Fig. 2k, l, n, o). PL population activity showed decoding accuracy above chance levels even before the cue onset, peaking and stabilising after the cue presentation (Fig. 2k, n). This suggests that PL population constantly monitors internal states, with cue presentation and the opposite behavioural outcomes further shaping the distinct population dynamics. Furthermore, PL population dynamics from Suppressed Pressers showed a significantly higher decoding accuracy compared to Persistent Pressers when classifying hungry vs. satiated states, but not safe vs. threat states (Fig. 2m, p), suggesting differential contributions of PL activity in the behavioural variability between satiation and threat conditions.

We further visualised the separation of population dynamics as neural trajectories using principal component analysis (PCA). Trials within each state displayed consistent trajectories (Fig. 2q, r). We observed a clear divergence between the averaged trajectories from hungry versus satiated trials or safe versus threat trials, starting from the onset of cue presentations, indicating shifted dynamics in PL cue responses (Fig.  2q, r). Importantly, the Euclidean distance between trajectories from hungry and satiated trials was significantly larger in Suppressed Pressers than in Persistent Pressers, and this difference was not observed when randomly selecting two groups of neurons across both clusters (Supplementary Fig. 4a–d). In contrast, the distance between trajectories from safe and threat trials was similar between Suppressed Pressers and Persistent Pressers, as well as between shuffled groups (Supplementary Fig. 4e–h), which is consistent with the similar decoding accuracy between the clusters from Suppressed Pressers and Persistent Pressers (Fig. 2p). Together, these results suggest that PL population dynamics encode task-relevant variables and internal state changes, with higher participation during food-cue presentations.

Different cue-responsive neurons in PL are recruited during distinct internal states

Next, we quantified food-cue responses in single neurons and identified subsets of PL cells that were either excited or inhibited within 1.5 s after food-cue onset during the satiation or threat tests. The 1.5-s time window was chosen based on the rats’ minimum average latency of 1.6 s to press the lever after the cue. A permutation test on Z-score values of the calcium traces identified cue-responsive neurons (Fig. 3a–c, see ‘Methods’ section), providing robust selection as demonstrated by cross-trial stability (Supplementary Fig. 5a–c). We identified ~10% of recorded neurons showing excited or inhibited cue responses in the satiation test (123 out of 1111 neurons) or the threat test (85 out of 938 neurons). We observed similar changes in averaged calcium signals during the first 1.5 s following the food cue onset between the hungry and satiated phases, as well as during the safe and threat phases (Fig. 3d, j). However, a delayed excitatory response emerged later, particularly during hungry and safe phases compared to the satiated and threat phases (Fig. 3d, j), likely reflecting distinct behavioural responses.

Fig. 3: Distinct subpopulations of prelimbic cortex neurons respond to food cues during transitions between different metabolic or threat states.
figure 3

a Left, schematic of microendoscopic imaging; Right, schematic of cue responses analysis: 1. Alignment of the calcium transients to food cue onsets; 2. Perievent activities of two representative neurons averaged across all trials and normalised to Z-score; 3. Permutation test results of two representative neurons. Grey bars showing null distribution of the Z-score difference between the 1.5-s pre-cue window and the 0.5-s post-cue window after 1000 random circular shifts of calcium traces. Coloured bars showing the real values. Red dotted lines showing the 2.5% and 97.5% of the null distribution. Left schematic created in BioRender. Zhang, X. (2025) https://BioRender.com/30ckzl8. b Representative traces of two cue-responsive neurons. c Trial-averaged perievent heatmap showing food-cue responses of neurons that are excited during hungry (left) and neurons that are inhibited by food cues during satiation (right). Trial-averaged food cue responses of all PL neurons during d hungry vs. satiated phase (n = 1111, from 19 animals) or j safe vs. threat phase (n = 938, from 14 animals). Trial-averaged food cue responses of neurons that are excited in e hungry states (n = 37) or satiated states (n = 41), and in k safe states (n = 28) or threat states (n = 23). Trial-averaged food cue responses of neurons inhibited in f hungry states (n = 31) or satiated states (n = 18) and l safe states (n = 27) or threat states (n = 11). g, m Left, Venn diagram showing the number of neurons that are exclusively responsive to food cues in each state or showing mixed responses to both states; Right, Representative distribution of responsive neurons in one animal. PL neurons that are preferentially recruited to respond to food cues in h hungry or i satiated states, and in n safe vs. o threat states. Inset of each panel: area under curve value during the 1.5 s post-cue window. f Two-sided unpaired Student’s t test; e, k, l, Two-sided Mann–Whitney U test; h left, i right, n, o right, Two-sided paired Student’s t test; d, h right, i left, j, o left, Two-sided Wilcoxon’s signed-rank test. Data in df, hl, no shown as mean ± SEM, *p < 0.05. Box plot centre line, median; box limits, upper and lower quartiles; whiskers, 1.5× interquartile range; points, outliers. Source data are provided as a Source Data file.

When comparing neurons excited or inhibited by food cues between hungry and satiated states, no significant differences were found in their amplitudes within the 1.5-s window after cue onset (Fig. 3e, f, k, l). A higher peak amplitude of excited responses was observed during the hungry phase after the 1.5-s window (Fig. 3e), potentially reflecting higher levels of food-seeking behaviour. Interestingly, tracking the neural activity of the same cells across the two compared phases revealed that distinct subpopulations of PL neurons respond to food cues during the hungry vs. satiated states (Fig. 3g–i and Supplementary Fig. 5d), or during safe vs. threatened states (Fig. 3m–o and Supplementary Fig. 5e). Food-cue responsive neurons in hungry or safe states exhibited reduced responses in satiated or threat states, whereas previously non-responsive neurons began to display either excitatory or inhibitory food-cue responses as rats transitioned between states (Fig. 3h, i, n, o). Minimal overlap in cue-responsive neurons was observed between hungry and satiated states (3.25%, Fig. 3g) and between safe and threat states (4.2%; Fig. 3m), indicating a consistent pattern of switching in neuron responsiveness across metabolic states and emotional states.

To explore whether the recruitment of distinct food-cue responsive neurons in PL correlates with individual variability in food suppression, we quantified the percentage of neurons that were excited or inhibited by food cues in Suppressed Pressers or Persistent Pressers. Compared to Suppressed Pressers, Persistent Pressers had a higher percentage of neurons excited by food cues in satiated states, possibly representing a hedonic feeding signal linked to persistent food-seeking behaviour following satiation (Supplementary Fig. 5f). In contrast, after the transition from safe to threat, Persistent Pressers showed a reduction in the percentage of neurons that were inhibited by food cues, which was not observed in Suppressed Pressers, suggesting that lack of inhibitory food-cue responses may drive their reduced food-seeking behaviour in threat states (Supplementary Fig. 5g). Similarly, we observed distinct recruitment of inhibitory or excitatory food-cue responses in males vs. females under each state, likely representing the nuance between their behavioural patterns in the two tests (Supplementary Fig. 5h, i). Thus, Persistent Pressers rely on an enhanced hedonic, cue-excited ensemble during satiation and bypass the inhibitory gating by threat cues, whereas Suppressed Pressers maintain a balanced proportion of cue-excited and cue-inhibited ensembles across states. Together with our population activity analysis, these results demonstrate that PL neurons exhibit distinct food-cue responses that correlate with individual variability in their behavioural responses during internal state changes. Surprisingly, removing food-cue responsive neurons from the LDA classifiers did not impact the decoding accuracy, indicating a broader contribution from other PL neurons in the representation of internal states during cue presentation (Supplementary Fig. 3f, n).

Taken together, distinct subpopulations of PL neurons respond to external food cues depending on the animals’ metabolic and emotional states, which may serve to adjust animals’ behaviour in response to environmental food cues according to their internal needs.

Distinct populations of food-cue responsive cells are recruited during satiation and threat tests

To determine whether food-cue responsive neurons overlap during satiation and threat states, which would indicate a shared PL mechanism for food-seeking suppression, we cross-mapped recorded neurons from both tests using a centroid-distance-based method (Fig. 4a)37. Around 42% of the neurons recorded during the threat test were successfully mapped during the satiation test, similar to the percentages described in previous studies38,39. We ranked the cross-mapped neurons by their food-cue responses in the hungry state from the most inhibited to the most excited responses (Fig. 4b). This pattern disappeared when the same ranking order was used to align food-cue responses during safe, satiated or threat states, suggesting distinct population dynamics during food cue presentations in each state (Fig. 4c–e).

Fig. 4: Cross mapping of PL neurons recorded during satiation and threat tests.
figure 4

a Left, schematic of microendoscopic imaging; Right, representative image of neurons from one animal that are recorded only during the satiation test (green), only during the threat test (pink), or cross-mapped in both tests (yellow). Schematic created in BioRender. Zhang, X. (2025) https://BioRender.com/30ckzl8. be Heatmaps showing food-cue responses of all cross-mapped neurons (n = 395) in each state, with a rank order based on the cue responses during hungry states. f Heatmap (top) and averaged traces (bottom) of different clusters of neurons showing similar or distinct dynamics during food-cue presentation in hungry vs. safe test. Red dashed box highlights a cluster that shows similar food-cue responses in hungry and safe states. Inset: area under the curve within 1.5 s after cue onset (AUC 1.5 s) for all neurons in cluster 8. Two-sided Wilcoxon’s signed-rank test. g Heatmap (top) and averaged traces (bottom) of different clusters of neurons showing similar or distinct dynamics during food-cue presentation in satiated vs. threat test. *p < 0.05. Data in f and g bottom shown as mean ± SEM. Box plot centre line, median; box limits, upper and lower quartiles; whiskers, 1.5× interquartile range; points, outliers. Source data are provided as a Source Data file.

Next, we investigated if the same population of cue-responsive neurons was recruited during satiated and threat states, when animals displayed similar suppression in food seeking. We first verified how stable the cue-responsive neurons were during hungry and safe states. Though recorded on different days, animals in these states were naïve to predator odour and food-restricted, undergoing the same cued food-seeking paradigm in similar arenas that differed only slightly in their lengths (See ‘Methods’ and Fig. 1a, d), and therefore most likely shared similar emotional responses and metabolic needs. Given that the cross-mapping reduced the total number of cue-responsive neurons, we performed an unbiased selection of different dynamics around food-cue presentations using all cross-mapped PL neurons, instead of comparing a small number of cue-responsive neurons selected by permutation test on individual neurons. We used an unsupervised spectral clustering algorithm adapted from previous studies40 to identify groups of neurons that exhibited different temporal patterns of averaged activities across cue presentations in hungry vs. safe states. The number of clusters was optimised by maximising the silhouette score, and verified through tSNE transformation (Supplementary Fig. 6a–f, see ‘Methods’).

Among the identified clusters, only clusters 1 and 8 exhibited rapid responses after cue onset (Fig. 4f). Cluster 8, which consists of 7% of the cross-mapped neurons, showed consistent food-cue responses within the 1.5-s window after cue onset in both hungry and safe states (Fig. 4f), with distinct and delayed peak responses that potentially reflected differences in food-seeking latencies between the two tests. Conversely, cluster 1 showed responses specifically during hungry states, indicating context-specific food-cue encoding (Fig. 4f). Notably, food cue responses in cluster 8 were abolished when the animals transitioned to satiated or threat states and displayed reduced food-seeking responses (Fig. 4f, inset). Remarkably, clustering the food-cue response patterns in satiated vs. threat states did not yield any cluster with similar levels of food-cue responses in both conditions (Fig. 4g and Supplementary Fig. 5j, k). Using inferred spikes from the calcium imaging activity (see ‘Methods’ section), we further confirmed our findings by identifying a cluster of neurons showing consistent food-cue responses during hungry and safe states (Supplementary Fig. 7). Importantly, these consistent food-cue responses were not observed after we shuffled the cell IDs within each field of view (Supplementary Fig. 8), suggesting that they were not simply caused by similar neural activity across distinct neurons, but rather depended on the correct tracking of the same cells across the states. Combined, these results suggest that while a small subset of PL neurons consistently respond to food cues in similar food-motivated states, distinct subpopulations are recruited during satiated vs. threat states when food-seeking behaviour is suppressed.

PL-aPVT and PL-NAc neurons contribute to distinct dynamics of food cue responses in metabolic and emotional states

Previous studies have demonstrated that PL neurons that project to the aPVT or NAc are primarily located in different PL layers41,42,43, and are preferentially inhibited or excited in response to food cues during reward learning, respectively13. However, it remains unclear whether PL-aPVT and PL-NAc neurons regulate changes in cued food-seeking behaviour during transitions of metabolic or emotional states.

Using neuroanatomical tracing, we confirmed that these two PL subpopulations show minimal overlap (Fig. 5a), with PL-aPVT neurons being primarily located in layer VI and PL-NAc neurons being primarily located in layers II/III and V, consistent with previous studies41,44,45,46. Next, we combined single-unit recordings with optogenetics to photoidentify PL-aPVT and PL-NAc neurons and track their activity during the satiation and threat tests. A retrograde viral vector (AAVrg-hSyn.HI.eGFP-Cre) was infused either in the aPVT or the NAc to express Cre-recombinase in PL neurons, and a Cre-dependent viral vector (AAV5-EF1a-DIO-hChR2(H134R)-mCherry) was infused into PL to express channelrhodopsin (ChR2) selectively in PL-aPVT or PL-NAc neurons, followed by the implantation of an optrode in PL for optogenetic-mediated photoidentification at the end of the recording sessions (Fig. 5b, c, see ‘Methods’; Supplementary Fig. 2c–g). To address the limited number and potential heterogeneity of photoidentified food-cue-responsive neurons, we applied the same spectral clustering analysis described above. This enabled us to detect different response patterns across PL populations and characterise the enrichment of preferentially recruited subpopulations for each projection-defined neurons by comparing them with the unidentified PL neurons.

Fig. 5: PL-aPVT or PL-NAc neurons are preferentially recruited during satiated or threat states, respectively.
figure 5

a Left, schematics of intra-aPVT and intra-NAc viral infusions of retrograde AAVs to express mCherry or eGFP in PL neurons that project to aPVT or NAc in the same rat. Right, representative image showing retrogradely labelled PL-aPVT neurons (green) and PL-NAc neurons (red). Scale bar: 100 µm. b Schematics of PL optrode implantation and viral infusion for PL-aPVT (top) and PL-NAc (bottom) photoidentification. c Left, representative photoidentified PL-aPVT neuron showing the criteria used for photoidentification: (top) average peristimulus time histogram and raster plot of spikes across trials. (bottom) Z-score normalised to pre-laser onset period. Blue line: laser onset; horizontal red line: Z-score of 3.29; vertical red line: 5 ms after laser onset. Right, distribution of latency to respond after laser onset for photoidentified PL-aPVT and PL-NAc neurons (coloured) and unidentified neurons (grey or not shown when higher than 20 ms) during satiation (n = 208 neurons) and threat (n = 413 neurons) tests. Red dashed line showing 5 ms threshold. Heatmap and averaged traces of different clusters of neurons showing similar or distinct dynamics during food-cue presentation in d, e hungry vs. satiated states (n = 208 neurons) and h, i safe vs. threat states (n = 413 neurons). f, j Percentage of each cluster in unidentified neurons, PL-aPVT neurons, and PL-NAc neurons. Adjusted residuals from one-sided Chi-squared test showing that g clusters 3 and 7 in satiation test are significantly enriched in PL-aPVT neurons, k cluster 3 in threat test is significantly enriched in PL-aPVT neurons and clusters 1 and 4 in threat test are significantly enriched in PL-NAc neurons *p < 0.05; red: adjusted residual >2; blue: adjusted residual <2. Insets of each panel: area under curve within 0.6 s after the cue onset. e, clusters 3 and 7 insets; i, clusters 1 and 4 insets, Two-sided Wilcoxon signed-rank test; i, cluster 3 insets, Two-sided paired Student’s t test. *p < 0.05. Data in (e) and (i) shown as mean ± SEM. Box plot centre line, median; box limits, upper and lower quartiles; whiskers, 1.5× interquartile range; points, outliers. Source data are provided as a Source Data file.

Among the eight clusters identified during hungry vs. satiated states, clusters 3 and 7 displayed rapid food-cue responses specific to the hungry and satiated states, respectively (Fig. 5d, e and Supplementary Fig. 9a–c). Strikingly, both clusters were significantly enriched in PL-aPVT neurons, when compared to PL-NAc and unidentified neurons (Fig. 5f, g). These results indicate that a sizable subset (25 out of 65 cells, ~38%) of PL-aPVT neurons are recruited to respond to food cues specifically during hungry or satiated states. In contrast, two categories emerged among the 8 clusters identified during safe vs. threat states (Supplementary Fig. 9d–f). Clusters 1 and 4 that showed food-cue responses exclusively during safe or threat states, respectively, were significantly enriched in PL-NAc, whereas cluster 3 that showed similar food-cue responses in both states was enriched in PL-aPVT neurons (Fig. 5h–k). These results indicate that persistent food-cue responses of PL-aPVT neurons may encode the stable metabolic needs during safe and threat states, whereas PL-NAc neurons may encode the varying food-seeking motivation observed from safe to threat states. Together, our findings suggest that PL-aPVT neurons are involved in the transition from hungry to satiated states, whereas PL-NAc neurons are involved in the transition from safe to threat states.

To further explore the role of PL-aPVT and PL-NAc neurons in the expression of various behavioural outputs, we clustered their dynamics in relation to lever presses, risk assessment (head-out behaviour towards the centre area while the rat’s body remains in the hidden area), and freezing responses during the threat test. For both risk assessment and freezing responses, we used a pose-estimation algorithm to identify behavioural onset and duration (DeepLabCut47, see ‘Methods’). We found that PL-aPVT neurons contributed to a cluster of neurons that was transiently activated before, and subsequently inhibited after, risk-assessment onset (cluster 9 in Supplementary Fig. 10e–h). PL-aPVT neurons also contributed significantly to clusters that were either activated or inhibited at freezing onset (clusters 1 and 4 in Supplementary Fig. 10i–l). In contrast, PL-NAc neurons contributed to the excitatory responses following lever presses (cluster 3 in Supplementary Fig. 10a–d) or before risk assessment (cluster 8 in Supplementary Fig. 10e–h), as well as to the inhibitory responses identified at freezing onset (cluster 8 in Supplementary Fig. 10i–l). These results suggest that the unique dynamics of PL-aPVT and PL-NAc neurons contribute differently to various behaviours during food seeking and the expression of defensive responses.

PL-aPVT and PL-NAc neurons causally regulate food-seeking behaviours during satiated and threat states, respectively

Next, we tested the necessity of PL-aPVT or PL-NAc neurons in regulating cued food seeking during the transition from hungry to satiated states. Because our neural recording and decoding analyses demonstrated that PL neurons represent internal states through both their spontaneous activity and their responses to other task-relevant variables, in addition to food cues, we opted for a chemogenetic approach to inactivate the two subpopulations of PL neurons throughout the entire session. We infused a retrograde viral vector to express Cre recombinase into aPVT or NAc (retroAAV-Cre-eGFP), followed by an intra-PL infusion of a Cre-dependent viral vector that expresses either the inhibitory chemogenetic construct hM4Di (AAV-hSyn-DIO-hM4Di-mCherry) or the control reporter mCherry (AAV-hSyn-DIO-mCherry) to selectively inactivate PL-aPVT or PL-NAc neurons with Clozapine-N-oxide (CNO) during the test (Fig. 6a and Supplementary Fig. 2h–o). We used a shuttle food-seeking test (Fig. 6b) designed to more effectively assess food-seeking motivation by requiring rats to alternate between two sides of the chamber and press a lever for food on the active side during food cues. Animals were tested under two metabolic states: (i) food restricted for 24 h, and (ii) freely fed as a moderate satiation protocol (Fig. 6b, see ‘Methods’). This satiation protocol induced only a partial reduction in food seeking, thereby allowing detection of both increases and decreases in behaviour due to circuit manipulations (Fig. 6c–f; PL-aPVT animals, lever presses during food restricted: 25.38 ± 1.24/min; lever presses during freely fed: 19.12 ± 1.71/min; paired Student’s t test, t = 3.36, p = 0.006. PL-NAc animals, lever presses during food restricted: 23.86 ± 1.37/min; lever presses during freely fed: 15.12 ± 2.05/min; paired Student’s t test, t = 4.75, p < 0.001, see additional comparisons in Supplementary Table 1).

Fig. 6: Inactivating PL-aPVT neurons reduces food seeking during satiation, whereas inactivating PL-NAc neurons restores food seeking during threat states.
figure 6

a Schematics of viral infusion of retrograde AAV expressing Cre recombinase to aPVT or NAc, and Cre-dependent hM4Di or mCherry control to PL. b Schematics of the shuttled food-seeking test. c Under food restriction, chemogenetic inhibition of PL-aPVT neurons (turquoise, n = 8) had no effect on food-seeking behaviour when compared to the viral control group (grey, n = 5). d When freely fed, chemogenetic inhibition of PL-aPVT neurons (turquoise, n = 8) further reduced lever presses, latency to presses, and percentage of rewarded trials, when compared to the viral control group (grey, n = 5). Under either e food restriction or f free fed conditions, chemogenetic inhibition of PL-NAc neurons (dark red, n = 8) had no effect on food-seeking behaviour, when compared to the viral control group (grey, n = 8). g Schematics of the threat test. h, i During the odour phase, chemogenetic inhibition of PL-aPVT neurons (turquoise, n = 8) had no effect on avoidance behaviour, when compared to the viral control group (grey, n = 5). i During the conflict phase, chemogenetic inhibition of PL-aPVT neurons (turquoise, n = 8) had no effect on the food-seeking or avoidance behaviour, when compared to the viral control group (grey, n = 5). j During the odour phase, chemogenetic inhibition of PL-NAc neurons (dark red, n = 8) during cat odour exposure reduced the percentage of time expressing avoidance behaviour and freezing behaviour, but had no effect on the percentage of time exhibiting approaching behaviour to odour mesh, when compared to viral control group (grey, n = 7). k During the conflict phase in cat odour test, chemogenetic inhibition of PL-NAc neurons (dark red, n = 8) during cat odour exposure reduced the percentage of time expressing avoidance behaviour, freezing behaviour and percentage of approaching behaviour to odour mesh, but only had a trend to increase lever presses rate, when compared to viral control group (grey, n = 7). cf, hk, Two-way repeated measures ANOVA followed by Sidak post hoc test. *p < 0.05. Box plot centre line, median; box limits, upper and lower quartiles; whiskers, 1.5× interquartile range; points, individual data. Source data are provided as a Source Data file.

We found that the inactivation of PL-aPVT or PL-NAc neurons did not affect food-seeking behaviours when rats were food restricted (Fig. 6c, e), suggesting that activity in these projections is not required to express cued food-seeking behaviours during hungry states. Control animals in the PL-NAc group showed a slight increase in lever presses from baseline to CNO day, possibly due to delayed acquisition of the task (Fig. 6e). However, inactivation of PL-aPVT neurons in moderately satiated animals further reduced food-seeking responses (Fig. 6d), whereas inactivation of PL-NAc neurons did not affect food-seeking responses when compared to controls (Fig. 6f). The reduction in food seeking observed between the CNO and the baseline conditions resembles the divergent behavioural phenotypes previously observed between Suppressed Pressers and Persistent Pressers, implying a potential role for PL-aPVT neurons in modulating behavioural phenotypes during satiation. These findings suggest that activity in PL-aPVT neurons is required to maintain a substantial level of food seeking after animals’ metabolic needs are met, potentially encoding the incentive motivation of cues for hedonic feeding. This aligns with our observation that a subset of PL-aPVT neurons (cluster 7 in Fig. 5d–g) is preferentially activated by food cues in satiated states.

We then used the same animals to inactivate the PL-aPVT and PL-NAc projections during the threat test. In contrast to their role in the satiated state, the inactivation of PL-aPVT neurons had no effect on defensive behaviours during the cat odour exposure phase, nor on food-seeking responses and defensive behaviours during the conflict phase (Fig. 6g–i). On the other hand, inactivation of PL-NAc neurons reduced defensive responses, including avoidance and freezing during the cat odour exposure phase, and biased rats’ behaviour towards food seeking during the conflict phase (Fig. 6j, k). The persistent food seeking and reduced defensive behaviours in the hM4Di group during the conflict phase mirror the phenotype of Persistent Pressers in the calcium imaging experiment, whereas controls resemble Suppressed Pressers, pointing to a potential role for PL-NAc neurons in modulating behavioural phenotypes during threat. These results suggest that PL-NAc neurons are necessary for both the expression of innate fear responses in a food-associated context and the suppression of food-seeking behaviour during predator odour conflict. This is consistent with our observation that PL-NAc neurons show distinct food-cue responses in safe vs. threat states (Fig. 5h–k).

Overall, our findings establish dual roles for prefrontal-thalamic and prefrontal-accumbal circuits in mediating metabolic versus emotional regulation of food seeking. Whereas activity in PL-aPVT neurons facilitates hedonic food seeking during satiated states, activity in PL-NAc neurons suppresses food-seeking behaviours under threat states.

Discussion

Integrating internal metabolic and emotional states with environmental food cues is essential for adaptive food-seeking behaviour, ensuring a balance between energy requirements and survival needs. Here, we report that PL neuronal population dynamics continually encode food cues and food-seeking behaviour as animals transition from hungry to satiated or safe to threat states. State-specific recruitment of food-cue responsive neurons in different PL subpopulations acts as a shared neuronal mechanism that governs how internal states modulate cued food-seeking behaviour. However, our findings demonstrate that distinct neuronal ensembles and PL efferents are mobilised to modulate food seeking during changes in metabolic or emotional states. This contradicts previous speculations that the neural mechanisms underlying satiation- and threat-induced food-seeking suppression might overlap due to the involvement of similar brain regions and neuropeptides48,49,50. Using single-unit recordings from projection-defined PL neurons and chemogenetic inactivation of distinct PL circuits, we further revealed that PL neurons that project to the aPVT or the NAc selectively regulate hedonic food-seeking responses during satiation or food-seeking suppression during threat, respectively. Overall, these results suggest that divergent PL pathways mediate metabolic or emotional control of food-seeking behaviour in response to environmental cues.

PL has been extensively studied for its roles in forming associations between environmental stimuli and reward outcomes, as well as for updating actions when stimulus-outcome relationships change13,51,52,53. Recent studies have identified heterogeneous activity patterns in distinct ensembles of PL neurons, showing both excitatory and inhibitory responses to reward cue presentation or conditioned reward seeking10,13,54,55,56. While part of the heterogeneity in PL activity has been explained by its divergent projections, with NAc-projecting neurons being mostly excited during the food cues and PVT-projecting neurons being mostly inhibited during the food cues, each group of projecting neurons still shows diverse response patterns13, consistent with our results. Notably, a fraction of PL neurons displays consistent reward cue responses across trials and days after conditioning55, supporting our findings of stable food cue responses in a small subset of PL neurons. Nevertheless, relatively little is known about how PL neurons enable distinct behavioural responses while preserving stable stimulus-outcome relationships (e.g. food-cue association) during changes in internal needs or environmental conditions. Linking distinct PL neuronal responses to task-relevant behaviours is challenging due to the mixed selectivity across PL neurons to multiple task-associated variables and preparatory motor signals10,53,55,57,58. We used supervised nonlinear encoding models to demonstrate that the PL population robustly represents food cues even when cued food seeking is suppressed, as well as other task-relevant behaviours such as food approaching and threat avoidance, but not locomotion alone. Using both calcium imaging and single-unit recording, we showed that internal state changes are represented by a shift in the activity of most cue-responsive neurons, whereas a small subset of neurons maintained consistent cue responses, potentially encoding the unchanged stimulus-outcome association. However, removing cue-responsive neurons did not affect population decoding accuracy for internal states. This result corroborates previous research on the nonlinear mixed selectivity of prefrontal cortex neurons55,57,59,60, suggesting that neurons selectively responsive to food cues as well as those exhibiting mixed selectivity contribute to the representation of internal states.

Expanding on the limited number of studies on satiation during cued-food seeking8,61,62,63, we identified two behavioural phenotypes following voluntary satiation or predator threat exposure across both sexes: one showing complete feeding suppression and the other showing persistent food-seeking behaviour in response to food cues. While previous rodent studies have reported individual behavioural variability during satiation64,65 and approach-avoidance conflict10,31,66, the underlying neural mechanisms remained largely unexplored. We found that individual variability in food suppression is represented in PL population dynamics and food-cue responses, where varying population neural trajectories and decoding accuracies, as well as distinct recruitment of food-cue responsive neurons, correspond to each behavioural phenotype. Our results underscore the contribution of distinct neuronal populations in PL to encoding individual differences in reward-seeking behaviour in response to changes in metabolic and emotional states.

Single-unit recording revealed that PL-aPVT neurons display differential food-cue responses during hungry vs. satiated states but retain the same magnitude of food-cue responses during safe vs. threat states, indicating that they primarily represent metabolic states over threat levels. Consistently, chemogenetic inactivation of PL-aPVT neurons suppressed food-seeking responses during satiated but not hungry states. These results suggest that activity in such subset of PL-aPVT neurons may promote hedonic food-seeking motivation by attributing more incentive value to food cues, which aligns with the previously reported role of PL-PVT neurons in modulating incentive values of food cues during Pavlovian-conditioned food seeking67. While we could not identify other studies inactivating PL-aPVT neurons in satiated animals, the lack of effects in cued food-seeking following inactivation of PL-aPVT neurons in hungry rats is consistent with a previous study showing that inactivation of PL-PVT projections in water-restricted mice did not affect reward-seeking responses during a cued sucrose-licking test13. Together, these findings suggest that activity in PL-PVT neurons is not required for cued reward seeking during states of enhanced motivation (i.e. thirsty or hungry), but may help to maintain reward-seeking behaviour following satiation. Importantly, previous studies have shown that optogenetic activation (i.e. 10–20 Hz) of PL-PVT projections at the onset of the reward-associated cues suppresses, rather than facilitates, cued reward-seeking responses in both thirsty and hungry animals13,56, suggesting that increased activity in PL inputs to PVT is sufficient to interrupt cue-elicited motivated behaviour. This suppression of reward-seeking behaviour diminishes when the PL-aPVT pathway is activated at either lower (3 Hz) or higher (30 Hz) frequencies, indicating modulation in a frequency-dependent manner56. Thus, the differing effects of inactivating PL-aPVT neurons during hungry or satiated states likely arise from the recruitment of distinct subsets of aPVT neurons according to the frequency of activity of PL inputs56, along with the presence of distinct subsets of aPVT neurons that either promote (e.g. glucose-sensitive neurons)68 or suppress (e.g. glucokinase- and corticotropin-releasing factor-expressing neurons)29,69 reward-seeking behaviour.

Our results demonstrating that PL-NAc inactivation does not affect cued food seeking during hungry states are consistent with previous findings showing that this pathway is required for drug seeking, but not sucrose seeking, when animals are food-deprived, suggesting a dissociation in the role of the PL-NAc pathway during food versus drug rewards70,71,72,73. However, the lack of involvement of PL-NAc projections during satiated states is unexpected, given prior research showing that the mPFC-NAc pathway mediates hedonic intake of high-fat food in mice subjected to time-restricted binge eating or compulsive food-intake tests74,75. This discrepancy may result from the distinct roles of the mPFC-NAc pathway in maladaptive (i.e. binge or compulsive) versus natural cued hedonic feeding, as well as from the absence of differentiation in these studies between the PL and infralimbic divisions of the mPFC, or the core and shell subregions of the NAc, despite their well-established antagonistic roles in reward-seeking behaviour76,77,78,79. In contrast, our results revealed a higher diversity of food-cue responses in PL-NAc neurons, with specific subsets of cells changing their firing rates selectively during either safe or threat states. These findings indicate that food-cue responses in PL-NAc neurons may encode both safety go signals and threat no-go signals as the animal transitions from safe to threat states. Accordingly, we found that chemogenetic inactivation of PL-NAc neurons increases cued food-seeking behaviour only during threat exposure, indicating that activity in PL-NAc neurons is required for threat-induced food suppression. Our results corroborate previous findings showing that the activity of mPFC-NAc neurons is suppressed prior to reward-seeking behaviour when mice face the risk of receiving an electrical shock, and optogenetically reactivating mPFC-NAc neurons that were labelled during the shock session is sufficient to suppress cued food-seeking responses46. In contrast, another study demonstrated that optogenetic activation of PL-NAc projections at the onset of a tone-signalled footshock reduces active avoidance during a self-initiated food-seeking test, while inactivation of the same pathway has no effect80. Together, these findings suggest that PL-NAc neurons may play distinct roles in suppressing self-initiated food seeking during the presentation of conditioned aversive cues versus suppressing cued food-seeking responses in the presence of innate threats. Furthermore, the functional divergence between PL-PVT and PL-NAc cue responses broadens the traditional view on how these pathways encode food-related-cues13,81, suggesting a dynamic recruitment pattern that can both maintain the food-cue association and modulate the behavioural responses.

We previously demonstrated that inactivation of aPVT neurons enhances food-seeking responses, whereas inactivation of ventromedial hypothalamus (VMH) neurons that project to the aPVT reduces defensive behaviours in rats exposed to the same predator-odour approach-avoidance conflict test used in this study29. Similarly, other groups have demonstrated that the PL-PVT pathway modulates conditioned fear responses82,83, proposing a role for PL-PVT circuits in defensive behaviours. Surprisingly, here we report that inactivation of PL-aPVT neurons has no effect on defensive behaviours and food-seeking responses during conflict. While these findings align with previous work showing that inactivation of PL-PVT projections does not affect the frequency or the duration of food seeking events during an unsignalled shock conflict test84, they are unexpected given that PL is the major source of glutamatergic innervation to aPVT neurons44. One possible explanation is that PL-aPVT and VMH-aPVT projections might separately mediate defensive responses to signalled (i.e. conditioned) and unsignalled (i.e. unconditioned) threats, respectively. Accordingly, previous studies that demonstrated a role for the PL-PVT pathway in defensive responses have all relied upon conditioned fear. For example, optogenetic inactivation of PL-PVT projections impairs freezing responses to a conditioned auditory cue85, whereas optogenetic activation of this same pathway suppresses signalled active avoidance in rodents56,83. Additionally, another study has demonstrated that activity in mPFC-PVT neurons is necessary for suppressing food seeking when cues signalling aversive outcomes are presented82. The discrepancies between our findings and published results may stem from differences in rodent species and strains, behavioural models, freely moving vs. head-fixed conditions, dietary regimens and brain manipulation strategies. Future studies should explore the specific roles of PL-PVT projections across various types of food-seeking and defensive behaviours to reconcile these contradicting findings.

Our cross-mapping imaging results identified an ensemble of PL neurons with stable food-cue responses under similar food-motivated states, but these responses decreased during satiated and threat states. This suggests that such PL ensemble might encode the incentive value of food cues, which is potentially reduced during satiation and threat states. While satiation has a well-documented role in devaluation86, it remains unknown whether predator threat exposure induces a similar devaluation effect as that observed during aversive outcomes like conditioned taste aversion87. Alternatively, reduced food-cue responses might reflect a decrease in preparatory locomotion during satiation and threat states, roles previously attributed to PL neurons88,89,90. However, this is unlikely because the decay in food-cue responses occurs immediately after the food cue onset (i.e. 300 ms), significantly earlier than the average latency for rats to press the lever following food cue onset (i.e. 5 s), and the dynamics of the PL neuronal population do not encode general locomotion in our task. Thus, these results further support our conclusion that distinct PL projections mediate food-seeking suppression during satiated and threatened states. Future investigations will assess how satiation signals and threat-related information are conveyed to these distinct subsets of PL neurons.

Collectively, our findings reveal a similar pattern of population- and single-neuron encoding of internal metabolic and emotional states during cued food seeking. Specifically, we identified two divergent subsets of projection-defined PL neurons that regulate cued food-seeking behaviour separately during changes in metabolic or emotional states. Compared to overlapping circuits, these divergent pathways and diverse activity patterns may enable animals to achieve enhanced behavioural flexibility across various gradients of metabolic and emotional states, facilitating crosstalk between the states91. Understanding the neural circuits that regulate cued food seeking under distinct internal states may help optimise targeted treatments for metabolic- versus anxiety-driven eating disorders.

Methods

Animals

All experimental procedures were approved by the Centre for Laboratory Animal Medicine and Care of the University of Texas Health Science Centre at Houston. The National Institutes of Health guidelines for the care and use of laboratory animals were strictly followed in order to minimise any potential discomfort and suffering of the animals. Male and female Long–Evans hooded adult rats (Charles River Laboratories) with 3–5 months of age and weighing 300–450 g (males) or 250–300 g (females) at the time of the experiment were used. Animals were single housed and, after a 3-day acclimation period, handled and trained to press a lever for sucrose as described below. Rats were kept in a 12-h light/12-h dark cycle (light from 7:00 to 19:00) with water ad libitum. Animals were maintained on a restricted diet of 18 g per day of standard laboratory rat chow. Animals’ weight was monitored weekly to make sure all animals maintained 85% of their initial weight under food restriction. During pre- and post-surgery phases, animals had ad libitum access to food for a total of 7 days.

Surgeries

Rats were anaesthetised with isoflurane and mounted on a stereotaxic frame (Kopf Instruments). For injection-only surgeries, the incision was stitched after the intracranial injection by using surgical suture (Nylon, 3–0). For implantation surgeries, the implants were fixed to the skull using a dental adhesive (C&B metabond, Parkell), ortho acrylic cement, and four to six anchoring screws. After surgery, animals received a subcutaneous injection of meloxicam (1 mg/Kg), and a topical triple antibiotic was applied in the incision area.

Viral vectors injection

Viral injections were performed using a microsyringe (SGE, 0.5 µl) with an injection rate of 0.05 µl/min followed by an additional waiting time of 10 min to avoid backflow. The following coordinates from bregma were used: PL unilateral GCaMP6f infusion, +2.7 mm anterior-posterior (AP) for male, +2.6 mm AP for female, +0.6 mm medial-lateral (ML) and −4.0 mm dorsal-ventral (DV) at a 0° angle; PL unilateral ChR2 infusion, +2.7 mm AP, +1.5 mm ML and −4.0 mm DV at a 15° angle; PL bilateral infusion, +2.7 mm AP, ±1.5 mm ML and −3.8 mm DV at a 15° angle; PVT, −2.1 mm AP, −1.83 mm ML and −5.5 mm DV at a 20° angle; NAc, +1.2 mm AP, ±3.0 mm ML and −7.2 mm DV at an 11° angle. For calcium imaging, 0.6 µl of AAV9-CaMKII-GCaMP6f-WPRE-SV40 (Addgene) was infused into PL. For photoidentification of PL-aPVT and PL-NAc neurons, 0.5 µl of AAVrg-hSyn.HI.eGFP-Cre (Addgene) was unilaterally infused into the aPVT or the NAc, followed by the infusion of 0.5 µl of AAV5-EF1a-DIO-hChR2(H134R)-mCherry (UNC Vector Core) into PL unilaterally. To inhibit PL-aPVT or PL-NAc neurons, 0.4 µl of AAVrg-hSyn.HI.eGFP-Cre was unilaterally injected into the aPVT or bilaterally injected into the NAc, followed by the bilateral injection of 0.5 µl of AAV-hSyn-DIO-hM4Di-mCherry (Addgene) or AAV-hSyn-DIO-mCherry (Addgene) into the PL to Cre-dependently express either the hM4Di receptor or the control fluorescent protein mCherry specifically in PL neurons that project to aPVT or NAc.

Gradient Refractive Index (GRIN) lens implantation

For PL calcium imaging, a 20-gauge blunt guide needle was first inserted into the brain and slowly moved to 0.8 mm above the target coordinate at a speed of 0.1 mm/min, and then withdrew to create a track for the lens. Next, a GRIN lens (1.0 mm DA, 9.0 mm length, Inscopix) was unilaterally implanted aiming at the PL by using the following coordinates from bregma: +2.7 mm AP (male), +2.6 mm AP (female); +0.8 mm ML; −3.6 mm DV, at a 0° angle. The lens was fixed with flowable dental composite (Flow-it ALC, Pentron) and covered by dental adhesive (C&B Metabond, Parkell) and ortho acrylic cement. Three weeks after lens implantation, a base plate was placed on top of the lens and fixed with ortho acrylic cement while connecting to a miniscope to determine the best field of view.

Single-unit recordings

An optrode consisting of an optical fibre surrounded by recording wires (200 µm core, 32-channels, Bio-Signal) was implanted aiming at the PL by using the following coordinates from bregma: +2.7 mm AP; +1.5 mm ML; −3.9 mm DV, at a 15° angle. The ground wire was wrapped against a grounding screw previously anchored into the skull. Two insulated metal hooks were implanted bilaterally into the cement to allow firmly attachment of the array connector to the headstage cable during recording by using a thin elastic band.

Drugs

For chemogenetic inhibition, CNO (Tocris) was used as a ligand for the inhibitory receptor hM4Di92. CNO was dissolved in 1% of DMSO in sterile saline solution and intraperitoneally injected 30 min prior the test (3 mg/kg), similar to previous studies29.

Behavioural tasks

Lever-press training

Rats were placed in a plexiglass operant chamber (34 cm high x 25 cm wide x 23 cm deep, Med Associates) and trained to press a lever for sucrose on a fixed ratio of one pellet for each press. Next, animals were trained in a variable interval schedule of reinforcement that was gradually reduced across the days (one pellet every 15, 30 or 60 s) until the animals reached a minimum criterion of 10 presses/min. All sessions lasted 30 min and were performed on consecutive days. Sucrose pellet delivery, variable intervals and session duration were controlled by an automated system (ANY-maze, Stoelting). Lever-press training lasted approximately one week, after which animals were assigned to surgery or cued food-seeking training. A small number of rats failed to reach the lever press criteria and were not included in the subsequent experiments (<3%).

Cued food-seeking training

Rats previously trained to press a lever for sucrose were conditioned to learn that each lever press in the presence of an audiovisual cue (tone: 3 kHz tone, 75 dB; light: yellow, 100 mA; 30 s duration) resulted in the delivery of a sucrose pellet into a nearby dish. While the light cue helps to direct the animal toward the lever during the beginning of the training phase, the tone assures that the animals do not miss any trial and provides the temporal precision required for single-unit recordings. After ~3 consecutive days of training (24 trials per day, pseudorandom intertrial interval of ~120 s, 60 min session), rats learned to discriminate the food-associated cue as indicated by a significant increase in lever press rate during the presence of the audiovisual cues, when compared to the 30 s immediately before the cue onset (cue-off). The cued food-seeking training was completed when animals reached 50% discriminability index (presses during cue-on period minus presses during cue-off period divided by the total number of presses)93.

Satiation test

After completing the cued food-seeking training, rats were placed into a plexiglass rectangular arena (40 cm high x 40 cm wide x 26 cm deep, Med Associates, see schematic drawing in Fig. 1a). For behavioural quantification, the arena was subdivided into two compartments, with one of them equipped with a lever, a dish and an external feeder similar to a food-seeking operant chamber, which was named food area (40 cm high x 12 cm wide x 26 cm deep). Rats were first re-trained to press for sucrose in the presence of the same audiovisual cues until they reached 50% of discriminability index. Then, animals received a day of cued food-seeking press-off training in which the audiovisual cue was turned off after each lever press or 30 s after the cue onset, thereby reducing rats’ response to a single press and dish entry per cue. This enabled us to correlate each food-seeking event with the activity of PL neurons. Following that, rats received two extra days of alternate training, in which the press-off trials and 30 s press-deliver trials were presented in a pseudorandomly intercalated manner until they could correctly distinguish single-press from multiple-press trials. This procedure was used to habituate the animals to the satiation test that consisted of both press-off trials and press-deliver trials. This also served to avoid unexpected reward-omission effects when switching from 30 s press-deliver trials to press-off trials.

During the hungry phase of the satiation test, food-restricted rats were presented with 12 audiovisual cues (press-off trials, pseudorandom inter-trial intervals in a range of 30–90 s). Animals were then exposed to 10 audiovisual cues (30 s duration, press-deliver trials, 90 s interval), followed by 30 min of sucrose ad libitum to induce satiation, during which ~10 sucrose pellets were automatically delivered to the dishes by the experimenter every time they were emptied by the animal. Next, 10 additional audiovisual cues (30 s duration, press-deliver trials, 90 s interval) were presented to verify if animals were in a satiated state. During the satiated phase of the test, rats were presented again with 12 audiovisual cues (press-off trials, pseudorandom inter-trial intervals in a range of 30–90 s). Food approach responses were characterised by the time spent in the food area of the arena. After each animal finished the test, the arena was cleaned thoroughly with 70% ethanol solution.

Cat odour collection and preparation

Cat saliva collection was performed in collaboration with a veterinary clinic in our city (https://www.snapus.org). A stripe of filter paper (0.5 cm × 6 cm) was gently introduced into the mouth of a cat and kept underneath its tongue for ~10 min while the animal was recovering from an incidental anaesthesia. The saliva-soaked stripes were placed in a 50 ml falcon tube, transported back to the lab at 4 °C and stored at −20 °C until the day of experimentation. The amount of saliva in each filter paper was estimated by weighing the identified filter paper stripes before and after the collection. We have previously observed that ~100 μL of saliva collected from cats of different sexes, strains and ages result in similar defensive behaviours. The filter paper stripes impregnated with the cat saliva were placed in a half-sphere metal mesh, which was anchored to the wall of the behaviour chamber, nearby the food dish.

Threat test

After completing the cued food-seeking training, rats were placed into a plexiglass rectangular arena (40 cm high x 60 cm wide x 26 cm deep, Med Associates, see schematic drawing in Fig. 1g) and re-trained to press for sucrose in the presence of the same audiovisual cues until they reached 50% of discriminability index. The arena consisted of a hidden area (40 cm high x 20 cm wide x 26 cm deep) separated from an open area by a plexiglass division. An 8-cm slot located in the centre of the division enabled the animal to transition between both sides of the arena. For behavioural quantification, the open area was subdivided into a centre area and a food area (40 cm high x 12 cm wide x 26 cm deep), the latter being equipped with a lever, a dish and an external feeder similar to a food-seeking operant chamber. During the baseline, animals were placed in the arena in the presence of a neutral odour (filter paper stripes soaked with distilled water) for 10 min without any other stimuli. Next, 12 audiovisual cues (30 s duration, pseudorandom inter-trial intervals in a range of 30–90 s) were presented during an additional 20 min. The total duration of the session lasted 30 min. Each lever press in the presence of the cues resulted in the delivery of a sucrose pellet into the dish. During the conflict test in the following day, rats were placed in the arena in the presence of the cat odour only (filter paper stripes soaked with cat saliva) for 10 min. Next, the audiovisual cues were concomitantly presented to the animals using the same intervals of the baseline. Avoidance was characterised by the time spent in the hidden area of the arena. Freezing was characterised by the complete absence of movements except those needed for respiration. Head-out responses were characterised by a body stretching movement to peep out toward the odour mesh while in the hidden area, and were used as a measure of risk-assessment behaviour.

To track the same neuronal population during the miniscope and single-unit recording experiments, rats were exposed to a single recording session separated into three different phases: (i) a food-seeking phase (12 audiovisual cues of 15 s in the presence of a neutral odour, 10 min duration), (ii) a cat odour phase (10 min of cat odour exposure, no audiovisual cues) and (iii) a conflict test (12 audiovisual cues of 15 s in the presence of cat odour, 10 min duration for miniscope recordings; 24 audiovisual cues of 15 s in the presence of cat odour, 30 min duration for single-unit recordings). After each animal finished the test, the arena was cleaned thoroughly with 70% ethanol solution, except the odour area.

Shuttle food-seeking test

Rats previously trained to press a lever for sucrose in the presence of an audiovisual cue were trained for 3 additional days in the shuttle food-seeking test (See schematic drawing in Fig. 6a). The same arena used for the approach-avoidance conflict test was modified to contain two levers, two feeders, two food dishes, two speakers and two light cues positioned in opposite walls of the chamber. Rats were trained to alternate between both sides of the arena and receive sucrose pellets after they press the lever in the side of chamber signalled by the audiovisual cues. Two consecutive laser-off trials were followed by two laser-on trials, making a total of ten trials.

Microendoscopic calcium imaging

Imaging experiments were carried out at least 7 days after the base plate surgery. Rats were habituated to the miniscope cable and handled by the experimenter for three days before the beginning of the tests. A UCLA miniscope V4 (parts purchased from Open Ephys and Labmaker) was used to record the calcium transients at 20 Hz. The videos containing the animals’ behaviour were was recorded using a video tracking system (ANY-maze). The miniscope was connected to a digital acquisition device through a flexible coaxial cable, which also sent a transistor–transistor logic (TTL) signal to the ANY-maze system. This setup allowed each frame to be recorded for the subsequent synchronisation of calcium transients with behaviour tracking.

Extraction of calcium signals

Recorded raw videos were processed using minian, an open-source analysis pipeline that integrates motion correction, constrained non-negative matrix factorisation, and manual inspection of cellular signals extracted from miniscope calcium imaging data37. Custom Python codes were used to align the calcium transients and inferred spike data to the tracked behaviours.

Analyses of single-cell responses

After aligning the calcium transients to the event type (e.g. food cue onset), the perievent activities across all trials of the event were averaged and binned to 300 ms bins. The responses to the event were then calculated as Z-scores normalised to the baseline bins before the event onset. Permutation test was used to identify neurons that show either excitatory or inhibitory responses to the event onset. Specifically, the difference between the average Z-score value of the 1.5-s window after event onset and the 0.5-s window before the event onset was calculated. The 1.5-s time window was selected based on the minimum average latency of 1.6 s for rats to press the lever after cue onset. The difference value was compared to a null distribution of permutated difference values, which was generated by circularly permuting the calcium traces with a random shift value for 1000 times and aligning them to the event each time to calculate the permutated difference. A neuron was considered to show excitatory responses if its true difference value was above the 97.5% of the null distribution, and inhibitory responses if its true difference value was below the 2.5% of the null distribution (p < 0.05). Only neurons showing Z-scores above 0.5 during the 1.5-s post-cue window were considered to be excited, and only neurons showing Z-scores below −0.5 during the 1.5-s post-cue window were considered to be inhibited. Applying this criterion excluded 27 neurons that the permutation test had initially classified as inhibitory-responsive because their activity peaked immediately before the food cue onset and decreased afterward, indicating that they were not triggered specifically by the cue. For one cell that showed an extreme Z-score value of 500, two trials that contributed to the extreme value were excluded from the calculation of averaged trial response as they were classified as artifacts.

Cross mapping of different recording sessions

Cross mapping of neurons from different recording experiments performed in the same animal was carried out by using Minian37. Briefly, the maximum projections of spatial footprints of neurons from each recording session were used to calculate the shifts between the recording sessions. After applying the shifts, the centroid of each spatial footprint for each neuron was calculated. Using the obtained values, the pairwise distance between cells in all pairs of sessions were calculated. Only cell pairs with less than 15 pixels of distance were considered the same cell. Cross-mapping of neurons in each animal was visually verified.

CEBRA models

CEBRA models were used to capture the complex relationship between neural signals and rat behaviour34. We used these nonlinear neural network latent models to better capture the lower-dimensional representation of behavioural outcomes and cues from the high-dimensional neural activities, which has been shown to outperform traditional linear and nonlinear methods such as PCA and tSNE34.

We trained supervised CEBRA behaviour models in a longitudinal manner to obtain lower-dimensional embeddings for hypothesis-driven analysis. Models were trained with one set of the following auxiliary labels: food-seeking behaviours (approach and lever press), food cue presentation, locomotion (speed) and for threat test only, defensive behaviours (freezing and avoidance). This resulted in three models per animal for label combinations associated with satiation test and four models per animal for label combinations associated with threat test.

A cohort of 5 rats for satiation tests and 8 rats for threat tests were selected based on representative behavioural outcomes and number of neurons recorded. Models were trained individually for each animal under each label combination. An 80:20 train-test split was implemented, with grid search optimisation for hyperparameters on the training set based on Information Noise-contrastive Estimation (InfoNCE) loss. Model convergence was visualised using InfoNCE loss over 10,000 iterations. Optimal models were evaluated on testing sets against shuffled labels, which were used as a control. Estimated embeddings in the first three dimensions from optimal models were visualised to delineate the low-dimensional neural signal pattern relative to behavioural outcomes or cue presentations. Consistency scores across animals were calculated using embeddings trained with food cue presentations to ensure consistent patterns. Tables detailing optimal hyperparameters for each model and outcome combination are provided in the Supplementary Table 2.

Decoding analysis was performed on the latent embeddings to assess their performance in capturing behavioural outcomes or cue presentations. KNN decoders were trained using the three-dimensional embeddings from training sets, employing a cosine-distance metric and 36 neighbours predetermined by pilot analysis. Median absolute error (MedAE) was used to evaluate decoding accuracy on test sets by calculating the differences between predicted labels vs the observed ground truth. Each label within each label combination was trained with individual KNN. For multi-label combinations, the MedAEs were calculated for each label within the combination, and their average was used for evaluation. Min-max scaling was applied within training and testing sets separately before training to enable cross-model comparisons. To better understand the absolute error distribution under each model, empirical error distributions were visualised as cumulative density functions against absolute errors. One-way ANOVA followed by Sidak post hoc tests was used to compare MedAE across models.

Decoding performance of population dynamics

LDA models were used to identify the linear combination of features that best separates the population activities around food cue presentations during each of the binary classes of internal states (e.g. hungry vs. satiated). After aligning the calcium transients to the food cue onsets, the perievent activities across each cue onset were calculated as Z-scores normalised to the baseline bins before the cue onset. The mean value of the calcium transients during the 1-s window following each cue onset was used as one sample. The population dynamics was constructed as a n x m matrix, where n is the total number of food cues across the two states and m is the number of all or a subset of PL neurons recorded in each experiment as described in each figure.

The population dynamics data were scaled before splitting to training and test sets using stratified shuffle split to ensure the number of cues from each state are balanced in both sets. The training set was used for model fitting after a comprehensive grid search of shrinkage value of auto, 0.001, 0.01, 0.1, 0.5 and 0.9 with a lsqr solver that maximise the decoding performance. The model was then used to generate a prediction from the test set, which was compared to the ground truth to calculate the decoding performance. Area Under the Receiver Operating Characteristic Curve (auROC) was used as the decoding performance to account for false positive and false negative rates. We then shuffled the label of the classes randomly for 1000 times and a mean shuffled auROC score from all shuffling was used as the chance performance. This process was repeated for 8 times with different training/test sets splitting and the 8 true values were compared to the 8 shuffled values for final evolution. For time-course decoding analysis, the values of the calcium transients for each 1.5-s time bin, from 10 s before to 10 s after each cue onset, were processed using the same procedures as described above, and the mean and s.e.m. of auROC scores and shuffled auROC scores from the eight-fold cross validation were used for each 1.5-s time bin.

Neural trajectory analysis

PCA was employed to reduce the dimensionality of population dynamics, enabling the extraction and visualisation of simplified, averaged neural trajectories across trials in distinct internal states. The trial-averaged perievent activities were calculated by averaging calcium transients of 10 s before and 10 s after cue onsets across all trials and binning them to 300-millisecond bins. The responses to the event were then calculated as Z-scores normalised to the baseline bins before the event onset. The trial-averaged responses underwent PCA, where the covariance matrix of the standardised data was used to extract PCs capturing the majority of variance in the trial-averaged responses. The number of components to retain was determined by applying the elbow method to identify a natural cutoff point of the scree plot where the marginal gain in explained variance was significantly diminished.

After determining the optimal number of principal components from the trial-averaged data, these PCs were used to project the high-dimensional, trial-by-trial concatenated neural data (same as in the decoding analysis) onto a lower-dimensional space to generate neural trajectories for each trial, which were subsequently averaged to derive a mean trajectory that reflects the typical neural dynamics associated with each trial-type. This approach ensures that the PCA captures stable, noise-reduced neural dynamics while allowing for the analysis of variability in individual trial responses.

For neural-trajectory comparisons between behavioural groups, we first matched the neuron numbers between the two k-means clusters by drawing a probability-proportional-to-leverage subset from the larger cluster, ensuring that neurons with greater influence on the original PCA space within each behavioural cluster were proportionally represented. The downsampling quality was verified by indistinguishable leverage-score and mean-activity distributions (Kolmogorov–Smirnov, p > 0.88). The balanced neuron pool of the two clusters was then concatenated, mean-centred and subjected to a second PCA that produced a shared ten-component space that explained >90% of the variance, ensuring that subsequent comparisons were performed in a common PCA space. Trial-wise activity matrices were then Z-scored with global means and standard deviations and projected separately for each cluster. Averaged trajectories were plotted in 3-D PC subspaces. To quantify state-dependent shifts, we computed the Euclidean distance between matched trial pairs within each cluster and tested cluster differences with Welch’s t-test (Mann–Whitney U if normality failed). A permutation control that randomly shuffled cluster labels before the balancing-PCA was used to benchmark chance expectations of the observed inter-cluster divergence.

In vivo single-unit electrophysiology

A 64-channel neuronal data acquisition system (Omniplex, Plexon) integrated with a high-resolution video-tracking system (Cineplex, Plexon) was used for electrophysiological recordings from freely behaving animals. Both videos and neuronal recordings were combined within the same file, thereby facilitating the correlation of behaviour with neuronal activity. The system was connected to the head-mounted array by using a digital headstage cable (32 channels, Plexon), a motorised carousel commutator (Plexon) and a digital headstage processor (Plexon). Rats were habituated to the headstage cable daily for approximately one week before the beginning of the experiments. Extracellular waveforms exceeding a voltage threshold were band-pass filtered (500–5000 Hz), digitised at 40 kHz and stored onto disk. Automated processing was performed using a valley-seeking scan algorithm and then visually evaluated using sort quality metrics (Offline Sorter, Plexon). Single-units were selected based on three principal components and waveform features such as valley-to-peak and amplitude measurements. Commercial software (NeuroExplorer, NEXT Technologies) and Python scripts were used to calculate the spontaneous firing rate, food-cue responses, lever press responses and dish entry responses. A high-resolution camera (CinePlex, Plexon) was used to track the moment in which the animals’ head entered the food dish. TTL pulses were sent to the data acquisition system to flag the onset of food cues, lever presses and dish entries. Food cue, lever press and dish entry responses were calculated as Z-scores normalised to 20 pre-cue bins of 300 ms and fed into downstream clustering analysis. At the end of the recording sessions, a micro-lesion was made by passing anodal current (0.3 mA for 15 s) through the active wires to deposit iron in the tissue. After perfusion, brains were extracted from the skull and stored in a 30% sucrose/10% formalin solution until the histological analysis.

In vivo photoidentification of PL-aPVT and PL-NAc neurons

During photoidentification of PL-aPVT and PL-NAc neurons, we recorded neuronal activity from rats expressing ChR2 in PL-aPVT or PL-NAc neurons. An optical cable was connected to the blue laser by using a patch cord through a single rotary joint. The optical cable was attached to the headstage cable and coupled to the previously implanted optical fibre using a ceramic sleeve. At the end of the behavioural session, 10 trains of 10-s laser pulses (5 ms pulse width, 5 Hz, 10 mW) were delivered with the blue laser controlled by a Master-9 programmable pulse stimulator, which also sent TTL pulses to the data acquisition system to mark the time of the laser events. Neurons were considered to be responsive to the photostimulation if they showed a significant increase in their firing rates above the baseline (20 ms, Z-score > 3.29, P < 0.001) within the 5 ms after laser onset, as previously described10,25.

Behavioural tracking

Rats were recorded with digital video cameras (Logitech C920) and behavioural events were measured using automated tracking system (ANY-maze, Stoelting). For single-unit recording analyses, the detection of freezing and risk assessment behaviours was performed using DeepLabCut, an open-source deep-learning tool for pose estimation47. DeepLabCut parses videos of rats into csv files, which contain information about the x and y-coordinates of pre-specified body parts of interest as well as a likelihood parameter denoting the expected accuracy of the point. After that, custom Python scripts were used to identify behavioural events.

Freezing behaviour was defined as the absence of movement for more than 1 s. We defined being still as when the average Euclidean distance between all of animal’s body parts in one frame and the next frame is less than 0.8 pixels. For risk assessment, we used napari to define two rectangular regions on either side of the hidden area’s entrance. The risk assessment behaviour was then defined as intervals when the rat’s nose was in the centre side while the body remained in the hidden area, with a minimum duration of 1 s. Events were filtered so that only those not preceded by the same type of behavioural event within the previous 6 s were used for subsequent analysis.

Spectral clustering of calcium imaging and single-unit data

Spectral clustering analyses of calcium imaging and single-unit recording data of PL neurons were carried out as described in previous studies40. The Z-scored trial-averaged responses from each pair of states to be compared (e.g. hungry vs. satiated, safe vs. threat) were concatenated before undergoing PCA. The covariance matrix of the standardised data was used to extract PCs capturing the majority of variance in the concatenated trial-averaged responses. The number of principal components that could accumulatively explain at least 98% (for cross-mapping of calcium imaging data) or 55% (for single-unit data) of the variance was retained and verified by visualising the response vectors in PC weights of both states of each component, which typically yielded 8–9 PCs that show distinct PC-weight patterns across time in each state. We opted for a higher percentage of variance explained for cross-mapping of calcium imaging data due to the dominance of a single principal component that captures a significant portion of the variance (>70%), indicating the presence of strong, global neuronal patterns. This approach ensures the inclusion of essential signals without losing critical information. In contrast, the more balanced distribution of variance among principal components (~25% by first PC) in single-unit data, reflecting nuanced and individual neuronal activities, necessitates a lower variance explained threshold to accurately represent the complex patterns inherent to these recordings.

The spectral clustering analyses were performed using Python Scikit-learn package, which constructs an affinity matrix built from a KNN connectivity matrix. A comprehensive grid search of the number of clusters (from 3 to 9) and number of nearest neighbours (from 10 to 200) was conducted by maximising the silhouette score. The separation between clusters was verified by tSNE transformation and visualised in 2D tSNE spaces between each pair of clusters against each other. After clustering, each neuron received an appropriate cluster label. To identify enriched clusters in each group of projecting neurons, Chi-square test was performed on the percentages of each cluster within the PL-aPVT, PL-NAc and Unidentified neurons. Clusters with an adjusted residual greater than 1.96 from the Chi-square test were defined as significantly enriched.

K-means clustering of behavioural phenotypes

K-means clustering analysis was carried out to identify the different behavioural phenotypes of animals during the satiation or threat test by using Python Scikit-learn package, similar to previous studies94. The different behavioural indices for each test were grouped and scaled as Z-scores. The number of K-means cluster was selected by a search from the range of 2–11 by maximising the silhouette score, which resulted in 2 for both satiation test and threat test. Initially, cluster centroids were selected through sampling from an empirical probability distribution, prioritising points’ contribution to total inertia to ensure maximal separation. Then, the process iteratively assigned each data point to the closest centroid and updated the centroids based on the average of points in each cluster, continuing up to 300 iterations or until centroid modifications were less than 1e−4, utilising the Lloyd’s algorithm to optimise cluster assignments. The clustering results were visualised in a 2D space defined by the first two principal components derived from the PCA-transformed data. The distinction between the two clusters was illustrated through a radar chart, which displayed the mean values of behavioural indices for animals within each cluster. To standardise the comparison, these indices were rescaled to a 0–100 range, unless they already fell within this range.

Histology

Animals were transcardially perfused with KPBS followed by 10% buffered formalin. Brains were processed for histology as previously described95. Only rats with the spread of fluorescent labelling and the track of the electrode wires or lens located exclusively in the target areas were included in the statistical analyses.

Microscopy and image analysis

Images were generated by using a microscope (Nikon, Eclipse NiE Fully Motorised Upright Microscope) equipped with a fluorescent lamp (X-Cite, 120 LED) and a digital camera (Andor Zyla 4.2 PLUS sCMOS). Images were analysed using NIE Element Software.

Statistics and reproducibility

Behavioural and tracing experiments were replicated at least 2 times. All additional experiments, including imaging and single-unit recordings, were performed in multiple batches of replication at least 3 times per experiment. Data were then combined after histological verification of implant position and/or viral vector expression to generate the final sample size of each group. Although experimenters were not blinded to group assignments, all behavioural and neuronal analyses were performed using fully automated and unbiased procedures. Statistical significance was assessed based on the normality of the data, which was first evaluated using Shapiro–Wilk test. For data with normal distribution, paired or unpaired Student’s t test, one-way ANOVA, and two-way repeated-measures ANOVA followed by Šidák or Bonferroni post-hoc comparisons were used, whereas for data without normal distribution, Wilcoxon signed-rank test, Mann–Whitney U test, and Fisher’s exact test were used, as indicated for each experiment.

Reporting summary

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