Behavioral procedure and apparatus. (A)

Schematic illustration of the arena showing major sections (N: nest zone, F: foraging zone, E: encounter zone). At the end of the E-zone, Lobsterbot (red) is situated, guarding the sucrose delivery port (green). (B) A rendered 3-D image of Lobsterbot. The sucrose port is located between the “claws”. The two red lines indicate infrared detectors, one for lick detection (short line) and the other for the entry to the E-zone (long line). (C) The experimental schedule. (D) Sample snapshots of Avoidance Withdrawal (AW) and Escape Withdrawal (EW). In a AW trial, the rat typically retracts its head ahead of time and watches the Lobsterbot attack. In a EW trial, the rat reflexively flees from the attack. (E) Example behavior data containing two consecutive trials (Trial 15 and 16). Each trial started with a reentry to the N zone which triggers gate opening. The rat leaving the N zone typically moves toward the E-zone across the F-zone. The entry to the E zone is detected by an IR beam sensor (blue shade). Within the E zone, the rat starts licking (green lines) until being attacked by Lobsterbot (red line) 3 or 6 s after the first lick. The rat shows voluntary withdrawal behavior (AW; Trial 15) or forced escape behavior (EW; Trial 16). (F) A summary of the AW trial rates for each animal during the L sessions.

Ensemble activity from PL and IL predicts distance from the goal. (A)

Schematic diagram of electrode implantation and estimated recording site. Top: A movable 4-tetrode microdrive was initially implanted in the PL region and lowered ventrally toward the IL after every recording session. Bottom: Representative recording tracks from all five animal are superimposed over an image of a stained coronal section of the frontal brain. Histological examination of all brain sections confirmed that the electrode tracks spanned the dorsoventral axis between the PL and IL. (B) Schematics of the ensemble decoding analysis. The 4-layer deep artificial neural network (ANN) receives populational neural data during 50ms-timewindow and is trained to predict the rat’s current distance from Lobsterbot. The example data depicted in the figure is a sample recording from 20 units when the rat is at a particular distance away from Lobsterbot, indicated by the white bold line. (C) Accuracy of the location prediction. Mean Absolute Error (MAE) was calculated for the two types of decoders: one with the original dataset (Original) and another with the shuffled dataset (Shuffled). The average MAE was 16.61 cm for the Original, which was significantly smaller than that for the Shuffled and smaller than the rat’s body size. This suggests that the PL and IL might encode the spatial distance from the goal. (D) Prediction accuracy in the F-zone during outbound/inbound paths. Decoding accuracy in the F-zone was calculated separately for the outbound (from the N-zone to the E-zone) and inbound (from the E-zone to the N-zone) paths.

Spatial encoding is disrupted by non-navigational behaviors (NNBs). (A)

Spatial distribution of the prediction accuracy. The heatmap indicates MAE of a fully trained ANN, superimposed over the entire foraging arena. The prediction accuracies were lower in the N- and E-zone than that in the F-zone. (B) Mean prediction accuracy by the zones. The MAE in F-zone was significantly lower than the other zones. Error bars represent the SEM. (C) Examples of the NNBs in the N-zone. The top three snapshots depict grooming, rearing and sniffing. The bottom three snapshots show typical goal-directed navigational movements. (D) Comparison of location-decoding errors (N-zone) during navigational vs. NNBs. The error was significantly larger when the rat was engaged in NNBs within the N-zone. (E) Comparison of location-decoding errors of regressors trained with and without NNBs. The overall decoding error was significantly smaller when the ANN was trained without the data during NNBs.

PCA results reveals distinctive population activity in the E-zone (A)

Representative recording session depicting the first two dimensions of the PCA result. Populational neural activities are projected onto a virtual space. Each dot represents 50 ms-long neural activity from multiple units. The color of the dots indicates the rat’s location during the corresponding neural activity. Diamonds represent the centroids of neural representations for each zone. To visually emphasize each cluster, data points close to centroids are selectively plotted. (B) Distances between each centroid pairs from all recording sessions. The centroid of the E-zone is distinctly positioned compared to the centroids of the other two zones, indicating a unique neural state within the E-zone. The triangle above the bar plot represents the relative distance between the centroids of each zone’s neural ensemble activity. Longer edges signify greater dissimilarity between the neural ensemble activities of two zones. Error bars represent the SEM.

Peri-Event Time Histogram (PETH) of all units -responsive to the head entry (HE), aligned by the peak firing rate and the averaged activity. (A)

Top: The PETH for each unit is based on the Z-score of which magnitude is color-coded (temperature bar on the right). Bottom: The red vertical lines mark the timing of the HE. The peak latency of each unit varies from as early as 2 s before and to 1∼2 s after the HE. (B) Functional segregation of the recorded units. Top and middle: Two sub-populations of units based on hierarchical cell clustering analysis. Bottom: The averaged activity for each sub-population. (C) PETH of all units responsive to the head withdrawal (HW) and the averaged activity. (D) Functional segregation of the recorded units. Top and middle: Three sub-populations of units based on hierarchical cell clustering analysis. Bottom: The averaged activity for each sub-population.

Neural ensemble activity predicts failure and success of avoidance response. (A)

Schematics of the event decoding analysis. The Naïve Bayesian decoders (NBCs) are trained with 2 s window of neural activity to discriminate avoidance or escape on every trial (AW/EW classifier). The grayscale image depicts an example firing pattern of 17 units on a given trial, arranged to the onset of the withdrawal response. The decoder classifies whether this trial is AW or EW based on this data. (B) Accuracy of the NBC. The decoding accuracy of the classifier was significantly higher than that from the shuffled data. (C) Temporal characteristics of prediction accuracy of the NBC. Prediction accuracy was significantly higher at the time points as early as 5-7 s before the HW. (D) Class discrimination index by the two sub populations of neurons. The class discrimination index indicates that the Type 2 neurons showed a significant discriminatory power towards AW. Neurons in the Type 2 and the Others group did not exhibit significant discriminatory power.

mPFC neurons switch between different functional modes depending on the location.

In the F-zone, goal-directed navigation prompts a greater number of mPFC neurons to encode spatial information compared to other zones. In the E-zone, these neurons switch the encoding scheme for reward- or threat-related information.

Foraging-related behavioral indices fluctuate upon the initial encounter wi th the Lobsterbot but stabilize after 3 sessions.

(A) Number of approaches. The number of approaches, measured in total trials, decreased after the in itial encounter with the Lobster (Lob1), but later increased, surpassing the Sht3 level after 3 sessions. (B) Number of licking behaviors. The number of licking behaviors decreased during the immediate post-robot encounter sessions but returned to Sht3 level after 3 sessions. (C) Number of licks per tria l. The number of licking behaviors per trial was decreased after the encounter. (D) Lick latency. The lick latency increased during the immediate post-robot encounter sessions but returned to pre-encoun ter level after 3 sessions.

A run-and-stop event (sudden velocity drop outside the E-zone) does not evoke neural modulation.

(A) Normalized activity of HE1 and HE2 units during run-and-stop events (colored) show no modula tion of neural activity compared to highly modulated activity around the HEs (black and gray). (B) N ormalized activity of HE1 and HE2 units during run-and-stop events (colored) show no modulation o f neural activity compared to highly modulated activity around the HWs (black and gray).

Most units are classified into either the HE1-HW1 or HE2-HW2 groups

(A) Confusion matrix comparing the HE and HW groups. A large proportion of units fall into either t he HE1-HW1 category (n=299) or the HE2-HW2 category (n=94). (B) Normalized neural activity of Type 1 (HE1-HW1) and Type 2 (HE2-HW2) neurons during HE and HW.