Hippocampal activity during food-caching reveals sparse “barcodes” for each cache memory.

A. A black-capped chickadee visits cache sites in a laboratory arena. The chickadee does not interact with cache sites during what we call a visit. B. A chickadee caches or retrieves at a cache site by peeling back the rubber flap at the site. This reveals a hidden compartment where seeds can be stored. C. Cartoon example of spiking activity during visits of four hippocampal neurons in a square arena. Spikes are in red. Gray diamonds indicate the location of sites with caches. D. As in (C), for the same cells during caching and retrieval. Neurons fire sparsely and randomly during caches (activity clusters at sites) independent of their place tuning. E. Correlation of population activity during visits to the same or different sites of increasing distance. Values are max-normalized. Reproduced with permission from Chettih et al. (2024). F. As in (E), but comparing activity from caches at a site to activity from retrievals at the same or different sites. Barcode activity shared between caches and retrievals at the same site produces a sharp deviation from smooth spatial tuning. Values are normalized by the same factor as in (E). Reproduced with permission from Chettih et al. (2024).

A recurrent neural network generates barcode activity through recurrent dynamics.

A. Diagram of a RNN; the activity of the network units is denoted as . Place information arrives from an input layer with activities . Recurrent weights are initialized randomly, that is, for the synapse connecting neuron j to neuron i, where Nx is the number of RNN neurons. B. Correlation of activity vectors across different locations, when RNN weights are initialized with σ = 1 (left), σ = 7 (center), and σ = 20 (right). We show correlation of place inputs (gray) and correlation of RNN activity (black) as σ is varied. X-axis is in units of site distance (see Methods for definition). C. Response of RNN units when simulating a visit to a location halfway around the circular track (with r = 0; equation 3). In gray is the activity of the RNN at t = 0. In black is the activity at t = 100. 200 RNN units are uniformly subsampled and sorted by the tuning of their inputs for plotting purposes. D. As in (C), but for r = 1. RNN activity is more sparsely distributed, including high activity in neurons without place tuning for the current location. For visualization purposes, 50 RNN units with nonzero activity and 50 RNN units with 0 activity are sampled at this time point (t = 100) for display, and responses greater than 1 are clipped to > 1. E. RNN activity in response to state 1 compared to state 2, when r = 0. Each point corresponds to a single RNN unit. F. As in (E), but for r = 1. RNN activity for these neighboring states is substantially decorrelated by recurrence. G. Firing fields of three example units on the circular track displaying place-cell activity. Maximum value of each field is labeled and the colormap is max-normalized. H. Simulated spike counts of a RNN population during visits to each location on the circular track. Spikes are generated by simulating Poisson-distributed counts from underlying unit rates. Place tuning results in a strong diagonal structure when units are sorted by their input’s preferred location. The maximum limit of the colormap is set to the 99th percentile value of spike counts (≥ 3 spikes). I. Same neurons as (G), but for r = 1 with units now showing barcode activity. The location of the r = 0 place field peak of each unit (i.e., its corresponding peak in (G)) is marked by a red triangle. J. As in (H), but for r = 1. The independence of barcode activity for neighboring sites results in a matrix with reduced diagonal structure.

Barcode activity binds content to store memories in the RNN.

A. Diagram of RNN activity during memory formation. Along with place inputs, a scalar seed input s is provided to the model. s connects to RNN units via 5000-dimensional weight vector jsx ∼ 𝒩 (0, 1). During memory formation (i.e., when an animal caches a seed), place inputs representing the animal’s current location and a seed input are provided to the RNN. After recurrent dynamics are run for some time (t = 100), the network undergoes Hebbian learning. B. An example of memory recall in the network. The animal is at the same location as in (A). The place input encoding that location is provided to the model and results in the RNN recalling the stored attractor pattern seen in (A). C. Examples of RNN population activity during caching (left), retrieval (center), and visits (right) at three sites. During visits the RNN has r = 0, while during caches and retrievals r = 1. For visualization purposes, 50 units are randomly sampled and displayed in the “Caching” and the “Retrieval” plot. D. Correlation of RNN activity at two sites, plotted as a function of the distance between the two sites. In black is the correlation in activity between two visits. In purple is the correlation between caching and retrieval activity. Experiments were simulated with 20 simulations where 5 sites were randomly chosen for caching. 99% confidence intervals are calculated over the simulations and plotted over the markers. Compare to Figure 1E,F.

Precise and flexible recall of barcode-mediated cache memories

A. Cartoon of a chickadee at a site, trying to remember whether the site contains a seed. The chickadee cannot see inside the hidden compartment and must rely on memory to answer this question. B. Cartoon of a chickadee at a site, trying to recall the location of the closest cache.In this case, the animal must use its memory to recall the location of a cache three sites away. C. Seed output of the RNN at different locations along the circular track. Red dots above the line indicate locations where the value is greater than 0.5. Top, results after the first cache is made at a location 20% of the way through the track. The location of the first cache is marked on the x-axis as C1. Middle, same but after the second cache (C2) is made at a location 35% of the way through the track. Bottom, same but after the third cache (C3) is made at a location 70% of the way through the track. D. The place output of the RNN at different locations along the track. In the heatmaps, each column shows the activities of all the output units when the animal is at a particular location (horizontal axis). The left side panels of the subfigure correspond to the model operating at low recall strength (s = 0). The right side panels correspond to the model operating at high recall strength (s = 1.5). As in (C), top, middle, and bottom plots correspond to RNN activity after caches are made at C1, C2, and C3. Place output correctly switches between the location of each cache depending on proximity to the current position. E. Probability of correct reject rate in the model when the animal is at a location between caches 1 and 2, after all caches have been made. X-axis shows the distance from the probed location to the surrounding caches, measured in site distance. The color of each line corresponds to the recall strength s. At low recall strengths, the model correctly identified the absence of a cache between C1 and C2, reflecting discrimination of the two cache locations. F. Probability of recalling the location of the closest cache, given the distance of the animal from the cache. A recall is considered successful if the seed output exceeds 0.5 and if the peak of the output corresponds to the location of the nearest cache. Lines are colored by recall strength s. The model correctly recalls the locations of nearby caches, with search radius increasing as recall strength increases.

Ablations reveal complementary roles of place code and barcode activity in memory recall.

A. Left, as in Figure 4C, bottom, but for the “Place Code Only” model (barcode-ablated), which has recurrent weights initalized with μ = 0, σ = 0. Right, same, but for the “Barcode Only” model (place-ablated). The barcode only model is the same as the full model, but place inputs are uncorrelated for nearby locations. B. Left, as in Figure 4D, bottom, but for the place code only model. Right, the same but for the barcode only model (for visual clarity, the matrix is downsampled to remove zero-value rows). The place code only model has similar outputs for recall from all current locations. The barcode only model has no place output for recall from most locations. C. As in Figure 4E, but showing the full model (solid line), the place code only model (dotted line), and the barcode only model (dashed line). For all models, s = 0. The place code only model is unable to discriminate between nearby caches. D. As in Figure 4F, with lines as in (C). For all models, s = 0.4. The barcode only model recalls successfully only when the current location contains a cache. Only the full model reliably recalls remote cache locations.

Predictive coding and barcode generation are performed by the same RNN in different dynamical regimes

A. Cartoon of a chickadee in a circular track, running in a consistently clockwise direction. B. Heatmap of RNN firing fields when r = 0, where each row corresponds to the tuning curve of one neuron across all locations. Red dashed line indicates the diagonal. C. As in (B), but for r = 0.3. Here, clockwise movement corresponds to movement from site i to site i + 1. Thus predictive activity appears as a shift in RNN activity below the matrix diagonal. D. As in (B), but for r = 1.0. Barcodes appear as random, off-diagonal structure in the activity matrix. E. The firing fields of four example units across different recurrent strengths. That is, each unit’s row in (B) is in blue, its row in (C) is in orange, and its row in (D) is in purple. Each curve is max-normalized. F. Average projection strength of RNN activity onto the place code, predictive code, and barcode vectors. The place code vector is defined as activity with r = 0. The predictive code vector is defined as the place field of the unit at the next clockwise site, minus the projection onto the place code. The barcode vector is defined as activity with r = 1.0, minus the projection onto the place code. Each line is max-normalized. G. Seed output of the model with predictive weights, given the animal’s location on the circular track. Here, there is only one cache, made at the halfway location of the circular track (labeled “C”).

A. Difference between RNN activity across each step of recurrent dynamics. Specifically, at recurrent timestep t, we plot . Each line corresponds to a different random seed and model initialization. B. Difference between RNN activity at some step of recurrent dynamics and the initial RNN state. Specifically, at recurrent timestep t, we plot . Each line corresponds to a different random seed and model initialization. C. As in Figure 2GI, but for 20 additional randomly sampled units.

A. Diagram of the feedforward model for barcode generation. Place inputs are passed through an expansion layer Wh with a nonlinear activation function to get the hidden layer activity xh. A subsequent compression layer Wo with a nonlinear activation function generates the final barcode activity x. B. As in Figure 2B but adding in red the results for the feddforward model as sparsity is varied. C. As in Figure 2GI, but for 16 randomly sampled units from the feedforward model.

A. True positive rate of the seed output in the 3-cache task of Figure 4, as the choice of binarized threshold is varied. The color of each line corresponds to the recall strength s. Here, caches are all spaced at least two sites apart. B. As in (A), but for true negative rate. We will choose a threshold of 0.5 to binarize the seed output. CD As in (AB), but the order caches are made is random. E. True positive rate of the seed output binarized at 0.5 when plasticity bias β and search strength s is varied. F. As in (E) but for true negative rate. G. As in (E) but plotting the correct reject rate at a location between two caches. Here the two caches are 1.5 sites apart or closer. H. As in (E) but plotting the probability of recalling the location of the closest cache when the animal is 2 sites away from it.

A. Diagram showing how place inputs are modified to be more realistic. Place encoding is now drawn from a 0-mean Gaussian process with place-like covariance structure. This results in a more distributed representation in over spatial locations. Furthermore, Jxp is now a random Gaussian matrix (instead of the identity matrix). B. Correlations between place inputs at different locations, as a function of their distance. C. As in Figure S3A, but for the Gaussian model. D. As in Figure S3B, but for the Gaussian model. E. As in Figure 4E, but for the Gaussian model. F. As in Figure 4F, but for the Gaussian model.

AB. As in Figure S3AB, but for the place code only model shown in 5A. C. Probability that the Nth cache location is successfully recalled as site spacing is increased in the 3 cache task. Results are shown for the place code only model. D. As in Figure 4F, but for the place code only model. EFGH. As in (ABCD), but for the barcode only model.

A. The predictive weights M that is added to J. B. As in (A), but zooming in 10x into the matrix for clarity. C. As in Figure 6E, but for 24 additional randomly sampled units.

AB. As in Figure S3AB, but for the model with predictive weights added in. CD. As in Figure 4EF, but the model with predictive weights added in.