## Abstract

The spiking activity of the hippocampal place cells plays a key role in producing and sustaining an internalized representation of the ambient space—a cognitive map. These cells do not only exhibit location-specific spiking during navigation, but also may rapidly replay the navigated routs through endogenous dynamics of the hippocampal network. Physiologically, such reactivations are viewed as manifestations of “memory replays” that help to learn new information and to consolidate previously acquired memories by reinforcing synapses in the parahippocampal networks. Below we propose a computational model of these processes that allows assessing the effect of replays on acquiring a robust topological map of the environment and demonstrate that replays may play a key role in stabilizing the hippocampal representation of space.

## Author Summary

In this manuscript, we use methods of zigzag homology theory to study the physiological role of the replays—the hippocampal networks endogenous activity that recapitulates the activity of the place cells during exploration of the environment. In particular, we demonstrate that deterioration of the hippocampal spatial memory map caused by excessive transience of synaptic connections may be mitigated by spontaneous replays. The results help to understand how transient information about local spatial connectivity may stabilize at a large scale, and shed light on the separation between faster and slower memory processing in the complementary (hippocampal and neocortical) learning systems.

## INTRODUCTION

Spatial awareness in mammals is based on an internalized representation of the environment—a cognitive map. In rodents, a key role in producing and sustaining this map is played by the hippocampal place cells, which preferentially fire action potentials as the animal navigates through specific domains of a given environment—their respective place fields. Remarkably, hippocampal place cells may also activate due to the endogenous activity of the hippocampal network during quiescent wake states (Johnson & Redish, 2007; Pastalkova, Itskov, Amarasingham, & Buzsáki, 2008) or sleep (Ji & Wilson, 2007; Louie & Wilson, 2001; Wilson & McNaughton, 1994). For example, the animal can preplay place cell sequences that represent possible future trajectories while pausing at “choice points” (Papale, Zielinski, Frank, Jadhav, & Redish, 2016), or replay sequences that recapitulate the order in which the place cells have fired during previous exploration of the environment (Foster & Wilson, 2006; Hasselmo, 2008). Moreover, spontaneous replays are also observed during active navigation, when the hippocampal network is driven both by the idiothetic (body-derived) inputs and by the network’s autonomous dynamics (Carr, Jadhav, & Frank, 2011; Dragoi & Tonegawa, 2011; Jadhav, Kemere, German, & Frank, 2012; Jadhav, Rothschild, Roumis, & Frank, 2016; Karlsson & Frank, 2009).

Neurophysiologically, place cell replays are viewed as manifestations of the animal’s “mental explorations” (Babichev & Dabaghian, 2018; Dabaghian, 2016; Hopfield, 2010; Zeithamova, Schlichting, & Preston, 2012), which help constructing the cognitive maps and consolidating memories (Ego-Stengel & Wilson, 2010; Gerrard, Kudrimoti, McNaughton, & Barnes, 2001; Girardeau, Benchenane, Wiener, Buzsáki, & Zugaro, 2009; Girardeau & Zugaro, 2011; Roux, Hu, Eichler, Stark, & Buzsáki, 2017). Although the detailed mechanisms of these phenomena remain unknown, it is believed that replays may reinforce synaptic connections that deteriorate over extended periods of inactivity (Sadowski, Jones, & Mellor, 2011, 2016; Singer, Carr, Karlsson, & Frank, 2013).

The activity-dependent changes in the hippocampal network’s synaptic architecture occur at multiple timescales (Bi & Poo, 1998; Fusi, Asaad, Miller, & Wang, 2007; Karlsson & Frank, 2008). In particular, statistical analyses of the place cells’ spiking times indicate that place cells exhibiting frequent coactivity tend to form short-lived “cell assemblies”—commonly viewed as *functionally* interconnected groups of neurons that form and disband at a timescale between tens of milliseconds (Atallah & Scanziani, 2009; Bartos, Vida, & Jonas, 2007; Buzsáki, 2010; Harris, Csicsvari, Hirase, Dragoi, & Buzsáki, 2003) to minutes
or longer (Billeh, Schaub, Anastassiou, Barahona, & Koch, 2014; Goldman-Rakic, 1995; Hiratani & Fukai, 2014; Kuhl, Shah, DuBrow, & Wagner, 2010; Murre, Chessa, & Meeter, 2013; Russo & Durstewitz, 2017; Zenke & Gerstner, 2017), that is to say the functional architecture of this network is constantly changing. In our previous work (Babichev & Dabaghian, 2017a, 2017b; Babichev, Morozov, & Dabaghian, 2018) we used a computational model to demonstrate that despite the rapid rewirings, such a “transient” network can produce a stable topological map
of the environment, provided that the connections’ decay rate and the parameters of spiking activity fall into the physiological range (Arai, Brandt, & Dabaghian, 2014; Basso, Arai, & Dabaghian, 2016; Dabaghian, Mémoli, Frank, & Carlsson, 2012). Below we adopt this model to study the role of the hippocampal replays in acquiring a robust cognitive map of space. Specifically, we demonstrate that reinforcing the cell assemblies by replays helps to reduce instabilities in the large-scale representation of the environment and to reinstate the correct topological structure of the cognitive map.

## THE MODEL

### General Description

The topological model of spatial learning rests on the insight that the hippocampus produces a topological representation of spatial environments and of mnemonic memories—a rough-and-ready framework that is filled with geometric details by other brain regions (Dabaghian, Brandt, & Frank, 2014). This approach, backed up by a growing number of experimental (Alvernhe, Sargolini, & Poucet, 2012; Fenton, Csizmadia, & Muller, 2000; Gothard, Skaggs, & McNaughton, 1996; Knierim, Kudrimoti, & McNaughton, 1998; Leutgeb et al., 2005; Moser, Kropff, & Moser, 2008; Touretzky et al., 2005; Wills, Lever, Cacucci, Burgess, & O’keefe, 2005; Yoganarasimha, Yu, & Knierim, 2006) and computational (Chen, Gomperts, Yamamoto, & Wilson, 2014; Curto & Itskov, 2008; Petri et al., 2014) studies, and allows using a powerful arsenal of methods from algebraic topology, in particular persistent (Carlsson, 2009; Lum et al., 2013; Singh et al., 2008) and zigzag (Carlsson & De Silva, 2010; Carlsson, De Silva, & Morozov, 2009) homology theory techniques, for studying structure and dynamics of the hippocampal map. In particular, the approaches developed in Arai et al. (2014); Babichev, Cheng, & Dabaghian (2016); Babichev, Ji, Mémoli, & Dabaghian (2016); Basso et al. (2016); Dabaghian et al. (2012); Hoffman, Babichev, & Dabaghian (2016) help to explain how the information provided by the individual place cells combines into a large-scale map of the environment, to follow how the topological structure of this map unfolds in time, and to evaluate the contributions made by different physiological parameters into this process. It was demonstrated, for example, that the ensembles of rapidly recycling cell assemblies can sustain stable qualitative maps of space, provided that the network’s rewiring rate is not too high. Otherwise the integrity of the cognitive map may be overwhelmed by topological fluctuations (Babichev & Dabaghian, 2017a, 2017b; Babichev et al., 2018).

Mathematically, the method is based on representing the combinations of coactive place cells in a topological framework, as simplexes of a specially designed simplicial complex (Figure 1A and 1B). Each individual simplex *σ* schematically represents a connection (e.g., an overlap) between the place fields encoded by the corresponding place cells’ coactivity. The full set of such simplexes—the coactivity simplicial complex 𝒯—incorporates the entire pool of connections encoded by the place cells in a given environment 𝓔, and hence represents the topological structure of the cognitive map of the navigated space (Best, White, & Minai, 2001; O’Keefe & Dostrovsky, n.d.).

### Topological Structure of the Coactivity Complex

The topological structure of the coactivity complex provides a convenient framework for representing spatial information encoded by the place cells. For example, the combinations of the cells ignited during the rat’s moves along a physical trajectory *γ*, or during a mental replay of such a trajectory, is represented by a “simplicial path”—a chain of simplexes Γ = {*σ*_{1}, *σ*_{2}, …, *σ*_{k}} that qualitatively represents the shape of *γ*. A simplicial path that loops onto itself represents a closed physical rout; a pair of topologically equivalent simplicial paths represent two similar physical paths and so forth (Figure 1C).

The net structure of the simplicial paths running through a given simplicial complex 𝒯 can be used to describe its topological shape. Specifically, the number of topologically distinct (counted up to topological equivalence) closed paths that contract to zero-dimensional vertexes—the zeroth Betti number *b*_{0}(𝒯)—enumerates the connected components of 𝒯; the number of topologically distinct paths that contract to closed chains of links—the first Betti number *b*_{1}(𝒯)—counts its holes and so forth (see (Aleksandrov, 1965; Hatcher, 2002); and Methods).

### Dynamics of the Coactivity Complexes

In practice, the coactivity complexes can be designed to reflect particular physiological properties of the cell assemblies. For example, the time course of the simplexes’ appearance may reflect the dynamics of the cell assemblies’ formation (Babichev & Dabaghian, 2017a, 2017b Babichev et al., 2018; Hoffman et al., 2016), or the details of the place cell activity modulations by the brain waves (Arai et al., 2014; Basso et al., 2016) and so on. In particular, a population of forming and disbanding cell assemblies can be represented by a set of appearing and disappearing simplexes, that is, by a “flickering” coactivity complex 𝓕 studied in Babichev & Dabaghian (2017a, 2017b) and Babichev et al. (2018). There it was demonstrated that if a cell assembly network rewires sufficiently slowly (tens of seconds to a minute timescale), then the “topological shape” of the corresponding coactivity complex remains stable and equivalent to the topology of the simulated environment 𝓔 shown on Figure 1A, as defined by its Betti numbers *b*_{k}(𝓕) = *b*_{k}(𝓔) = 1, *k* = 0, 1 (see Methods). Physiologically, this implies that cell assemblies’ turnover at the intermediate and the short memory timescales does not prevent the hippocampal network from producing a lasting representation of space, despite perpetual changes of its functional architecture (Wang et al., 2006).

In particular, the model (Babichev et al., 2018) predicts that cell assembly network produces a stable topological map if the connections’ mean lifetime exceeds *τ* ≥ 150–200 s, which corresponds to the Hebbian plasticity timescale (Billeh et al., 2014; Goldman-Rakic, 1995; Hiratani & Fukai, 2014; Russo & Durstewitz, 2017; Zenke & Gerstner, 2017). For noticeably shorter *τ*, the topological fluctuations in the simulated hippocampal map are too strong and a stable representation of the environment fails to form. For example, in the case of the place field map shown on Figure 2A, the connections’ proper lifetime is about *τ* = 50 s and the corresponding coactivity complex is unstable: its Betti numbers frequently exceed the physical values (*b*_{k}(𝓕) > *b*_{k}(𝓔)), implying that 𝓕 may split into several disconnected pieces, each one of which may contain transient gaps, holes, and other topological defects that do not correspond to the physical features of the environment.

For most of the time, these defects are scarce (*b*_{k}(𝓕) < 5, Figure 2A) and may be viewed as topological irregularities that briefly disrupt otherwise functional cognitive map. Indeed, from the physiological perspective, it may be unreasonable to assume that biological cognitive maps never produce topological inconsistencies—in fact, admitting small fluctuations in a qualitatively correct representation of space may be biologically more effective than spending time and resources on acquiring a precise and static connectivity map, especially in dynamically changing environments. However, during certain periods, the topological fluctuations may become excessive, indicating the overall instability of the cognitive map. The origin of such occurrences is clear: if, for example, the animal spends too much time in particular parts of the environment, then the parts of 𝓕 that represent the unvisited segments of space begin to deteriorate, leaving behind holes and
disconnected fragments (Figure 2B–2D). Outside of these “instability periods,” when the rat regularly visits all segments of the environment, most place cells fire recurrently, thus preventing the coactivity complex 𝓕 from deteriorating.

Although this description does not account for the full physiological complexity of synaptic and structural plasticity processes in the cell assembly network, it allows building a qualitative model that connects the animal’s behavior, the parameters describing deterioration of the hippocampal network’s functional architecture and the large-scale topological properties of the cognitive map. This, in turn, provides a context for testing the effects produced by the place cell replays, for example, their alleged role in acquiring and stabilizing memories by strengthening the connections in parahippocampal networks (Colgin, 2016; Sadowski et al., 2011, 2016). To test these hypotheses, we adopted the topological model (Babichev et al., 2018) so that the decaying connections in the simulated hippocampal cell assemblies can be (re)established not only by the place cell activity during physical navigation but also by the endogenous activity of the hippocampal network, and studied the effect of the latter on the structure of the hippocampal map, as outlined below.

### Implementation of the Coactivity Complexes

Implementation of the coactivity complexes is based on a classical model of the hippocampal network, in which place cells *c*_{i} are represented as vertexes *v*_{i} of a “cognitive graph” 𝒢, while the connections between pairs of coactive cells are represented by the links, *ς*_{ij} = [*v*_{i}, *v*_{j}] of this graph (Babichev, Cheng, & Dabaghian, 2016; Burgess & O’keefe, 1996; Muller, Stead, & Pach, 1996). The assemblies of place cells *ς* = [*c*_{1}, *c*_{2}, …, *c*_{n}]—the “graphs of synaptically interconnected excitatory neurons,” according to Buzsáki (2010)—then correspond to fully interconnected subgraphs of 𝒢, that is, to its maximal cliques (Babichev, Cheng, & Dabaghian, 2016; Babichev et al., 2016; Hoffman et al., 2016). Since each clique *ς*, as a combinatorial object, can be viewed as a simplex spanned by the same set of vertexes (see Supplemental Figure 6 in Basso et al., 2016), the collection of cliques of the graph 𝒢 defines a clique simplicial complex (Jonsson, 2008), which proves to be one of the most successful implementations of the coactivity complex. In previous studies (Babichev, Cheng, & Dabaghian, 2016; Babichev et al., 2016; Basso et al., 2016; Hoffman et al., 2016), we demonstrated that in absence of decay (*τ* = ∞), such a complex 𝒯 effectively accumulates information about place cell coactivity at various timescales, capturing the correct topology of planar and voluminous environments. If the decay of the connections is taken into account (*τ* < ∞), then the topology of the “flickering” coactivity complex 𝓕 remains stable for sufficiently small rates, but if *τ* becomes too small, the topology of 𝓕 may degrade. A question arises, whether the replays can slow down its deterioration, as the biological considerations suggest.

### Dynamics of the Coactivity Graph

*θ*-cycles—approximately 150–250 ms interval (Mizuseki, Sirota, Pastalkova, & Buzsáki, 2009)—a value that is also suggested by theoretical studies (Arai et al., 2014). In the following, this period will define the shortest timescale at which the functional connectivity of the simulated hippocampal network can change. For example, a new link

*ς*

_{ij}= [

*v*

_{i},

*v*

_{j}] in the coactivity graph will appear, if a coactivity of the cells

*c*

_{i}and

*c*

_{j}was detected during a particular 2

*θ*period. In absence of coactivity, the links can also disappear with probability

*t*is the time measured from the moment of last spiking of both cells

*c*

_{i}and

*c*

_{j}and the parameter

*τ*defines the mean lifetime of the synaptic connections in the cell assembly network. In the following,

*τ*will be the only parameter that describes the deterioration of the synaptic connections within the cell assemblies (Babichev et al., 2018). We will therefore use the notations 𝒢

_{τ}and 𝓕

_{τ}to refer, respectively, to the flickering coactivity graph with decaying connections and to the resulting flickering coactivity complex with decaying simplexes.

### Replays of Place Cell Sequences

Replays of place cell sequences may in general represent both spatial and nonspatial memories. In the following, we simulate only spatial replays by constructing simplicial paths that represent previously navigated trajectories. Specifically, we select chains of connections that appeared in the coactivity graph 𝒢_{τ} at the initial stages of navigation and reactivate them at the later replay times *t*_{r}, *r* = 1, 2, …, *N*_{r} (Kudrimoti, Barnes, & McNaughton, 1999; O’Neill, Senior, & Csicsvari, 2006). To replay a trajectory originating at a given timestep *t*_{i}, we randomly select a coactivity link $\u03c2kl(i)$ ∈ 𝒢_{τ}(*t*_{i}) that is active within that time window; this link then gives rise to a sequence of joined links, randomly selected among the ones that activate at the consecutive time steps, $\u03c2lm(i+1)$, $\u03c2mn(i+2)$, …. Since there are typically several active links at every moment, this procedure allows generating a large number of replay trajectories. The physiological duration of replays—typically about 100–200 ms (Colgin, 2016)—roughly corresponds to the coactivity window widths, that is, to the timesteps in which the coactivity graph evolves; we therefore “inject” the activated links into a particular coactivity window *t*_{r} in order to simulate rapid replays.

After a simplicial trajectory is replayed, the injected links begin to decay and to (re)activate in the course of the animal’s moves across the environment, just as the rest of the links. Most of these “reactivated” links simply rejuvenate the existing connections in 𝒢_{τ}. However, some injections instantaneously reinstate decayed connections and produce an additional population of higher order cliques, which affect the topological properties of the coactivity complex 𝓕_{τ}, and hence—according to the model—of the cognitive map. As mentioned previously, hippocampal replays are believed to enable spatial learning by stimulating inactive connections, by slowing down their decay, and by reinforcing cell assemblies’ stability (Carr et al., 2011; Ego-Stengel & Wilson, 2010; Girardeau et al., 2009; Girardeau & Zugaro, 2011; Jadhav et al., 2012; Sadowski et al., 2016). In the model’s terms, this hypothesis translates as follows: the additional influx of rejuvenated simplexes provided by the replays should qualitatively improve the topological structure of the flickering coactivity complex, slow down deterioration of its simplexes, suppress its topological defects, and,
in general, help to sustain its topological integrity. In the following, we test this hypothesis by simulating different patterns of the place cell reactivations and quantifying the effect that this produces on the simulated cognitive map.

## RESULTS

### Initial Testing

The effect produced by the replays on the cognitive map depends on the parameters of the model: the selection of replayed trajectories, the injection times, the frequency of the replays, and so forth. To start the simulations, we selected *N*_{s} = 80 different replay sequences originating at *N*_{i} = 25 moments of time, *t*_{i}, *i* = 1, …, *N*_{i}, between 20 and 200 s of navigation (the initial interval *I*_{init}). During this period, the trajectory covers the arena more or less uniformly: a typical 25-s-long segment of a trajectory extends across the entire environment and contains on average about *l*_{s} = 100 links (Supporting Information Figure S1). As a result, the corresponding simplicial paths traverse the full coactivity complex 𝓕_{τ}, and one would expect that replaying these paths should help to suppress the topological defects in 𝓕. To verify this prediction, we replayed the resulting pool of 𝒢-link sequences within the main instability period *I*_{5} by using different approaches and tested whether this can suppress the topological fluctuation (Figure 3A).

In the first scenario, all replay chains were injected into the connectivity graph 𝒢_{τ} at once, in the middle of the instability period *I*_{5} (Figure 3B). As a result of such a “massive” instantaneous replay, the topological fluctuations are initially suppressed but then they quickly rebound, producing about the same number of spurious 0*D* loops (i.e., the cognitive map remains as fragmented as before) and an even higher number of 1*D* loops that mark spurious holes in the cognitive map (Supporting Information Movie 1). In other words, our model suggests that a single “memory flash” fails to correct the deteriorating memory map even at a short timescale, which suggests that more regular replay patterns are required.

Indeed, if the same set of replay sequences is uniformly distributed into *N*_{r} = 5 consecutive groups inside the instability period *I*_{5} (one group per 36 s, *N*_{s}/*N*_{r} = 16 chains of links each), then the topological fluctuations in the coactivity complex 𝓕_{τ} subside more and over a longer period (see Figure 3C and Supporting Information Movie 2). If the replays are produced even more frequently (every 9 s, i.e., about 20 replays total, *N*_{s}/*N*_{r} ≈ 4 chains of links injected per replay) then the topological fluctuations in *I*_{5} are essentially fully suppressed over the entire environment (Figure 3D, Supporting Information Movie 3).

One can draw two principal observations from these results: first, that spontaneous reactivation of connections at the physiological timescale can qualitatively alter the topological structure of the flickering coactivity complex, and, second, that the temporal pattern of replays plays a key role in suppressing the topological fluctuations in the cognitive map.

### Implementation of the Replays

Electrophysiological data shows that the frequency of the replays ranges between 0.1 Hz in active navigation to 0.4 Hz in quiescent states and 4 Hz during sleep (Colgin, 2016; Jadhav et al., 2012; O’Neill et al., 2006; Sadowski et al., 2016). Since we model spatial learning taking place during active navigation, we implemented replays at the maximal rate of 0.4 Hz, which corresponds to no more than one replay event over 10 consecutive coactivity intervals. Second, we took into account the fact that, in complex environments, the hippocampus may replay a few sequences simultaneously. For example, on the *Y*-track (O’Neill et al., 2006) two simultaneous replay sequences can represent the two prongs of the *Y*. In open environments,
there may be more simultaneously replayed sequences; however, we used the most conservative estimate and replayed two different sequences at each replay moment *t*_{r}.

In the simplest scenario, we injected pairs of sequences into the coactivity graph 𝒢_{τ} with a constant delay of about Δ*T* = *t*_{i} − *t*_{r} ≈ 14 min after their physical onset, which placed them inside of the instability period *I*_{5} (Figure 4A). In response, the topological fluctuations in the coactivity complex 𝓕_{τ} significantly diminished. In fact, the zeroth Betti number (the number of the disconnected components) regained its physical value *b*_{0}(𝓕_{τ}) = 1, indicating that the replays helped to pull the fragments of the cognitive map together into a single connected piece. The first Betti number (the number of holes) remains on average close to its physical value, 〈*b*_{1}(𝓕_{τ})〉 = 1.5, exhibiting occasional fluctuations, Δ*b*_{1} = ±2.2.

As mentioned above, the occasional islets separating from the main body of the simplicial complex or a few small holes appearing in it for a short period should be viewed as topological irregularities rather than signs of topological instability. We therefore base the following discussion on addressing only the qualitative differences produced by the replays on the topology of the cognitive map: whether replays can prevent fracturing of the complex into multiple pieces and rapid proliferation of spurious loops in all dimensions. From such perspective, our results demonstrate that translational replays at a physiological rate can effectively restore the correct topological shape of the cognitive map, which illustrates functional importance of the replay activity.

Since the replays are generated by the endogenous activity of the hippocampal network, the relative temporal order of the replayed sequences can be altered, that is, the replay times *t*_{r} can be spread wider or denser than their “physical” origination times *t*_{i}. The effect of the replays will be, respectively, weaker or stronger than in the case of translational delay because of the corresponding changes of the sheer number of the reactivated links. However, one can factor out the direct contribution of the replays’ volume and study more subtle effects produced specifically by the replay’s temporal organization. To this end, we split the replay period *I*_{5} into a set of *N*_{R} shorter subintervals, $I51$, $I52$, … $I5NR$, and then replayed the sequences of links originating from the initial 3-min interval *I*_{init} within each subinterval $I5n$, *n* = 1, 2, …, *N*_{R}. Since only two sequences are replayed within every coactivity window, the total number of the (re)activated sequences remains the same as in the delayed replay case, even though the source interval *I*_{init} is compressed *N*_{R}-fold in time. Thus, the difference between the effects produced by the “compressed” replays will be due solely to the differences in their temporal reorganizations.

The results illustrated in Figure 4B demonstrate that the compressed replays suppress the topological fluctuations more effectively. For example, the repeated replay in a sequence of 20-s intervals (*N*_{R} = 9 fold compression) not only restores the correct value of the zeroth Betti number, *b*_{0}(𝓕_{τ}) = 1, but also drives the average number of noncontractible simplicial loops close to physical value, 〈*b*_{1}(𝓕_{τ})〉 = 1.2 ± 1. In other words, 𝓕_{τ} almost regains its topologically correct shape, with an occasional spurious hole appearing for less than a second. Physiologically, these results suggest that time-compressed, repetitive “perusing” through memory sequences helps to prevent deterioration of global memory frameworks better than simple “orderly” recalls.

### Speed Modulation of the Replays

Since replays are mostly observed during quiescent periods and slow moves (O’Neill et al., 2006; O’Neill, Senior, Allen, Huxter, & Csicsvari, 2008), we studied whether such “low-speed” replays will suffice for suppressing the topological fluctuations in the cognitive map. Specifically, we identified the periods when the speed of the animal falls below 15 cm/sec (which, in our simulations happens during 14% of time (see Supporting Information Figure 3 and Koene & Hasselmo, 2008; Nádasdy, Hirase, Czurkó, Csicsvari, & Buzsáki, 1999), and replayed the place cell sequences only during these periods.

It turns out that although the resulting slow motion replays can stabilize the topological structure of the simulated cognitive map, the effect strongly depends on their temporal organization. Specifically, in the simple delayed replay scenario, the topological fluctuations remain significantly higher than without speed modulation (Figure 4C and Movie 4, Supporting Information). On average, the coactivity complex contains about a dozen spurious loops: it remains split in a few pieces, 〈*b*_{0}(𝓕_{τ})〉 = 4.2, that together contain 〈*b*_{1}(𝓕_{τ})〉 = 8.2 holes on average. This is a natural result—one would expect that speed restrictions will diminish the number of the injected active connections and hence that 𝓕_{τ} will degrade more. A slightly compressed replay (4 min of activity replayed over 3-min period) does not improve the result: both the number of disconnected components and the number of holes in them increase 〈*b*_{0}(𝓕_{τ})〉 = 5.9, 〈*b*_{1}(𝓕_{τ})〉 = 9.2 (Figure 4D). However, if the replays are compressed further, the average number of disconnected components is significantly reduced: for the threefold compression shown on Figure 4E, the mean values are 〈*b*_{0}(𝓕_{τ})〉 = 1.1 and 〈*b*_{1}(𝓕_{τ})〉 = 1.7, that is, the encoded map approaches the quality of the maps produced with unrestricted replays.

The effectiveness of the latter scenario can be explained by noticing that replay compression brings the activities that are widely spread in physical time into close temporal vicinities during the replays. In other words, in compressed replays, a wider variety of connections is activated at each *t*_{r}: the real-time separation between activity patterns shrinks. This helps to reduce or eliminate the temporal “lacunas” in place cell coactivity across the entire hippocampal network and hence to prevent spontaneous deterioration of its parts. In physiological terms, this implies that the compressed replays of the place cell patterns are less constrained by the physical temporal scale of the rat’s navigational experiences, which leads to a more even activation of the connections in the network and helps to prevent the memory map’s fragmentation.

To test this idea, we amplified this effect by shuffling the order of the replayed sequences and by randomizing the injection diagram, thus enforcing a nearly uniform pattern of injected activity across the simulated population of cell assemblies. This indeed proved to be the most effective replay strategy: as shown on Figure 4F, such replay patterns restore the topological shape of the coactivity complex, allowing only occasional holes: 〈*b*_{0}(𝓕_{τ})〉 = 1, 〈*b*_{1}(𝓕_{τ})〉 ≈ 1.4 ± 1.2 (Supporting Information Movie 5). Thus, the model suggests that “reshuffling” the temporal sequence of memory replays helps to sustain memory framework better than orderly recollections, occurring in natural past-to-future succession. The effect of random replays of the place cell sequences over the entire simulated navigation period shown in Figure 5 clearly illustrates the importance of replays for rapid encoding of topological maps: the fluctuations in the cognitive map are uniformly suppressed (for the original values of the Betti numbers during all six instability periods without replays see Table 1 in Methods).

Instability period
. | $b-0$ . | Δ
. b_{0} | $b-1$ . | Δ
. b_{1} |
---|---|---|---|---|

I_{1} | 7.7 | 4.2 | 8.2 | 4.3 |

I_{2} | 17.9 | 9.8 | 28.7 | 11.1 |

I_{3} | 7.1 | 3.8 | 14.2 | 3.8 |

I_{4} | 5.5 | 3.4 | 8.9 | 4.4 |

I_{5} | 27.8 | 19.8 | 34.9 | 21.2 |

I_{6} | 5.7 | 3.8 | 7.7 | 3.1 |

Instability period
. | $b-0$ . | Δ
. b_{0} | $b-1$ . | Δ
. b_{1} |
---|---|---|---|---|

I_{1} | 7.7 | 4.2 | 8.2 | 4.3 |

I_{2} | 17.9 | 9.8 | 28.7 | 11.1 |

I_{3} | 7.1 | 3.8 | 14.2 | 3.8 |

I_{4} | 5.5 | 3.4 | 8.9 | 4.4 |

I_{5} | 27.8 | 19.8 | 34.9 | 21.2 |

I_{6} | 5.7 | 3.8 | 7.7 | 3.1 |

## DISCUSSION

The model discussed above suggests that replays of place cell activity help to learn and to sustain the topological structure of the cognitive map. The physiological accuracy of the replay simulation can be increased ad infinitum, by incorporating more and more parameters into the model. In this study we use only a few basic properties of the replays, which, however, capture several key functional aspects of the replay activity. First, the model implements an effective feedback loop, in which the onset of topological instabilities in the flickering coactivity complex 𝓕_{τ} triggers the replays that restore its integrity. Indeed, the cell assemblies’ (and the corresponding simplexes’) decays intensify as the animal’s exploratory movements slow down and visits to particular segments of the environment become less frequent. On the other hand, low-speed periods define temporal windows during which the simulated replays are injected into the network, which work to suppress the topological instabilities. Second, the model allows controlling the replays’ temporal organization independently from the other parameters or neuronal activity and exploring the replays’ contribution into acquiring and stabilizing the cognitive maps. The results demonstrate that in order to strengthen the decaying connections in the hippocampal network effectively, the replays must (1) be produced at a sufficiently high rate that falls within the physiological range and (2) distribute without temporal clustering, in a semi-random
order.

An important aspect of the obtained results is a separation of the timescales at which different types of topological information is processed. On the one hand, rapid turnover of the information about local connectivity at the working memory timescale is represented by quick recycling of the cell assemblies and rapid spontaneous replays of the learned sequences. On the other hand, the large-scale topological structures of the cognitive map, described by the instantaneous homological characteristics of the coactivity complex, emerge at the intermediate memory timescale. Thus, the model suggests that the characteristic timescale of the topological loops’ dynamics is by an order of magnitude larger than the timescale of fluctuations at the cell assembly level. This observation provides a functional perspective on the role played by the place cell replays in learning: by reducing the fluctuations, replays help separating the fast and the slow information processing timescales and hence to extract stable topological information that can be used to build a long-term, qualitative representation of the environment. This separation of timescales corroborates with the well-known observation that transient information is rapidly processed in the hippocampus and then the resulting memories are consolidated and stored in the cortical areas, but at slower timescales and for longer periods.

## METHODS

### Topological Glossary

For the reader’s convenience, we briefly outline the key topological terms and concepts used in this paper.

- ▪
*An abstract simplex*of order*d*is a set of (*d*+ 1) elements, for example, a set of coactive cells,*σ*^{(d)}= [*c*_{i0},*c*_{i1}, …,*c*_{id}] or a set of place fields,*σ*^{(d)}= [*υ*_{j0},*υ*_{j1}, …,*υ*_{jk}]. The subsets of*σ*^{(d)}are its*subsimplexes*. Subsimplexes of maximal dimensionality (*d*− 1) are referred to as*facets*of*σ*^{(d)}. - ▪
*An abstract simplicial complex*Σ is a family of abstract simplexes closed under the overlap relation: a nonempty overlap of any two simplexes $\sigma 1(d1)$ ∈ Σ and $\sigma 2(d2)$ ∈ Σ is a subsimplex of both $\sigma 1(d1)$ and $\sigma 2(d2)$. - ▪
Geometrically, simplexes can be visualized as

*d*-dimensional polytopes:*σ*^{(0)}as a point,*σ*^{(1)}as a line segment,*σ*^{(2)}as a triangle,*σ*^{(3)}as a tetrahedron, and so forth. The corresponding*geometric simplicial complexes*are multidimensional polyhedra that have a shape and a*structure*that does not change with simplex deformations, for example, disconnected components, holes, cavities of different dimensionality, and so on. This structure, commonly referred to as*topological*(Aleksandrov, 1965), is identical in a geometric simplicial complex to and in the abstract complex built over the vertexes of the geometric simplexes. Thus, abstract simplicial complexes may be viewed as structural*representations*of the conventional geometric shapes. - ▪
Topological properties of the simplicial complexes are established based on algebraic analyses of chains, cycles and boundaries.

*A chain α*^{(d)} is a formal combination *d*-dimensional simplexes with coefficients from an algebraic ring or a field. Intuitively, they can be viewed, for example, as the simplicial paths described in The Model section. Such combinations permit algebraic operations: they can be added, subtracted, and multiplied by a common factor, and so forth. As a result, the set of all chains of a given simplicial complex, *C*(Σ), also forms an algebraic entity, for example, if the chains’ coefficients form to a field, then *C*(*Σ*) forms a vector space.

*A boundary* of a chain, ∂*α*^{(d)}, is a formal combination of all the facets of the *α*-chain, with the coefficients inherited from *α* and alternated so that the boundary of ∂*α*^{(d)} vanishes, ∂^{2}*α*^{(d)} = 0. This universal topological principle—boundary of a boundary is a null set—can be illustrated on countless examples, for example, by noticing that the external surface of a triangular pyramid *σ*^{(3)}—its geometric boundary—has no boundary itself.

*Cycles* generalize the previous example—a generic cycle *z* is a chain without a boundary, ∂*z* = 0. Intuitively, cycles correspond to agglomerates of simplexes (e.g., simplicial paths) that loop around holes and cavities of the corresponding dimension. Note however, that although all boundaries are cycles, not all cycles are boundaries.

- ▪
*Homologies*are two cycles,*z*_{1}and*z*_{2}, that are*equivalent*, or*homologous*, if they differ by a boundary chain. The set of equivalent cycles forms a*homology class*. If the chain coefficients come from a field, then the homology classes of*d*-dimensional cycles form a vector space H_{d}(Σ). The dimensionality of this vector space is the*d*-th*Betti number*of the simplicial complex Σ,*b*_{d}(Σ) = dim H_{k}(Σ), which counts the number of independent*d*-dimensional holes in Σ. - ▪
*Flickering complexes*𝓕(*t*) consist of simplexes that may disappear or (re)appear, so that the complex as a whole may grow or shrink from one moment to another (see Figure 2 in Babichev et al., 2018),Computing the corresponding Betti numbers,$F(t1)\u2286F(t2)\u2286F(t3)\u2287F(t4)\u2286F(t5)\u2287\u2026.$*b*_{k}(𝓕(*t*)), requires a special technique—*Zigzag persistent homology*theory that allows tracking cycles in 𝓕 on moment-to-moment basis (Babichev et al., 2018; Carlsson & De Silva, 2010; Carlsson et al., 2009). - ▪
*A clique*in a graph*G*is a set of fully interconnected vertices, that is, a complete subgraph of*G*. Combinatorially, cliques have the same key property as the abstract simplexes: any subcollection of vertices in a clique is fully interconnected. Hence a nonempty overlap of two cliques*ς*and*ς*′ is a subclique in both*ς*and*ς*′, which implies that cliques may be formally viewed as abstract simplexes and a collection of cliques in a given graph*G*produces its*clique simplicial complex*Σ(*G*) (Jonsson, 2008). In particular, the*clique coactivity complexes*𝒯_{ς}is induced from the*coactivity graphs*𝒢 (Babichev et al., 2016; Basso et al., 2016; Hoffman et al., 2016) and the flickering clique complexes 𝓕_{τ}are constructed using coactivity graph with flickering connections 𝒢_{τ}, (Babichev & Dabaghian, 2017a, 2017b; Babichev et al., 2018). Note however, that the topological analyses address the topology of the coactivity complexes, rather than the network topology of 𝒢.

### Spike Simulations

*T*

_{tot}= 30 min, the trajectory covers the environment uniformly. The maximal speed of the simulated movements is

*v*

_{max}= 50 cm/s, with the mean value $v-$ = 25 cm/s. The firing rate of a place cell

*c*is defined by

*f*

_{c}is the maximal firing rate and

*s*

_{c}defines the size of the place field centered at

*r*

_{c}(Barbieri et al., 2004). In addition, spiking is modulated by the

*θ*-oscillations—a basic cycle of the extracellular local field potential in the hippocampus, with the frequency of about 8 Hz (Arai et al., 2014; Huxter, Senior, Allen, & Csicsvari, 2008; Mizuseki et al., 2009). The simulated ensemble contains

*N*

_{c}= 300 virtual place cells, with the typical maximal firing rate

*f*= 14 Hz and the typical place field size

*s*= 20 cm.

### The Statistics of the Betti Numbers

## AUTHOR CONTRIBUTIONS

Andrey Babichev: Formal analysis; Investigation; Software; Validation; Visualization. Dmitriy Morozov: Methodology; Software. Yuri Dabaghian: Conceptualization; Data curation; Formal analysis; Funding acquisition; Investigation; Methodology; Project administration; Resources; Software; Supervision; Validation; Visualization; Writing – original draft; Writing – review & editing.

## FUNDING INFORMATION

Yuri Dabaghian, National Science Foundation (http://dx.doi.org/10.13039/100000001), Award ID: 1422438. Dmitriy Morozov, Department of Energy, Office of Science (http://dx.doi.org/10.13039/100006132), Contract ID: DE-AC02-05CH11231.

## ACKNOWLEDGMENTS

This document was prepared as an account of work sponsored by the United States Government. While this document is believed to contain correct information, neither the United States Government nor any agency thereof, nor the Regents of the University of California, nor any of their employees, makes any warranty, express or implied, or assumes any legal responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately owned rights. Reference herein to any specific commercial product, process, or service by its trade name, trademark, manufacturer, or otherwise, does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or any agency thereof, or the Regents of the University of California. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or any agency thereof or the Regents of the University of California.

This manuscript has been authored by an author at Lawrence Berkeley National Laboratory under Contract No. DE-AC02-05CH11231 with the U.S. Department of Energy. The U.S. Government retains, and the publisher, by accepting the article for publication, acknowledges, that the U.S. Government retains a non-exclusive, paid-up, irrevocable, world-wide license to publish or reproduce the published form of this manuscript, or allow others to do so, for U.S. Government purposes.

## TECHNICAL TERMS

- Hippocampal place cells:
Cells that fire in specific restricted locations in the environmenttheir respective place fields. It is believed that a cognitive map of a given environment emerges from the combined activity of place cells.

- Cognitive map:
An internal neural representation of the environment, used by the animals (e.g., birds and mammals) to orient in space, to plan spatial navigation strategies, path integrate, and so forth. It is generally accepted that the hippocampus plays a key role in producing and sustaining cognitive maps.

- Hippocampal cell assemblies:
Transient, functionally interconnected groups of place cells that exhibit frequent coactivity. The organized activity of cells in the hippocampal and cortical assemblies is believed to underlie learning and memory mechanisms.

- Replays of place cell sequences:
The endogenous activities in the hippocampal network that recapitulate sequential place cell firing during physical exploration of an environment. Spontaneous replays are observed during sleep, quiescent wakeful states, and active navigation. It is believed that replays mark animals exploration and retrieval of the learned spatial information by “cuing” the hippocampal network.

## REFERENCES

## Author notes

Competing Interests: The authors have declared that no competing interests exist.

Handling Editor: Paul Expert