Skip to main content
eLife logoLink to eLife
. 2023 Oct 16;12:e83930. doi: 10.7554/eLife.83930

Flexible coding of time or distance in hippocampal cells

Shai Abramson 1, Benjamin J Kraus 2, John A White 3, Michael E Hasselmo 2, Dori Derdikman 1,†,, Genela Morris 1,4,†,
Editors: Laura L Colgin5, Laura L Colgin6
PMCID: PMC10712950  PMID: 37842914

Abstract

Analysis of neuronal activity in the hippocampus of behaving animals has revealed cells acting as ‘Time Cells’, which exhibit selective spiking patterns at specific time intervals since a triggering event, and ‘Distance Cells’, which encode the traversal of specific distances. Other neurons exhibit a combination of these features, alongside place selectivity. This study aims to investigate how the task performed by animals during recording sessions influences the formation of these representations. We analyzed data from a treadmill running study conducted by Kraus et al., 2013, in which rats were trained to run at different velocities. The rats were recorded in two trial contexts: a ‘fixed time’ condition, where the animal ran on the treadmill for a predetermined duration before proceeding, and a ‘fixed distance’ condition, where the animal ran a specific distance on the treadmill. Our findings indicate that the type of experimental condition significantly influenced the encoding of hippocampal cells. Specifically, distance-encoding cells dominated in fixed-distance experiments, whereas time-encoding cells dominated in fixed-time experiments. These results underscore the flexible coding capabilities of the hippocampus, which are shaped by over-representation of salient variables associated with reward conditions.

Research organism: Rat

Introduction

The hippocampus plays an important role in spatial processing and episodic memory (Andersen et al., 2006; Tulving, 2002). Spatial processing and navigation are supported by spatially tuned cells throughout the hippocampal formation, such as place cells in the hippocampus, which sparsely encode location within an environment (O’Keefe and Dostrovsky, 1971; Muller and Kubie, 1987). Subsequent discovery of time cells in the hippocampus (Kraus et al., 2013; Pastalkova et al., 2008; MacDonald et al., 2011; Tsao et al., 2018; Rueckemann et al., 2021), which encode time within an episode, suggests that the latter may contribute to the building blocks of episodic memory formation. Time cells and place cells share many physiological properties, pointing to a unifying concept of the role of the hippocampus in encoding features required to organize relevant information. We asked whether the encoding of hippocampal neurons is flexible, capable of changing according to behavioral context and task demand. We used previously published data by Kraus et al., 2013, from an experiment which sought to resolve an inherent ambiguity in the interpretation of time cells. Time cells were initially reported in animals running on a running wheel without control of velocity (Pastalkova et al., 2008, although time cells were also reported for immobile rats MacDonald et al., 2011). This led to a potential ambiguity between encoding of time and of distance, due to the fact that, in fixed velocities, distance may be encoded by integration of time. Kraus et al., 2013 varied the velocity of rats running in place on a treadmill, and found subpopulations of hippocampal cells that encoded time, other cells that encoded path-integrated distance and additional cells that encoded both time and distance. These experiments were composed of two types of recording sessions. In one type of session, in all the trials the running duration remained constant at different velocities, whereas in the second type, the treadmill runs accumulated up to a constant distance, at different velocities. We hypothesized that in this experiment, the task demand (i.e. constant time vs. constant distance) determined the type of activity exhibited in the corresponding session. We re-analyzed the data according to the type of behavioral session and found a direct relation between the class of most active cells and the type of session in which they were recorded. In sessions in which the rats ran for a fixed time, the cells’ population was dominated by time-encoding cells, while in sessions where they ran for a fixed distance, the population was dominated by distance-encoding cells.

Results

To examine the dependence of hippocampal coding on task demand, we analyzed data based on experiments by Kraus et al., 2013, which aimed to differentiate between cells encoding time and cells encoding distance in the hippocampus. In these experiments, six rats were trained to run on a treadmill in the central stem of a figure-8 maze (Figure 1a). The rats were provided with a small water reward prior to the initiation of the treadmill session and upon its cessation, thereby conditioning them to maintain their snouts positioned at the water port throughout the duration of the treadmill run, and "clamping" their behavior and spatial position. In each session, consisting of 31–57 runs, the treadmill was operated either for a fixed time or for a fixed distance, where in each run the velocity was set to a randomly chosen speed in the range of 35–49 cm/s (Figure 1b and c). The rats were forced to alternate their post-treadmill turns between right and left. Three of the six rats were trained and recorded exclusively in fixed-distance or fixed-time sessions, while the remaining three rats were trained and recorded in sessions of both types.

Figure 1. Experimental setup.

Figure 1.

(a) The figure-eight maze with treadmill (gray belt) located in the central stem. Water ports are located near the treadmill and at the two lower corners of the maze. Blue line indicates right-to-left alternation; yellow line indicates left-to-right alternation. (b, c) Distribution of the fixed-time sessions treadmill travel times (b) and the fixed-distance sessions treadmill travel distances (c).

© 2013, Elsevier

Figure 1A is reproduced from Figure 1A from Kraus et al., 2013, with permission from Elsevier. It is not covered by the CC-BY 4.0 licence and further reproduction of this panel would need permission from the copyright holder.

Kraus et al. reported that some cells preferentially encoded the distance the rat had run on the treadmill, while other cells preferentially encoded the time from the start of the treadmill movement. We hypothesized that the type of task employed in each session (i.e. fixed-time vs. fixed-distance) would determine the encoding of the neurons (i.e. time-based vs. distance-based). We therefore analyzed the cells on a run-by-run basis, as follows: For each neuron, we defined its response in each run according to the onset of peak firing (see Materials and methods), and examined its relation to the treadmill’s velocity. We classified time-encoding cells as those, in which the response did not systematically depend on the treadmill velocity but instead fired at a fixed time after the initiation of treadmill running. We classified distance-encoding cells as those, in which the onset time was proportional to the treadmill velocity. To examine this classification, we determined the firing onset of each cell in each run and determined the cell’s properties according to three metrics (see Materials and methods section).

We defined a metric, CellType=Var(distance)Var(time)Var(distance)+Var(Time) , based on the distance and time variances (see Analysis Methods). We classified cells with positive CellType, where the distance variance is greater than the time variance as time cells, and negative CellType, where the time variance is greater than the distance variance, as distance cells. For an ideal time cell, CellType = 1 and for an ideal distance cell, CellType=-1.

Of 930 cells recorded we analyzed 679 cells with at least 10 runs showing firing peaks greater than 0.5 Hz. Only cells with peak firing rates occurring during the treadmill run were included in the analysis. As previously reported in Kraus et al., 2013, we observed both distance cells, showing a response at constant distances the animal traveled on the treadmill, and time cells, showing a response at constant times from the treadmill start (Figure 2). In line with our hypothesis, there was a clear relation between the types of experiment and the distribution of time coding and distance coding neurons. In fixed-distance sessions, the neurons exhibited a significant majority (67%) of distance cells. By contrast, in fixed-time sessions time encoding cells dominated (68%). Of the 444 neurons recorded in fixed-distance sessions, the CellType index classified 298 cells as distance cells and 146 as time cells (Figure 3a). Conversely, in the fixed-time sessions 76 of 235 neurons were classified by this index as distance cells and 159 of 235 were classified as time cells. The relation between the cell type and the experiment type is significant (χ2(1)=75.1, p>>0.001 for the total cell population). These proportions were maintained when classifying by other metrics and when using the peak of firing instead of the onset of the response (see supplementary Methods and Figure 3—figure supplement 1). In 5 out of 6 animals, the cells’ encoding depended on the session type (Figure 3—figure supplement 2). (χ2(1)>12, p<<0.001 for 4 animals, χ2(1)=5.7, p<0.02 for one animal), except in one animal (χ2(1)=2.38, p=0.12).

Figure 2. Distance and time cells coding.

(a–h) Examples of two time-coding cells (columns 1–2) and two distance-coding cells (columns 3–4). Row a depicts neural firing as a function of the distance the animal traveled, sorted by the runs’ velocities. The colors represent three velocity groups for which the tuning curves, by time or distance, are presented in rows b and c, respectively. Row d shows the onsets of each run (red dots) and their linear fit (black curve) to the relation S=m*v+n for the time cells and T=k1V+q for the distance cells. The dashed curve represents the end-of-run time, and the dotted curve represents the end of the analyzed period (treadmill stop time, plus 5 seconds). The blue curves are equi-distance points in time. A black curve (the linear fit) which is parallel to the equi-distance curves demonstrates a cell with strong distance coding. (i–l) Examples of the analysis of time (i, j) and distance (k, l) encoding cells. Top row plots depict distance vs. velocity and bottom row plots depict onset vs. 1/velocity. Red line represents an ideal Distance Cell, based on the average distance traveled until the onset time. Blue line represents an ideal Time Cell, based on the average time of the onset and the black line is the linear fit. The closer the slope of the black line is to that of the red line, relative to slope of the blue line, the more the cell encodes distance-encoding, while if the slope is closer to the slope of the blue line, the is more it is time-encoding.

Figure 2.

Figure 2—figure supplement 1. Additional examples of cells showing time coding (a–d) and distance encoding (e–h).

Figure 2—figure supplement 1.

Rows a,e depict neural firing as a function of time, sorted by the run’s velocities. The colors represent three velocity groups for which the tuning curves, either by time or distance, are presented in rows b, f and c, g respectively. Rows d, h show the onsets of each run (red dots) and their linear fit (black curve) based on the relation T=m1V+n for the time cells and T=m1V+n for the distance cells. Dashed curves represent treadmill stop time and dotted curves represent end of period analyzed (treadmill stop time plus 5 s). Blue curves are equi-distance points in time while dashed curve represents end of run time. The more a linear fit curve is vertical the more significant is the time coding of that cell.

Figure 3. Distance and Time Cells classification.

(a) Cells type classified by the CellType metric, averaged over all animals and trials, for fixed-distance and fixed-time experiments (n=18 experiments, mean ± SEM) p<<0.001 by Pearson's chi-squared test using two categories. Diagonal lines represent individual animals. (b) ROC curve (red) showing that the chosen discriminating threshold of 0 (black point) is optimal. The True Positive Rate (TPR) is the percentage of cells classified as distance cells on the fixed-distance session, while the False Positive Rate (FPR) is the percentage of cells classified as distance cells on the fixed-time sessions. (c) Shuffling distribution of the three metrics: CellType, FIT and P-Value. The type of experiment, either fixed-time or fixed-distance, was randomized 1000 times for each of the sessions. All experiments were truncated to 16 s in order to prevent biases. The vertical axis is the Time-Distance balance index (TDI), defined as (#DistanceCells-#TimeCells)/(#DistanceCells + TimeCells) and is between 0 and 1 if there are more distance cells than time cells and between –1 and 0 if there are more time cells than distance cells. The arrows are indicating the actual results which are significant compared to the shuffle distribution.

Figure 3.

Figure 3—figure supplement 1. Additional metrics.

Figure 3—figure supplement 1.

Cells type classified by the FIT metric (a) and p-Value metric (b), averaged over all animals and trials, for fixed distance and fixed time experiments (n=18 experiments, mean ± SEM) p<<0.001 by Pearson's chi-squared test using two categories. The whiskers show the SEM and the points and the lines connecting the points represent individual animal results. (c) Comparison of onset vs peak analysis cells count in each category (d–f) CellType, Fit and p-Value metrics results for a peak-based analysis.

Figure 3—figure supplement 2. The distribution of Time and Place cells, per animal, at various metrics, for Time and Distance sessions.

Figure 3—figure supplement 2.

Animals BK26 (n=3 experiments) and BK33 (n=1 experiment) participated only in distance sessions, while BK45 (n=3 experiments) participated only in a time session, and BK35 (n=3 experiments), BK41 (n=4 experiments) and BK49 (n=4 experiments) participated in both types of sessions. All distributions show a significant dependency on the session type (χ2(1)>12, p<<0.001 for BK35,BK49,BK45,BK33 and χ2(1)=5.7, p<0.02 for BK26 by Pearson's chi-squared test using two categories.), except for animal BK41 (χ2(1)=2.38, p=0.12). The bars represent the percentage of the respective cell type from the entire population of cells in the respective session. The numbers inside the bars represent the number of cells. For the single session animals, the reference distribution used for the χ2 test was taken from the entire population distribution (55% Distance Cells and 45% Time Cells).

Figure 3—figure supplement 3. Distribution of max and average firing rates for Time and Distance cells.

Figure 3—figure supplement 3.

Total 304 time cells and 374 distance cells evaluated. The time cells and distance cells distributions are similar (p=0.975, Kolmogorov-Smirnov test for the max firing rate, p=0.675 for the average firing rate).

We then checked the Receiver Operating Characteristics (ROC) graph of the CellType metric (Figure 2d), using discriminating thresholds in the range of [–1,+1]. The ROC plots the True Positive Rate (TPR) defined as the percentage of cell classified as distance cells in the fixed-distance session, against the False Positive Rate (FPR) defined as the percentage of cells classified as distance cells in the fixed-timed sessions. We found that the optimal threshold (maximum Youden index) for classification of a session based on the CellType metric, was 0. This threshold classifies 67% of the cells as Distance in the Distance sessions and only 32% on the Time sessions. Accordingly, we classified a cell as a time-cell if CellType >0 and as a distance-cell if CellType <0.

To assess the power of the statistics, we compared the results to a distribution generated from shuffled session types (Figure 3c). In order to mitigate any potential biases in this distribution, we truncated all data to a common duration of 16 s, which represents the shortest duration of a treadmill run across all sessions. These results indicate that the dimension the cells encode (Time vs. Distance) is related to the session type (fixed time vs. fixed distance).

Discussion

Classifying neuronal activity according to either time or distance revealed that the hippocampal population encoding strongly registered with the features of the experimental task. In experiments where the treadmill running-time was fixed, the majority of cells encoded a given time from treadmill onset. In contrast, in experiments where the treadmill running-distance was fixed, the majority of cells encoded a specific accumulated distance from treadmill onset. It is worth noting that accumulated time in fixed-time experiments and accumulated distance in fixed-distance experiments may be used as predictors for the progress of the rat towards anticipated reward, which is given at the end of the treadmill run (Whittington et al., 2020; Stachenfeld et al., 2017). As noted previously in Kraus et al., 2013 the same cells, which showed distance-encoding and time-encoding properties in the treadmill, were often selective to places outside of the treadmill as well. To summarize, CA1 pyramidal cells can encode location, distance, or time, depending on the conditions of the experiment or task demand.

Consistency with task demands has been repeatedly demonstrated in hippocampal recording for diverse parameter spaces, such as auditory linear frequency (Aronov et al., 2017), social mapping (Omer et al., 2018; Schafer and Schiller, 2018) or more abstract spaces (Constantinescu et al., 2016; Retailleau and Morris, 2018). How is task-relevant encoding achieved? The activity of place cells and grid cells is commonly modeled using continuous attractor networks (Morris and Derdikman, 2023; Samsonovich and McNaughton, 1997; Burak and Fiete, 2009; Fuhs and Touretzky, 2006; Bush and Burgess, 2014; Hasselmo and Brandon, 2012; Tocker et al., 2015; Gu et al., 2018; Geiller et al., 2022; O’Keefe and Burgess, 1996). Such networks may serve as a natural substrate for amplification of encoding of certain task features, at the expense of others, resulting in an over representation of the salient variables. Such over-representation may help the brain prioritize survival and decision making. By allocating more resources to the salient stimuli, the brain enhances the ability to process and retain the important information.

Another possible mechanism for acquiring representations that are consistent with task structure involves an associative learning process. Such learning would strengthen all connections between cells that were active in a particular trial and weaken others, but ultimately only the connections between cells that are consistently co-active will be strengthened, while others will average out. Thus, in time-fixed experiments, the connections to cells that fire in a manner that is consistent with time would be strengthened, while in distance-fixed experiments connections to cells that are consistent with distance would gain strength. Consequently, those cells will gradually encode either distance or time, depending on the type of experiment.

Irrespective of the exact mechanism explaining the results of this study, the hippocampus is adaptive in its cells’ encoding and seems to be capable to tune them to the parameters best describing the task.

Materials and methods

We used the data provided by Kraus et al., 2013, containing the neurons firing times, the treadmill movement times and the treadmill velocity. The data was analyzed using custom Matlab scripts.

We divided the treadmill moving times into 100ms time bins (other bin resolutions between 50 ms and 500 ms were tested and provided similar results). Response onset for each neuron and run, was defined as the first bin, following at least 1 s of silence within a series of consecutive bins with firing activity which includes the peak of firing. The peak firing was defined as the bin with the highest value within a run, however only cells with an average peak firing of at least 0.5 Hz were included. This methodology was applied consistently across all runs within a session. We chose this approach to mitigate potential biases that could arise from firing rate peaks occurring near the end of the treadmill, which might have been truncated. Basing our analysis on the peak values instead yielded comparable results and levels of statistical significance (Figure 3—figure supplement 1).

Our classification method is based on the premise that for ideal time cells, firing (and hence onset time) should be independent of running speed. Conversely, an ideal distance cell would display firing onsets at times depending on the speed. We therefore performed a linear regression between the onset times (Ti) and the reciprocal velocity (1/Vi) as well as the onset distance (Si) and the velocity (Vi), where i is an index to a specific run on the treadmill, and extracted the slopes (m and k) and offsets (n and q), as described in Equations 1 and 2. Consequently, in the case of a time-encoding cell, the velocity dependent term k1Vi would be small in comparison to the constant q, while for a distance encoding cell, the slope k would approximate the estimated encoded distance. Similarly, in accordance with the relation stated in Equation 2, an ideal distance encoding cell would exhibit a small velocity dependent term m*Vi compared to the constant n, while a time encoding cell would have an estimated encoded time equivalent to the slope m.

Ti=k1Vi+q (1)
Si=m*Vi+n (2)

The CellType metric utilizes the variances of the onset times Ti-T¯2, where the average onset time is computed across all runs within the session, and the onset distances (SiS¯)2, where the average onset distance is calculated across all runs within the session.

CellTypeVi,Si,Ti=iVi*Si-S¯2-iTi-T¯2iVi*Si-S¯2+iTi-T¯2 (3)

CellType is in the range of –1 to +1. For an ideal time-encoding cell, the onset variance i(TiT¯)2=0, and hence CellType = 1. For an ideal distance encoding cell, the distance variance (multiplied by the respective velocity in order to match units) Vi(SiS¯)2=0, and hence CellType=-1.

Additional metrics defined and used for classifying the cells encoding:

The “FIT” metric is defined as follows:

Fit(m,k,T¯,S¯)={10.5<mT¯10.5<kS¯0otherwise (4)

Where m and k are the linear fit slope coefficients (from Equations 1 and 2), T¯ is the average firing onset time and S¯ is the average distance the animal traveled until the onset. Fit is –1 for a distance cell and 1 for a time cell.

The ‘p-value’ metric is defined as follows:

PValue(Vi,Si,Ti)={1p(nolinearrelationbetweenthedistanceandvelocity)<0.051p(nolinearrelationbetweentheonsettimeandthereciprocalvelocity)<0.050otherwise

A stricter metric, utilized the statistical significance of the linearity in Equations 1 and 2, through F-statistics. We classified a cell as distance encoding if the null hypothesis that there is no linear relation between the distance and velocity was rejected with p<0.05. We classified a cell as time encoding if the null hypothesis that there is no linear relation between the onset and the reciprocal velocity was rejected with p<0.05.

Results using these metrics are shown in Figure 3—figure supplement 1.

To ensure the activity peak is not missed, we extended the analysis to 5 s past the treadmill stop time. Otherwise, if a cell activity is concentrated towards the treadmill stop, the calculated onset may be influenced by the truncated activity time and show a false relation of the cell type activity to the time or distance. Moreover, since the truncated data time relates to the experiment type, whether time-fixed or distance-fixed, this could create a false bias of such a relation.

The relation between the type of cell classified in the above metrics and the session type was then tested by Pearson’s chi-square using two categories. The expected distribution of the cells was calculated based on the total number of cells, of each type, out of total cells number, in all sessions. The null hypothesis was defined as no dependency of the cells type distribution on the session type (either fixed-time or fixed-distance). On the per-animal analysis, for animals that were recorded only at a single type of session, we used the distribution of the cell types according to their distribution in all animals’ cells population.

We conducted additional analysis to explore potential relationships between the firing rates and the encoding properties of the cells. Our findings revealed that the distributions of peak firing rates and average firing rates, for time cells and distance cells, were similar (see Figure 3—figure supplement 3).

Funding Statement

The funders had no role in study design, data collection and interpretation, or the decision to submit the work for publication.

Contributor Information

Dori Derdikman, Email: derdik@technion.ac.il.

Genela Morris, Email: genelam@tlvmc.gov.il.

Laura L Colgin, University of Texas at Austin, United States.

Laura L Colgin, University of Texas at Austin, United States.

Funding Information

This paper was supported by the following grants:

  • Israel Science Foundation 2183/21 to Dori Derdikman.

  • Binational Science Foundation (BSF)-NIH CRCNS BSF:2019807 (NIH: 1R01 MH125544-01 ) to Dori Derdikman.

  • Prince Center for the Aging Brain to Dori Derdikman.

  • Israel Science Foundation 3139/22 to Genela Morris.

Additional information

Competing interests

No competing interests declared.

Author contributions

Conceptualization, Software, Investigation, Methodology, Writing - original draft.

Conceptualization, Data curation, Methodology, Writing – review and editing.

Conceptualization, Data curation, Methodology, Writing – review and editing.

Conceptualization, Methodology, Writing – review and editing.

Conceptualization, Supervision, Investigation, Methodology, Writing – review and editing.

Conceptualization, Supervision, Investigation, Methodology, Writing – review and editing.

Ethics

The data in this paper is based on the study in a previous paper (Kraus et al., 2013), and no experiments have been thus performed specifically for this study.

Additional files

MDAR checklist

Data availability

The current manuscript is a re-analysis of data collected for a previously published paper (Kraus et al., 2013). Data used in this paper is available as Matlab files on Dryad: https://doi.org/10.5061/dryad.ngf1vhhxp. Matlab code used for the analysis in the paper is available on https://github.com/derdikman/Abramson_code (copy archived at Derdikman, 2023).

The following dataset was generated:

Abramson S, Kraus BJ, White JA, Hasselmo ME, Morris G, Derdikman D. 2023. Data for Time or distance: predictive coding of hippocampal cells. Dryad Digital Repository.

References

  1. Andersen P, Morris R, Amaral D, Bliss T, O’keefe J. The Hippocampus Book. Oxford University Press; 2006. [Google Scholar]
  2. Aronov D, Nevers R, Tank DW. Mapping of a non-spatial dimension by the hippocampal-entorhinal circuit. Nature. 2017;543:719–722. doi: 10.1038/nature21692. [DOI] [PMC free article] [PubMed] [Google Scholar]
  3. Burak Y, Fiete IR. Accurate path integration in continuous attractor network models of grid cells. PLOS Computational Biology. 2009;5:e1000291. doi: 10.1371/journal.pcbi.1000291. [DOI] [PMC free article] [PubMed] [Google Scholar]
  4. Bush D, Burgess N. A hybrid oscillatory interference/continuous attractor network model of grid cell firing. The Journal of Neuroscience. 2014;34:5065–5079. doi: 10.1523/JNEUROSCI.4017-13.2014. [DOI] [PMC free article] [PubMed] [Google Scholar]
  5. Constantinescu AO, O’Reilly JX, Behrens TEJ. Organizing conceptual knowledge in humans with a gridlike code. Science. 2016;352:1464–1468. doi: 10.1126/science.aaf0941. [DOI] [PMC free article] [PubMed] [Google Scholar]
  6. Derdikman D. Abramson_Code. swh:1:rev:943dead3e093eea9c105ae83cebdd94b9011268cSoftware Heritage. 2023 https://archive.softwareheritage.org/swh:1:dir:9911cd4dc8ea759de60bcc5830e4edbc16a6af9a;origin=https://github.com/derdikman/Abramson_code;visit=swh:1:snp:8762ad64efee2d0f105bb0d94ae52ca67736eedb;anchor=swh:1:rev:943dead3e093eea9c105ae83cebdd94b9011268c
  7. Fuhs MC, Touretzky DS. A spin glass model of path integration in rat medial entorhinal cortex. The Journal of Neuroscience. 2006;26:4266–4276. doi: 10.1523/JNEUROSCI.4353-05.2006. [DOI] [PMC free article] [PubMed] [Google Scholar]
  8. Geiller T, Sadeh S, Rolotti SV, Blockus H, Vancura B, Negrean A, Murray AJ, Rózsa B, Polleux F, Clopath C, Losonczy A. Local circuit amplification of spatial selectivity in the hippocampus. Nature. 2022;601:105–109. doi: 10.1038/s41586-021-04169-9. [DOI] [PMC free article] [PubMed] [Google Scholar]
  9. Gu Y, Lewallen S, Kinkhabwala AA, Domnisoru C, Yoon K, Gauthier JL, Fiete IR, Tank DW. A map-like micro-organization of grid cells in the medial entorhinal cortex. Cell. 2018;175:736–750. doi: 10.1016/j.cell.2018.08.066. [DOI] [PMC free article] [PubMed] [Google Scholar]
  10. Hasselmo ME, Brandon MP. A model combining oscillations and attractor dynamics for generation of grid cell firing. Frontiers in Neural Circuits. 2012;6:30. doi: 10.3389/fncir.2012.00030. [DOI] [PMC free article] [PubMed] [Google Scholar]
  11. Kraus BJ, Robinson RJ, White JA, Eichenbaum H, Hasselmo ME. Hippocampal “time cells”: time versus path integration. Neuron. 2013;78:1090–1101. doi: 10.1016/j.neuron.2013.04.015. [DOI] [PMC free article] [PubMed] [Google Scholar]
  12. MacDonald CJ, Lepage KQ, Eden UT, Eichenbaum H. Hippocampal “time cells” bridge the gap in memory for discontiguous events. Neuron. 2011;71:737–749. doi: 10.1016/j.neuron.2011.07.012. [DOI] [PMC free article] [PubMed] [Google Scholar]
  13. Morris G, Derdikman D. The chicken and egg problem of grid cells and place cells. Trends in Cognitive Sciences. 2023;27:125–138. doi: 10.1016/j.tics.2022.11.003. [DOI] [PubMed] [Google Scholar]
  14. Muller RU, Kubie JL. The effects of changes in the environment on the spatial firing of hippocampal complex-spike cells. The Journal of Neuroscience. 1987;7:1951–1968. doi: 10.1523/JNEUROSCI.07-07-01951.1987. [DOI] [PMC free article] [PubMed] [Google Scholar]
  15. O’Keefe J, Dostrovsky J. The hippocampus as a spatial map. Preliminary evidence from unit activity in the freely-moving rat. Brain Research. 1971;34:171–175. doi: 10.1016/0006-8993(71)90358-1. [DOI] [PubMed] [Google Scholar]
  16. O’Keefe J, Burgess N. Geometric determinants of the place fields of hippocampal neurons. Nature. 1996;381:425–428. doi: 10.1038/381425a0. [DOI] [PubMed] [Google Scholar]
  17. Omer DB, Maimon SR, Las L, Ulanovsky N. Social place-cells in the bat hippocampus. Science. 2018;359:218–224. doi: 10.1126/science.aao3474. [DOI] [PubMed] [Google Scholar]
  18. Pastalkova E, Itskov V, Amarasingham A, Buzsáki G. Internally generated cell assembly sequences in the rat hippocampus. Science. 2008;321:1322–1327. doi: 10.1126/science.1159775. [DOI] [PMC free article] [PubMed] [Google Scholar]
  19. Retailleau A, Morris G. Spatial rule learning and corresponding CA1 place cell reorientation depend on local dopamine release. Current Biology. 2018;28:836–846. doi: 10.1016/j.cub.2018.01.081. [DOI] [PubMed] [Google Scholar]
  20. Rueckemann JW, Sosa M, Giocomo LM, Buffalo EA. The grid code for ordered experience. Nature Reviews. Neuroscience. 2021;22:637–649. doi: 10.1038/s41583-021-00499-9. [DOI] [PMC free article] [PubMed] [Google Scholar]
  21. Samsonovich A, McNaughton BL. Path integration and cognitive mapping in a continuous attractor neural network model. The Journal of Neuroscience. 1997;17:5900–5920. doi: 10.1523/JNEUROSCI.17-15-05900.1997. [DOI] [PMC free article] [PubMed] [Google Scholar]
  22. Schafer M, Schiller D. Navigating social space. Neuron. 2018;100:476–489. doi: 10.1016/j.neuron.2018.10.006. [DOI] [PMC free article] [PubMed] [Google Scholar]
  23. Stachenfeld KL, Botvinick MM, Gershman SJ. The hippocampus as a predictive map. Nature Neuroscience. 2017;20:1643–1653. doi: 10.1038/nn.4650. [DOI] [PubMed] [Google Scholar]
  24. Tocker G, Barak O, Derdikman D. Grid cells correlation structure suggests organized feedforward projections into superficial layers of the medial entorhinal cortex. Hippocampus. 2015;25:1599–1613. doi: 10.1002/hipo.22481. [DOI] [PubMed] [Google Scholar]
  25. Tsao A, Sugar J, Lu L, Wang C, Knierim JJ, Moser M-B, Moser EI. Integrating time from experience in the lateral entorhinal cortex. Nature. 2018;561:57–62. doi: 10.1038/s41586-018-0459-6. [DOI] [PubMed] [Google Scholar]
  26. Tulving E. Episodic memory: from mind to brain. Annual Review of Psychology. 2002;53:1–25. doi: 10.1146/annurev.psych.53.100901.135114. [DOI] [PubMed] [Google Scholar]
  27. Whittington JCR, Muller TH, Mark S, Chen G, Barry C, Burgess N, Behrens TEJ. The tolman-eichenbaum machine: Unifying space and relational memory through generalization in the hippocampal formation. Cell. 2020;183:1249–1263. doi: 10.1016/j.cell.2020.10.024. [DOI] [PMC free article] [PubMed] [Google Scholar]

Editor's evaluation

Laura L Colgin 1

The manuscript is a new analysis of previously published data from experiments in which rats ran on a treadmill in either fixed-time or fixed-distance trials. The valuable results provide convincing evidence to demonstrate that time and distance cells are more common in fixed-time and fixed-distance trials, respectively. These findings suggest that the hippocampus flexibly shifts between representing variables depending on their relevance.

Decision letter

Editor: Laura L Colgin1

Our editorial process produces two outputs: i) public reviews designed to be posted alongside the preprint for the benefit of readers; ii) feedback on the manuscript for the authors, including requests for revisions, shown below. We also include an acceptance summary that explains what the editors found interesting or important about the work.

Decision letter after peer review:

Thank you for submitting your article "Time or distance: predictive coding of Hippocampal cells" for consideration by eLife. Your article has been reviewed by 3 peer reviewers, and the evaluation has been overseen by a Reviewing Editor and Laura Colgin as the Senior Editor. The reviewers have opted to remain anonymous.

The reviewers have discussed their reviews with one another, and the Reviewing Editor has drafted this to help you prepare a revised submission.

Essential revisions:

1) Reviewers agreed that the authors have not been precise and clear enough about what they are referring to as a predictive code and the source of its importance. That is, authors need to provide a properly-referenced definition of what is meant by predictive coding (including to what degree it is or is not distinct from flexibility of representation). Also, authors should provide a summary of why evidence for predictive coding is interesting and important (with respect to hippocampal function). Otherwise, it is not possible to assess why the described findings provide evidence for predictive coding. If the authors mean to use the term "predictive coding" in the same manner in which it has been used in prior publications, then more analysis is needed to support the claim (see individual reviews below for details). However, the main point of the paper was agreed to be the flexible representation of time vs. distance across two tasks, and this finding was viewed as interesting on its own. Therefore, if they prefer, authors can choose to remove the claims about predictive coding, rather than performing more analyses to substantiate the claims related to predictive coding.

2) Other analyses and points of clarification are suggested to strengthen the flexible representation of time vs. distance results. See individual reviews below for details.

Reviewer #1 (Recommendations for the authors):

In this manuscript the authors examine whether place cells (cells that encode specific location on an environment) or "elapsed time cells" (cells that encode total time elapsed on a track) depend on the type of task that the animal is doing. The authors show that in tasks were fixed-distance travel is important, there is a bias for distance-encoding cells and on fixed-time experiments, there is a bias for time-encoding cells. The authors conclude that this indicates that the hippocampal code has a predictive component, as it generates firing patterns that tile the relevant features of each of the tasks respectively. Overall, the analyses are well done, and the results are clear. My main concern is that even if the hippocampal code generates responses that match the most needed variable for each task, it also generates responses that match the alternative variables. For example, in the elapsed time task, there are also place cells and in the fixed-distance travel there are also cells that encode other features. This, rather than a predictive code, can be a regular sample of the environment with an overrepresentation of the more salient variable that animals need to get in order to collect rewards. In addition, the analysis provided in the manuscript are rather simple, and better controls could be provided. Improving the analytical quantification of the results is necessary to support the main claim.

– What is the relationship of each type of cell with the speed of the animal?

– What is the relationship with the n of trial that the animal has run (first 10 trials, last 10 trials)?

– What is the average firing rate of each neuron? Is there any relationship between intrinsic firing rate and the type of coding that the cell develops in each task?

– What is the relation of the units of each type with LFP features (theta phase, ripple recruitment)?

Reviewer #2 (Recommendations for the authors):

I have a couple of comments that I think should be addressed to make the manuscript stronger.

1. It is very unusual to define timing of a cell as the earliest onset of timing prior to the peak. It seems arbitrary, and also not very robust measure: it effectively uses only the earliest spikes fired by the cell on a given trial, instead of using all of the spikes. This measure should therefore be highly susceptible to noise. It's unclear why the authors didn't do something more simple and standard, such as measuring the actual peak (or center of mass) of the firing. Alternatively, they could've fit some template to the spikes and allowed this template to expand and contract to determine whether the firing is more consistent with distance or time coding. If the authors are going to stick with the method they are currently using, I suggest adding a clear justification about why it is the best method to use for distinguishing distance cells from time cells.

2. To be completely honest, I could not understand the model presented in the Discussion, in spite of multiple re-readings. I think the description suffers from being very brief and from using shortcuts in language that are hard to interpret. E.g. phrases like "connections that were active" (how can a connection be active or inactive), "connections that are consistent with time" (what does it mean for a connection to be consistent with something), "signal … coinciding with cells" (what does it mean for a signal to coincide with a cell), and "cells will gradually encode" (what exactly is changing gradually)? I suggest substantially expanding the explanation and using concrete, mechanistic language. Figure 4 that illustrates the model is visually stunning, but is also very hard to interpret and doesn't seem to contribute much to the explanation.

The best option would be to run an actual simulation that produces time or distance encoding in different situations. But I don't think this is required; a more clear explanation should be enough.

Reviewer #3 (Recommendations for the authors):

The main hypothesis test (session type independent of cell responses) is parametric and lacks a measure of strength of effect. A crude measure of strength of effect combined with a more robust hypothesis test would be provided by shuffling session type labels. Even a simple comparison of the proportion in the shuffled data gives a rough estimate of the strength of the effect.

Please motivate the classifiers and their statistical assumptions scientifically. In particular, what alternatives do they have power against, and why are these power profiles of interest scientifically. I didn't understand why you were testing for deviations from linearity to build the third classifier. Was there a motivation for that?

The abstract, for example, spends too much time replicating the Kraus paper. More time should be spent explaining why the results imply hippocampal cells encode prediction, as well as motivating why that's important or potentially important. Related to this, the reward hypothesis is not developed strongly enough.

"encoding dimensions required in order to organize relevant information." What does this mean? Perhaps simplifying it would be helpful. Does dimension mean features of sensory experience?'

I felt the final paragraph was important but not precise enough and therefore hard to parse.

The explicit structure of reward and its relationship to the main conjecture is not really discussed. This seems crucial. I'd prefer to have it upfront in the manuscript, rather than mentioning it obliquely at the beginning and coming back to it at the end.

Are we evaluating our results on the same data we are using to fit the classifiers? And does that matter?

eLife. 2023 Oct 16;12:e83930. doi: 10.7554/eLife.83930.sa2

Author response


Essential revisions:

1) Reviewers agreed that the authors have not been precise and clear enough about what they are referring to as a predictive code and the source of its importance. That is, authors need to provide a properly-referenced definition of what is meant by predictive coding (including to what degree it is or is not distinct from flexibility of representation). Also, authors should provide a summary of why evidence for predictive coding is interesting and important (with respect to hippocampal function). Otherwise, it is not possible to assess why the described findings provide evidence for predictive coding. If the authors mean to use the term "predictive coding" in the same manner in which it has been used in prior publications, then more analysis is needed to support the claim (see individual reviews below for details). However, the main point of the paper was agreed to be the flexible representation of time vs. distance across two tasks, and this finding was viewed as interesting on its own. Therefore, if they prefer, authors can choose to remove the claims about predictive coding, rather than performing more analyses to substantiate the claims related to predictive coding.

The reviewers’ comments are appreciated and were fully implemented. We have thus removed the claims about predictive coding and changed the title to "Flexible coding of time or distance in hippocampal cells" (page 1 line 1).

Reviewer #1 (Recommendations for the authors):

In this manuscript the authors examine whether place cells (cells that encode specific location on an environment) or "elapsed time cells" (cells that encode total time elapsed on a track) depend on the type of task that the animal is doing. The authors show that in tasks were fixed-distance travel is important, there is a bias for distance-encoding cells and on fixed-time experiments, there is a bias for time-encoding cells. The authors conclude that this indicates that the hippocampal code has a predictive component, as it generates firing patterns that tile the relevant features of each of the tasks respectively. Overall, the analyses are well done, and the results are clear. My main concern is that even if the hippocampal code generates responses that match the most needed variable for each task, it also generates responses that match the alternative variables. For example, in the elapsed time task, there are also place cells and in the fixed-distance travel there are also cells that encode other features. This, rather than a predictive code, can be a regular sample of the environment with an overrepresentation of the more salient variable that animals need to get in order to collect rewards.

We thank the reviewer for suggesting the overrepresentation interpretation as an alternative. The following was added:

“These results underscore the flexible coding capabilities of the hippocampus, which are shaped by over-representation of salient variables associated with reward conditions.” (page 1 line 23)

“Such over-representation may help the brain prioritize survival and decision making. By allocating more resources to the salient stimuli, the brain enhances the ability to process and retain the important information.” (page 5 line 18)

In addition, the analysis provided in the manuscript are rather simple, and better controls could be provided. Improving the analytical quantification of the results is necessary to support the main claim.

We added a shuffling analysis to assess the power of our results:

“To assess the power of the statistics we compared the results to a distribution generated from shuffled trial types (Figure 3c). In order to mitigate any potential biases in this distribution, we truncated all data to a common duration of 16 seconds, which represents the shortest duration of a treadmill run across all trials.” (page 4 line 24 and figure 3c)

Reviewer #2 (Recommendations for the authors):

I have a couple of comments that I think should be addressed to make the manuscript stronger.

1. It is very unusual to define timing of a cell as the earliest onset of timing prior to the peak. It seems arbitrary, and also not very robust measure: it effectively uses only the earliest spikes fired by the cell on a given trial, instead of using all of the spikes. This measure should therefore be highly susceptible to noise. It's unclear why the authors didn't do something more simple and standard, such as measuring the actual peak (or center of mass) of the firing. Alternatively, they could've fit some template to the spikes and allowed this template to expand and contract to determine whether the firing is more consistent with distance or time coding. If the authors are going to stick with the method they are currently using, I suggest adding a clear justification about why it is the best method to use for distinguishing distance cells from time cells.

We chose the onset rather than the peak since in some cases the firing field is truncated by the end of the run. We were therefore worried that choosing the peak might introduce a bias. Following the comment, we repeated the analysis in relation to the peak of firing of the cells. As we show in the figures added to the paper, this did not change our results.

The following passage was added to the paper:

“We chose this approach to mitigate potential biases that could arise from firing rate peaks occurring near the end of the treadmill, which might have been truncated. Basing our analysis on the peak values instead yielded comparable results and levels of statistical significance (figure 3—figure supplement 1).” (page 6 line 9)

2. To be completely honest, I could not understand the model presented in the Discussion, in spite of multiple re-readings. I think the description suffers from being very brief and from using shortcuts in language that are hard to interpret. E.g. phrases like "connections that were active" (how can a connection be active or inactive), "connections that are consistent with time" (what does it mean for a connection to be consistent with something), "signal … coinciding with cells" (what does it mean for a signal to coincide with a cell), and "cells will gradually encode" (what exactly is changing gradually)?

We agree with the reviewer that the model in its current form is not clear enough. Following this comment, and our realization that the model is still not fully characterized, we decided to omit the model part from the revised version of the paper.

I suggest substantially expanding the explanation and using concrete, mechanistic language. Figure 4 that illustrates the model is visually stunning, but is also very hard to interpret and doesn't seem to contribute much to the explanation.

Figure removed.

Reviewer #3 (Recommendations for the authors):

The main hypothesis test (session type independent of cell responses) is parametric and lacks a measure of strength of effect. A crude measure of strength of effect combined with a more robust hypothesis test would be provided by shuffling session type labels. Even a simple comparison of the proportion in the shuffled data gives a rough estimate of the strength of the effect.

A shuffling analysis was added demonstrating that the results are highly significant compared to the shuffled distribution.

Please motivate the classifiers and their statistical assumptions scientifically. In particular, what alternatives do they have power against, and why are these power profiles of interest scientifically. I didn't understand why you were testing for deviations from linearity to build the third classifier. Was there a motivation for that?

The three metrics were designed to as different statistics describing the linear regression between the firing times (either onset or peak) and the velocity of the run.

a) The CellType metric is defined by the normalized ratio of the residuals’ sum of the firing onset times in each run under constant time vs. constant distance assumptions. It is designed to have values between -1 and 1, such that -1 is a pure time cell and +1 is a pure distance cell.

b) The Fit metric examines the ratio between the average onset time T and the slope of the distance vs. reciprocal velocity linear regression (m), and also the ratio between the average onset distance S and the slope of the time vs. velocity linear regression slope (q). If the ratio for onset time exceeds 0.5, the cell is classified as a distance cell, indicating a strong association between time and reciprocal velocity. Conversely, if the ratio for onset distance exceeds 0.5, the cell is classified as a time cell, suggesting a strong relationship between time and velocity. The threshold of 0.5 was chosen through an iterative process to achieve a complete separation between the time and distance classifications. This empirical threshold ensures that cells are classified exclusively as either time-related or distance-related, avoiding any overlap or ambiguity in classification.

c) The p-value metric checks the statistical significance of the linear regression, and classifies the cell as time or distance according to the significance of the linearity of distance vs. velocity or time vs. inverse-velocity relations.

While the CellType metric classifies all cells, the FIT and p-value classify only cells within a certain range, resulting in a smaller population of cells. Using all three metrics provides a perspective of the entire population on one hand, while emphasizing a subset of the population with a higher classification confidence level, on the other hand.

All three metrics yielded similar results and had similar statistical power.

The following was added:

“The CellType metric utilizes the variances of the onset times (TiT¯)2, where the average onset time is computed across all runs within the session, and of the onset distances (SiS¯)2, where the average onset distance is calculated across all runs within the session.

CellType(Vi,Si,Ti)=ΣiVi(SiS¯)2Σi(TiT¯)2ΣiVi(SiS¯)2+Σi(TiT¯)2

CellType is in the range of -1 to 1. For an idealtime encoding cell, the onset variance Σi(TiT¯)2 = 0 and hence CellType=1. For an ideal distance encoding cell, the distance variance (multiplied by the respective velocity in order to match units) Vi(SiS¯)2=0, and hence CellType=-1."

Additional metrics were defined and used for classifying the cells encoding:

The “FIT” metric is defined as follows:

Fit(m,k,T¯,S¯)={10.5<mT¯10.5<kS¯0otherwise

Where m and k are the linear fit slope coefficients (from equations 1 and 2), T¯ is the average firing onset time and S¯ is the average distance the animal traveled until the onset. Fit is -1 for a distance cell and 1 for a time cell.

The “P-Value” metric is defined as follows:

P_Value(Vi,Si,Ti)={1p(no linear relation between distance and velocity)<0.051p(no linear relation between the onset and reciprocal velocity)<0.050otherwise

A stricter metric, utilized the statistical significance of the linearity in equations 1 and 2, through F-statistics. We classified a cell as distance encoding if the null hypothesis that there is no linear relation between the distance and velocity was rejected with p<0.05. We classified a cell as time encoding if the null hypothesis that there is no linear relation between the onset and the reciprocal velocity was rejected with p<0.05.” (page 7 line 7)

"To assess the power of the statistics we compared the results to a distribution generated from shuffled trial types (Figure 3c). In order to mitigate any potential biases in this distribution, we truncated all data to a common duration of 16 seconds, which represents the shortest duration of a treadmill run across all trials." (page 4 line 24)

I felt the final paragraph was important but not precise enough and therefore hard to parse.

Paragraph changed as follows:

"Another possible mechanism for acquiring representations that are consistent with task structure involves an associative learning process. Such learning would modify all connections that were active in a particular trial but would only consistently modify those in which activity was invariant throughout the experiment, while other connections associated with inconsistent representations will average out. Thus, in time-fixed experiments, those connections that are consistent with time would be strengthened, while in distance-fixed experiments those that are consistent with distance would gain strength. Consequently, those cells will gradually encode either distance or time, depending on the type of experiment." (page 5 line 21)

The explicit structure of reward and its relationship to the main conjecture is not really discussed. This seems crucial. I'd prefer to have it upfront in the manuscript, rather than mentioning it obliquely at the beginning and coming back to it at the end.

Reward description was added as follows:

"The rats were provided with a small amount of water reward prior to the initiation of the treadmill run and upon its cessation, thereby conditioning them to maintain their snouts positioned at the water port throughout the duration of the treadmill run, and "clamping" their behavior and spatial position" (page 3 line 6)

Associated Data

    This section collects any data citations, data availability statements, or supplementary materials included in this article.

    Data Citations

    1. Abramson S, Kraus BJ, White JA, Hasselmo ME, Morris G, Derdikman D. 2023. Data for Time or distance: predictive coding of hippocampal cells. Dryad Digital Repository. [DOI] [PMC free article] [PubMed]

    Supplementary Materials

    MDAR checklist

    Data Availability Statement

    The current manuscript is a re-analysis of data collected for a previously published paper (Kraus et al., 2013). Data used in this paper is available as Matlab files on Dryad: https://doi.org/10.5061/dryad.ngf1vhhxp. Matlab code used for the analysis in the paper is available on https://github.com/derdikman/Abramson_code (copy archived at Derdikman, 2023).

    The following dataset was generated:

    Abramson S, Kraus BJ, White JA, Hasselmo ME, Morris G, Derdikman D. 2023. Data for Time or distance: predictive coding of hippocampal cells. Dryad Digital Repository.


    Articles from eLife are provided here courtesy of eLife Sciences Publications, Ltd

    RESOURCES