Figures and data

Functional profiling of DTG cells in a goal-directed navigation task
(A) Schematic of the goal-directed navigation task. Top Left: the circular maze with a blackcue and an unmarked goal zone (dashed line). Top Right: Reconstructions were made of the final tetrode recording sites (red dots) in the right hemisphere of RSC (dark gray) for all animals. Bottom: Task protocol. The rat is required to wait for at least two seconds in the goal zone, then leave the goal zone to search for a single randomly scattered pellet reward, consume the reward, and subsequently navigate back to the goal zone for the next trial. (B) The maze was evenly divided into four areas, and the trajectory occupancy was calculatedfor each. The rats’ trajectories were concentrated in the area with goal (blue). The grey dots represent the sessions and the error bars represent mean ± SEM of the data. (C) The reward acquisition across each session is shown, with gray dots representing the number of rewards earned per minute for all sessions at each time point. Blue dots indicate the mean reward rate, and the blue shaded region represents mean ± SD of the reward rate across sessions. (D) Examples of five DTG cells. Top: Distance-to-Goal tuning curves (gray area represents95% CI from shuffle). Middle: GLM-predicted spatial rate maps reconstructed from the fitted Poisson GLM for each cell. Bottom: observed (natural) spatial rate maps. The concordance between GLM-predicted and observed maps confirms that the model captures each cell’s spatial firing structure. (E) Sorted tuning curves of all DTG cells (n = 62). (F) Proportion of cells encoding Distance-to-Goal identified through the intersection ofGLM-based forward feature selection and shuffle-based significance criteria (DTG: 13.4%, 62/463). (G) Distribution of preferred distances for DTG cells. (H) Spatial information index distribution of DTG cells. Top: spatial information indexhistogram for DTG cells (blue) and simulated place cells (red). Bottom: null distribution from shuffle group; black dashed line indicates the 99% threshold from the shuffle group. (I) Comparison of the spatial information index among three groups. DTG cells have significantly higher spatial information index values than the shuffle group, but their spatial information index values are significantly lower than those of simulated place cells. **p < 0.0001. (J) Similar to panel H but showing spatial stability. Top: Stability histogram for DTG cells (blue, 64.5% above threshold) and simulated place cells (red, 87.7% above threshold). Bottom: null distribution from shuffle group; black dashed line indicates the 99% threshold (stability = 0.30) from the shuffle group. (K) Comparison of spatial stability among three groups. DTG cells have significantly higherstability than the shuffle group, but are significantly lower than simulated place cells. **p < 0.0001.

Sparse efficient encoding of Distance-to-Goal in RSC neural population
(A) Comparison of decoded (orange), actual (dark blue), and shuffled (grey) Distance-toGoal values over a representative 60-second segment, demonstrating that the CEBRA-based population decoder faithfully tracks the animal’s moment-to-moment distance to the goal. (B) Evaluation of the contribution of single neurons in decoding Distance-to-Goal, usingimportance score calculated from EBM. IMP (green), DTG (purple), IMP & DTG (green & purple), and Other (grey). Each bar represents the importance score of a cell, with the length of the bar indicating the magnitude of the score. (C) Partial dependence plot (PDP) of predicted response versus firing rate (z-scored) for eachIMP cell. IMP cells are shown as individual lines with color-coding based on the sign of their linear slope (green for positive, dark blue for negative). Other neurons are represented as shaded grey areas, providing an overview of general response patterns. Both IMP and DTG cells exhibit monotonic relationships between firing rate and predicted Distance-to-Goal, whereas Other RSC cells display flat, uninformative response profiles. (D) Venn diagram showing the overlap between different neuron groups (IMP only = 87,DTG only = 17, IMP ∩ DTG = 23, DTG_R = 127 total, Other = 143). (E) Effect of cell number on Distance-to-Goal decoding performance. The black line representsthe average decoding performance, with the gray shaded region showing the 95% CI from 100 sampling iterations. The gray dashed line represents the shuffled baseline results. The DTG_R group (golden cross) exceeds the expected decoding performance for its population size, while the Other group (dark cross) shows the lowest decoding performance for its population size. (F) Decoding index (R2) across different cell groups. DTG_R cells exhibit significantly higher decoding performance compared to the Other group, and All cells significantly outperform DTG_R (Wilcoxon signed-rank test: ALL vs. DTG_R, W = 5, p = 0.039; ALL vs. Other, W = 0, p = 0.004; DTG_R vs. Other, W = 0, p = 0.004; n = 9 sessions, two-sided). Diamond point and error bars represent mean ± SEM of the data. *p < 0.05, **p < 0.01. Inset: population sizes of All, DTG_R, and Other groups as percentage of total.

Task-dependent goal-biased distance encoding revealed by neural attention map
(A) A schematic of attention map calculation. Left: For each reference point in the maze, thedistance from the rat to that point is calculated and decoded, with the resulting R2 value used to quantify the animal’s representation strength for that location. Middle: These points are used to construct an attention map that represents the spatial attention distribution of the animal regarding distance encoding. Right: The final attention map is divided into two sectors based on the location of the Goal: Sector 1 (Goal) and Sector 2. The mean normalized R2 values in both sectors are then calculated and used to analyze the relationship between the animal’s distance representation and the Goal. (B) Attention maps from the goal-directed navigation task and the corresponding maps from the random foraging task for four example sessions. (C) Left: In the goal-directed navigation task, R2 values are significantly higher in Sector 1 (with the Goal) compared to Sector 2 (Wilcoxon signed-rank test, n = 9, p = 0.002). Right: In the random foraging task, no significant difference is found in attention maps between the two sides of the maze (Wilcoxon signed-rank test, n = 8, p = 0.991). p < 0.01, ns > 0.05. (D) Similar to C. Compared to the functional population’s preference coding for the goal area(Wilcoxon signed-rank test, n = 9, p = 0.002), simulated cells show no preference for the goal side in their attention maps (Wilcoxon signed-rank test, n = 9, p = 0.633). p < 0.01, ns > 0.05.

Mixed selectivity and variable-specific representation geometry in RSC
Panels A–C characterize mixed selectivity of DTG cells, whereas panels D–F quantify variablespecific separability–smoothness geometry at the population level. (A) Schematic of the Poisson GLM with forward feature selection. Five behavioral variablesPosition (P), Distance-to-Goal (D), Speed (S), Egocentric boundary bearing (E), and Head direction (H) are each projected onto B-spline basis functions and combined through linear weights with L1 regularization. The weighted sum is passed through an exponential link function to produce Poisson-distributed predicted firing rates. Model selection is performed via 10-fold cross-validation with a forward search procedure (see Methods). (B) Distribution of the number of behavioral variables encoded by DTG cells as determined bythe GLM forward search. The majority of DTG cells encode multiple variables conjunctively: 35.5% (22/62) encode two variables, 17.7% (11/62) encode three, and 22.6% (14/62) encode four, while 24.2% (15/62) encode a single variable. (C) An example DTG cell illustrating conjunctive encoding. Left: spatial rate map (GLMpredicted) showing a ring-like firing pattern centered on the goal. Right: tuning curves for Distance-to-Goal, Speed, and Egocentric boundary bearing, and a polar plot for Head direction, demonstrating that this cell simultaneously encodes multiple behavioral variables. (D) Separability–smoothness geometry for GoalLight sessions. Each variable is summarizedby macro-scale separability (structure index, StrI; x-axis) and Micro-scale Smoothness (1− normalized Local Neighborhood Consistency; y-axis). Dot size indicates decoding R2. Positive slopes describe the balance between separability and local smoothness for each variable: EGO (blue, m = 0.74), DTG (orange, m = 1.93), HD (red, m = 0.87), P (purple, m = 1.31), and S (teal, m = 2.00). (E) Decoding Index (R2) comparison across five behavioral variables. DTG and EGO achieve the highest decoding performance, while adopting opposite representation geometries (see D). *p < 0.05, **p < 0.01. (F) Bootstrap stability analysis of separability–smoothness slopes across GoalLight andGoalDark sessions. Points and intervals show mean bootstrap slope estimates and 95% confidence intervals (n = 10,000 iterations). The dashed line marks the unity reference (m = 1). Pairwise significance markers indicate permutation-test differences in slope between variables. **p < 0.01, ***p < 0.001.

Allocentric enhancement and stable egocentric representations in RSC during goal-directed navigation
(A) Schematic of head direction (red) calculation. (B) Top: the proportion of head-direction cells in the goal-directed navigation task vs. thatin the random foraging task (RF: 7.5%, 35/464; Goal: 16.4%, 76/463; χ2 = 17.30, p = 3.18 × 10−5). Bottom: decoding index (accuracy) of head direction using all neurons in the goal-directed task vs. that in the random foraging task (Wilcoxon rank-sum test, U = 2, p = 0.043; Goal = 9 sessions, RF = 8 sessions). ****p < 0.0001, *p < 0.05. (C) Schematic of Egocentric-boundary-bearing (blue) calculation. (D) Top: the proportion of egocentric boundary bearing cells in the goal-directed navigationtask vs. that in the random foraging task (RF: 18.5%, 86/464; Goal: 17.3%, 80/463; χ2 = 0.25, p = 0.618). Bottom: decoding index (accuracy) of Egocentric-boundary-bearing using all neurons in the goal-directed navigation task vs. that in the random foraging task (Wilcoxon rank-sum test, U = −0.4, p = 0.7; Goal = 9 sessions, RF = 8 sessions). ns > 0.05. (E) Spatial distribution of MVL_max locations for neurons with high egocentric tuningselectivity (MVL_max > 0.25). The heatmap shows the number of cells whose MVL_max falls in each spatial bin. Neurons with high MVL_max are distributed across the maze without specific concentration near the goal region (dashed circle), in contrast to the goal-biased pattern observed in the population-level distance representation (Figure 3B). (F) Venn diagram showing the overlap between MVL_max neurons and DTG neurons (MVL_max only = 57, overlap = 12, DTG only = 50), confirming that these represent largely distinct subpopulations. (G) Spatial distribution of MVL_max locations for the 12 co-classified neurons (overlapbetween MVL_max and DTG populations). These neurons show no preferential MVL_max locations near the goal (dashed circle), indicating that egocentric boundary coding showed no detectable goal-centered spatial organization in this task context.

Stability of goal encoding in RSC during dark navigation
(A) Preferred angle of HD cells across three behavioral tasks (RF Light, Goal Light, GoalDark). The cue is positioned on the right side of each figure (dark gray). Note that in the dark environment, the cue will be removed; the original position is shown here. In the goal-directed navigation task, HD cells exhibited a clear preference for the cue (Rayleigh p = 0.004, n = 95 cells). In the random foraging task, no preference for the cue was observed (Rayleigh p = 0.472, n = 39 cells). In the dark condition, HD cells still maintained a preference for the direction of the original cue (Rayleigh p = 0.01, n = 71 cells). (B) Tuning curves of all DTG cells that maintained Distance-to-Goal tuning across light anddark conditions (n = 27 cells), displayed as population heatmaps. Left: Goal Light condition. Right: Goal Dark condition. Cells are sorted by the position of the peak tuning value in the light condition, demonstrating preservation of tuning order across conditions. (C) In the dark environment, the distance encoding of RSC neurons still preferentially targetsthe region where the goal is located (Wilcoxon signed-rank test for Sector 1 vs. Sector 2, W = 32.5, p = 0.021, n = 9 sessions, one-sided). *p < 0.05. (D) Proportion of cells that maintained stable Distance-to-Goal tuning in both light and darkconditions (LD-Stable DTG: 43.5%).

Classification of neurons and histological details, related to Figure 1.
(A) Histological reconstruction of recording sites. For each animal, the final recording locationsof all tetrodes (red dots) were reconstructed in RSC (dark gray). All recording sites were confirmed to be within RSC. (B) Neurons in RSC were classified into putative pyramidal neurons (trough-to-peak ≥ 0.4 ms, red dots) and putative interneurons (trough-to-peak < 0.4 ms, blue dots) based on trough-to-peak duration, firing rate, and waveform asymmetry (AB ratio), displayed in a three-dimensional feature space. (C) Representative waveforms of all putative pyramidal neurons (red) and putative interneurons (blue). (D) Proportion of DTG neurons based on neuronal type and recording location. Among DTG neurons, pyramidal neurons (DTG-Pyr: 93.5%, 58/62, red) and interneurons (DTG-Int: 6.5%, 4/62, blue) exhibited distributions consistent with those observed for all recorded cells (ALL-Pyr: 88.6%, 410/463; ALL-Int: 11.4%, 53/463). The distribution of DTG neurons across the dRSC (light gray) and the gRSC (dark gray) was as follows: DTG-dRSC: 72.6% (45/62) and DTG-gRSC: 27.4% (17/62), which was comparable to the distribution of all recorded cells (ALL-dRSC: 68.3%, 316/463; ALL-gRSC: 31.7%, 147/463). (E) Quality control metrics for spike sorting. From left to right, histograms illustrate themedian amplitude, signal-to-noise ratio (SNR), and isolation distance of all neurons recorded during the goal-directed navigation task.

Comparison of DTG cells tuning, related to Figure 1
(A) Example firing rate maps for DTG cells, other RSC cells, and simulated place cells. (B) Comparison of spatial coherence. Left: Comparison between other RSC cells and DTGcells; Right: Comparison between simulated place cells and DTG cells. DTG cells exhibit higher spatial coherence than other RSC cells but lower coherence than simulated place cells. ****p < 0.0001, Wilcoxon Rank-Sum Test. (C) Comparison of spatial information between other RSC cells and DTG cells. DTG cells exhibit significantly higher spatial information than other RSC cells. ****p < 0.0001, Wilcoxon Rank-Sum Test. (D) Comparison of spatial stability between other RSC cells and DTG cells. DTG cells showgreater spatial rate map stability than other RSC cells. ****p < 0.0001, Wilcoxon Rank-Sum Test.

Comparison of Distance-to-Goal tuning properties across DTG, IMP, and Other cells, related to Figure 2
(A) DTG score – This metric quantifies the degree of Distance-to-Goal tuning in each neuron.Both DTG and IMP cells show significantly higher DTG scores compared to Other RSC cells, with DTG cells exhibiting the strongest tuning. ***p < 0.001, Mann-Whitney U test. (B) Stability – This measure reflects the stability of the tuning curve over time, with highervalues indicating more consistent tuning. The statistical comparison reveals that DTG and IMP cells have significantly higher stability than Other RSC cells, indicating that DTG and IMP cells maintain a more consistent response profile in relation to the task. However, the stability of IMP cells is lower than that of DTG cells. ***p < 0.001, Mann-Whitney U test. (C) Importance – This measure quantifies the relative importance of neurons in predictingbehavioral variables. The statistical analysis demonstrates that DTG and IMP cells exhibit significantly higher importance than Other RSC cells, indicating their stronger contribution to the prediction model. ***p < 0.001, ns > 0.05, Mann-Whitney U test. (D) Range – This parameter reflects the span of neural responses. The statistical comparisonshows that DTG and IMP cells have a significantly broader range of responses compared to Other RSC cells, suggesting more dynamic and informative neural activity. ***p < 0.001, ns > 0.05, Mann-Whitney U test. (E) Linear slope – The linear slope indicates the directionality of the neural response. Thestatistical analysis reveals that DTG and IMP cells show significantly steeper slopes than Other RSC cells, highlighting their stronger directional effects in the model. ***p < 0.001, ns > 0.05, Mann-Whitney U test.

Workflow for simulating functional neurons and comparison of DTG tuning, related to Figure 3
(A) Step 1: Functional Neuron Quantification. For egocentric boundary cells, the preferredangle, preferred distance, angular spread (σangle), and distance dispersion (σdistance) are quantified from the boundary rate maps. For head direction cells, the preferred angle and angular spread are determined from head direction tuning curves. The tuning characteristics of speed cells are determined based on the mean speed and standard deviation from the animal’s real trajectory. These parameters are used as inputs to the corresponding cell policies (BoundaryVectorCells, HeadDirectionCells, and SpeedCell) in RatInABox. (B) Step 2: Import Real Trajectory. Real animal trajectory data is imported to align thesimulation with actual behaviour, providing the basis for agent positioning and movement in the virtual environment. (C) Step 3: Import Noise. Noise levels (Std 0, Std 1, and Std 4) are added to the firing rates of the simulated neurons, with five noise values selected within the range of each real cell’s firing rates to simulate different noise conditions. (D) Step 4: Simulation. RatInABox is used to simulate the activity of neurons in a virtualenvironment corresponding to the experimental maze. The simulation generates firing rate patterns for each cell type (egocentric boundary bearing, head direction, and speed cells) based on the defined policies and noise levels. (E) Step 5: Tuning Similarity Evaluation. The Pearson correlation between the tuning curvesof simulated and real cells is calculated at each noise level. The best-simulated neurons are identified based on their highest correlation with real neurons, ensuring that the simulated population closely mirrors the real population for further analysis. (F) Comparison of tuning similarity between simulated and actual cells for three functionalcell types (HD, EGO, Speed). Error bars represent mean ± 95% CI of the data. (G) Comparison of Distance-to-Goal tuning between functional and simulated neuronalpopulations. Top left: Normalized firing rates showing a positive correlation with distance in functional cells (blue) and their corresponding simulated cells (orange). Inset: Difference in Distance-to-Goal tuning (functional minus simulated). Top right: Similar to the left, but depicting a negative correlation. Bottom: Distribution of slope differences (|Data|−|Simulation|) between functional and simulated cells. The positive shift indicates that functional cells exhibit significantly steeper Distance-to-Goal tuning slopes than their simulated counterparts. ****p < 0.0001. (H) The functional cell population significantly outperforms the corresponding simulated cellsin Distance-to-Goal decoding. Error bars represent mean ± SEM of the data. *p < 0.05.

Attention maps for functional and simulated cells across sessions, related to Figure 3
(A–D) Attention maps showing the spatial preference of functional and simulated cells for four example sessions. Only the functional cells exhibit a goal-preference distance representation, while both populations share the same influence from goal-directed non-uniform trajectories, ruling out behavioral biases.

Functional cell type proportions within the DTG population, related to Figure 4
Comparison of the proportions of four functional cell types HD, EGO, Speed, and Place between DTG cells (blue) and the overall recorded population (gray). None of the four cell types was significantly enriched in the DTG population (HD: DTG = 19.4%, All = 16.4%, p = 0.63; EGO: DTG = 17.7%, All = 17.3%, p = 1.0; Speed: DTG = 12.9%, All = 19.2%, p = 0.24; Place: DTG = 19.4%, All = 19.9%, p = 1.0; Chi-squared test), indicating that Distance-to-Goal encoding is broadly distributed across functional cell types in RSC rather than being preferentially coupled with any single type of spatial or motor representation. ns > 0.05.

Further analysis of HD Cells, related to Figure 6
In the Goal-aligned angular coordinate system, we did not observe any asymmetric distribution of preferred angles for HD cells (Goal Light: p = 0.24; Goal Dark: p = 0.88; Rayleigh test).

Behavioral quantification and decoding of goal navigation task under light and dark conditions, related to Figures 1 and 6
(A) Behavioral quantification of the goal-directed navigation task under light conditions. Left: Reward rate per minute (mean ± SD, yellow) during the light condition, with gray representing data from individual sessions, as also shown in Figure 1C. Right: Relationship between animal speed, trajectory occupancy, and Distance-to-Goal, with gray lines representing data from each session and the black line indicating the average. (B) Similar to panel A, behavioral quantification of the goal-directed navigation task in thedark condition. The reward rate and trajectory occupancy indicate that animals are still able to perform the goal-directed navigation task with reduced visual information, although the reward rate per minute (mean ± SD, 1.94 ± 0.73) was lower than in the light condition. (C) Cue and goal zone center positions within the maze for each recording session. As thegoal position varied across sessions, we could assess the relative influence of the goal and cue on animal behavior. (D) Attention maps from four example sessions of the goal-directed navigation task performedin the dark. (E) Comparison of Distance-to-Goal decoding performance under light versus dark conditions. While decoding accuracy for Distance-to-Goal was significantly lower in the dark condition, RSC population still encoded Distance-to-Goal information. **p < 0.01, Wilcoxon signed-rank test.