Grid Cells Lose Coherence in Realistic Environments

Spatial cognition in naturalistic environments, for freely moving animals, may pose quite different constraints from that studied in artificial laboratory settings. Hippocampal place cells indeed look quite different, but almost nothing is known about entorhinal cortex grid cells, in the wild. Simulating our self-organizing adaptation model of grid cell pattern formation, we consider a virtual rat randomly exploring a virtual burrow, with feedforward connectivity from place to grid units and recurrent connectivity between grid units. The virtual burrow was based on those observed by John B. Calhoun, including several chambers and tunnels. Our results indicate that lateral connectivity between grid units may enhance their “gridness” within a limited strength range, but the overall effect of the irregular geometry is to disable long-range and obstruct short-range order. What appears as a smooth continuous attractor in a flat box, kept rigid by recurrent connections, turns into an incoherent motley of unit clusters, flexible or outright unstable.


Introduction
The nervous system acquires from experience multiple representations of the external world. Extensively studied examples are in the hippocampus and adjoining cortices of rodents and other small mammals, near the apex of their cortical hierarchy [1]. There, the position of the animal in its immediate surroundings and other spatial variables are clearly prominent correlates of neural activity, as exemplified by 50 years of research on place cells [2], but high level representations have been described also for other variables, including time [3,4], auditory frequency [5], odors [6,7] and taste [8]. Spatial representations have been thoroughly studied in the laboratory, yielding amazing results [9] but in conditions rather different from those prevailing in the wild. The medial entorhinal cortex (mEC), one synapse upstream of and a major source of inputs to the hippocampus, includes numerous functionally-defined cell types contributing to spatial representations. Significant fractions of its cells have been characterized as grid cells [10], border cells [11], head direction and conjunctive cells [12], speed cells [13] and irregular spatial cells [14]. Should we understand this characterization as encompassing the different components of a precisely engineered system, or as a list of some of the most salient properties expressed by this population of neurons, which is however not rigidly partitioned into cell classes? The question is made more relevant by the failure, over the years, to identify a precise correspondence of such putative classes with cell properties observed in other species, notably in primates.
Place cells fire action potentials when the animal moves through locations in the environment, specific to each cell, called place fields. A simple intuitive model envisages place cells as being assigned, at random, each a location in the environment to represent with its activity, so that at a population level from the list of cells active at a moment in time one can easily decode the position of the animalwho effectively, then, has available a spatial map with its own position annotated on it. This model does not seem outrageously inappropriate, particularly given that the majority of place cells show only one field in the classical laboratory environment, typically smaller than 1m 2 . Several recent experiments, however, show that in larger environments place cells often have multiple and irregularly arranged place fields [15][16][17][18]. Still, since the multiple fields are irregularly arranged, one expects that a different list of active cells will uniquely identify each location. Thus place cells, on their own, should effectively represent or map a number of locations in space exponential in the number of cells considered. Even huge environments could be mapped by a sufficient number of place cells.
The effectiveness of the spatial code would appear more doubtful with grid cells, discovered later in the medial entorhinal cortex (mEC) [10]. At least in the simplest intuitive model, each grid cell fires at multiple discrete spaced locations, regularly arranged on a hexagonal pattern that tiles the entire space available to the animal in a laboratory environment. Taken to the extreme, the model would predict that the list of active cells is the same at all locations situated on the hexagonal pattern, which the code would then be unable to distinguish. But are the intuitive models abstracted from experiments in the lab relevant to ecological conditions, where these neural systems have evolved over millions of years?
In this paper, we focus on the pattern formation process of grid cells, based on feed-forward spatial information contributed by place cells, as expressed in our selforganizing adaptation model. The spatial representations expressed by grid cells and place cells have been reported to differ substantially in the amount of local information they incorporate. Place cells can show global remapping, given sufficient changes in the external environment [19], indicating that they are highly influenced by local spatial information. Grid cells, at least in flat regular environments, do not show global remapping, once the population as a whole has been anchored to the local environment [20]. Major changes in the environment, which cause the global remapping of place cells, on an individual basis, appear to induce only a coherent population realignment by grid cells [21]. Subsequent experiments have partially qualified these results, by showing that the grid pattern is influenced by walls [22], unstructured but oddly shaped environments [23], local cues [24], goals [25]. The simple radical notion that grid cells provide a universal spatial metric has therefore been challenged. In addition, in the search of grid patterns in 3D environments, only local order, expressed e.g. by relatively uniform inter-field distances, has been seen to be partially preserved [26], in agreement with the theoretical predictions of the selforganizing adaptation model in 3D [27].
To better understand the spatial selectivity expressed by grid cells, it seems increasingly urgent to move out of artificial laboratory settings. Grid cells have been observed in several species, including rats [10], mice [28] and crawling bats [29], with related cellular selectivity also in monkeys [30] and humans [31,32], pointing at some degree of universality underlying the phenomenon. These animals experience space in their natural environment, whether large scale 2D where they roam, or 3D where they swim, jump, climb and fly, or curved and crooked, for those who live in burrows. One could start by considering three simple types of geometry, flat 2D, 3D, and curved.
In this paper, we aim to further our understanding of grid patterns in burrows, where rats, arguably the most frequently used species for the study of spatial representations, usually live in the wild [40,41].
Norway rats, a most common strain of rats widely used in research, usually referred to as the common rat, have seen their burrowing habits meticulously described by John B. Calhoun [40], with the original motivation to control their proliferation in the city of Baltimore. Calhoun has produced estimates of the quantitative characteristics of typical burrows housing ca. 11 adult rats: on average 10 chambers (2 terminal; 8 with at least 2 entrances), linked by 40 tunnels (including on average 13 to exits; 20 internuncial; 7 blind). A sketch is shown in Figure 1 left [40]. On these descriptions we base our virtual burrows, generated by an in-house algorithm, one of which is shown in Figure 1 right. The yellow line is an example of a simulated trajectory.

The construction of the burrows
Our computer model generates virtual burrows with a simple geometry, in which the chambers are represented by spheres, of variable diameter, while the tunnels are schematized as sequences of short curved cylinders (i.e. sections of tori) of variable length and external (curvature) radii, and fixed internal diameterjust enough for a virtual rat to run through. Spheres are thus assigned a center and a diameter, while curved cylinders are defined by a circular basis (with a fixed diameter and a centre and normal versor such that it lies on a sphere, or at the end of another tunnel segment) which is then translated along an arc of circumference (with parameters the versor and magnitude of the curvature radius, and the arc length). Additionally, we draw on the work of Calhoun [40] to define probability distributions for e.g. the diameters of the spheres and the lengths of the tunnels.
Burrow construction proceeds by generating a given number of spheres, with diameters and center-center distances compatible with the observed chamber sizes and distribution of tunnel lengths. Then, the internal burrow connectivity develops, randomly split between chamber-chamber and tunnel-chamber tunnels. Finally, some blind and exit tunnels are added. The tunnels start with an existing object -sphere or tunnel -and define the initial segment of the new tunnel as a short, straight cylinder with the basis circumference tangent to the preexisting object at a random location, then new curved segments are added, with a basis that coincides with the top of the previous one (same centre, radius and normal versor), while the remaining parameters are randomly generated. The tunnels terminate after randomly growing in random directions for a random length if blind tunnels, when penetrating a target sphere or tunnel if internuncial tunnels, or upon reaching a predefined horizontal plane (i.e. the ground) if exit tunnels. In the last two cases, the direction of growth is biased towards the target destination, with a probability inversely proportional to the distance to the target, and we restrict the choice of the plane of the radial curvature so as to point towards the desired outcome.

Trajectories
In the simulations, a virtual rat explores one of the virtual burrows described above with a constant speed v ¼ 40cm=s. Each time step in the simulation is taken to correspond to 10ms in real time. The total length of a simulation is 100 million steps (which would correspond to nearly 12 days of continuous running, to ensure that the self-organization process has approached its asymptote). To obtain smooth random trajectories, resembling those observed in experiments, the change in running direction in the chambers is sampled from a Gaussian distribution with zero mean and standard deviation σ RD ¼ 0:2 radians; in tunnels, since the size of the tunnels normally can only allow a single rat to pass, the running direction of the virtual rat is always following the tunnels. If the random trajectories lead the virtual rat to the junctions, the virtual rat changes sub-environment (from chamber to tunnel, from tunnel to chamber, or from tunnel to another tunnel). If the tunnel has a dead end, the virtual rat turns back when it reaches the end. The trajectories are limited to the lower half of the environment because of gravity.

Network model
The model is comprised of two layers. The input layer represents, for example, the CA1 region of the hippocampus and contains N hip ¼ ρS þ L t =l c model place cells, which we refer to as place units below, where ρ ¼ 8000=m 2 is the density of input units in chambers, S is the total area of the chambers, L t is the total length of the tunnels, l c is the mean local inter distance of place units in tunnels. This guaranteed that the place units are equally distributed and cover the whole environment. The output layer represents a population of N mEC ¼ 100 model mEC cells, which we refer as grid units below.
The input to grid unit i at time t is given by The weight W t ij connects place unit j to grid unit i Here we assume that grid units develop their maps from scratch, receiving spatially modulated inputs from the place units which have already developed, in line with observations in rat pups, which show that place cells mature earlier than grid cells [42,43].
Although weak spatial input is sufficient for grid pattern formation [33], regularly arranged place cells are ideal for this function and reduce the averaging necessary for learning with respect to more irregular inputs. Here the activity of each place input unit in space is modeled as a Gaussian place field centered at preferred position x ! j0 is the current location of the virtual rat. k Á k is the shortest distance (distances in chambers are calculated along great circles, and in tunnels longitudi- are not in the same sub-environment). σ p ¼ 5cm is the radius of the place fields.

Single-unit dynamics
The firing rate ψ t i of grid unit i is determined through a threshold-nonlinear transfer function where ψ sat ¼ 2=π normalizes the firing rate into arbitrary units. Θ Á ð Þ is the Heaviside function. The variable μ t is a threshold while α t i represents a timeintegration of the input h i , adapted by the dynamical threshold β i where β i has slower dynamics than α i , and b 2 is set to These adaptive dynamics make it more difficult for a neuron to fire for a long period of time, and endow grid units with fatigue dynamics [33]. The gain g t and threshold μ t are iteratively adjusted at every time step to fix the mean activity a ¼ P i ψ t i =N and the sparsity s ¼ within a 10% relative error bound from pre-specified values, a 0 ¼ 0:1 and s 0 ¼ 0:3 respectively.

Head direction modulation and collateral connections
Head direction (HD) modulation and collateral connections are important for grid alignment, as suggested by the detailed analysis in [33,34]. The head direction in the chambers (spheres) is defined as the angle between a vector and the vector pointing towards the north pole.
With the addition of HD modulation and collateral connections, Eq. (1) for the inputs to grid unit i is rewritten where ψ tÀτ k is the activity of other grid unit k reverberated by collateral connections W t ik with a delay τ ¼ 25 steps. ρ t 1 ¼ φt=T when t < T and φ when t ≥ T, where T ¼ 5 Â 10 6 for each simulation, and φ is a set value controlling the strength of recurrent connections. Then the time-dependent strength ρ t 1 is gradually increasing from zero, in order to reduce the influence of the initial random weights.
f θ i ω t ð Þ is the HD tuning function that has maximal value when the current head direction ω t of the simulated rat is along the preferred direction θ i .
and c ¼ 0:1 and v ¼ 0:8 are parameters determining the baseline activity and the width of head direction tuning.

Synaptic plasticity
All weights in the network self-organize while the virtual rat explores the environment and the updating following the Hebbian rule.
and η ¼ 0:05 is a positive averaging factor. The collateral weights between grid units are adapted according to Here ζ ¼ 6:6 Â 10 À5 is a learning rate smaller, at least initially, than the learning rate for feed-forward weights between place units and grid units. κ ¼ 0:1 is an inhibition factor.
All the weights in the network are initialized as random numbers 1 À γ ð Þþγu: γ ¼ 0:1, and u is a random variable uniformly distributed in 0, 1 ½ . After initialization or weight changes, all weights are normalized to a unitary L 2 norm X

Results
In the simulations, grid units may have been expected to form highly regular patterns, as they do in flat 2D environments [33]. However, in our burrows, modeling the natural environment of real rats, the activity patterns that get established are not nearly as regular. Figure 2 shows the grid map of one sample grid unit. The lower half of the sphere, representing a chamber, was projected to a horizontal plane, while the upper half was discarded, as trajectories are limited to the lower half to model gravity. Tunnels were straightened into 1D segments. Sufficiently explored chambers show clearly identifiable fields, while those where the virtual rat spent less time show only blurred, often overlapping fields. Longer simulations make for little improvement. Tunnels, as they are 1D structures, are easier to learn and show clear fields even in shorter simulations.
The grid maps in a chamber include very few fields, as indicated in Figure 2 top. In fact, chamber width is at most 0.3 m (reported as 298 mm, with median 221 mm

Grid maps in burrows and their stability. (Top and center) The maps of one unit in chambers (the lower half of each chamber is shown), and in tunnels (straightened and taken to be 1D). Chambers (tunnels) are shown in order of radius (length), with the percent time spent in each by the virtual rat indicated top left, top right indicates the maximum firing rate (always in the range [0,1], given Eq. (3)). (Bottom) Correlation with the map at the reference time.
From the first to the third row, the initial learning rate is lowered from ξ ¼ 0:01 through ξ ¼ 0:001 to ξ ¼ 0:0001; while from the first to the third column, the reference time points are 2 Â 10 5 , 6 Â 10 5 , 10 Â 10 5 . and minimum 155 mm [40]), unlike the 2 m diameter of the flat circular enclosure used in the Moser lab [10], and even considerably smaller than the small square boxes used earlier and in several later studies (e.g., 1:0 Â 1:0m [44]). Due to this reason, to be able to study the layout of the fields in a spherical chamber we have used larger diameters in our model curved environments, so they would include e.g. the 12 fields of the most regular pentagonal arrangement [37,39] (on the entire sphere, top and bottom, with 6 in the lower half).
For grid patterns to be stable, the feed-forward learning rate between place units and grid units has to be very small. As shown in Figure 2 bottom, with learning rate ξ ¼ 0:01 grid units may keep shifting their fields as the simulation proceeds, so that their correlation with those at any reference time keeps changing; with learning rate ξ ¼ 0:001 the stability is markedly improved, and with ξ ¼ 0:0001 grid units appear to form stable maps both in chambers and in tunnels.
The gridness score has been widely used to quantify the spatial periodicity of grid patterns, but it can be applied only to patterns with six-fold symmetry. Results from simulations in curved environments show regular grid patterns with five-fold or lower symmetry for constant positive curvature, and seven-fold or higher symmetry for negative curvature [37,38]. In the burrows simulated here, inter-field distances vary also within chambers (light blue distribution in Figure 3 top), indicating that spatial periodicity is not a property of grid cells in natural environments.
The inter field distances in tunnels (green distribution in Figure 3 top) have a larger peak value than in chambers. In chambers, in fact, our simulated trajectories are curved as the running direction keeps changing, unlike the trajectories in tunnels which can only follow the 1D tunnels, so the distance traveled over the adaptation time scale is longer in tunnels than in chambers. For real rats, of course, the distance traveled in each sub environment depends strongly on their prevailing speed, likely contributing to the different representation of grid cells in tunnels and chambers.
The virtual rat learns the entire environment at the same time, since the randomly generated trajectories span it all. We asked, then, whether grid units form a continuous representation of the whole environment, by checking whether the junctions connecting chambers and tunnels break the continuity. In Figure 3 bottom left, field B and field A are the closest fields to a junction, from the tunnel and chamber side, respectively, and x and y represent their distance from the junction, so that x ¼ field distance À y. As shown in Figure 3 bottom right, x and y do not show the expected negative correlation (with À1 or with any other clear slope), but rather a loose relationship. This indicates that spatial representations by simulated grid units are effectively independent in distinct portions of the environment, as this is in practice partitioned up by the junctions.
Realistic simulated burrows like that in Figure 1 right require enormous CPU time to be explored with sufficient statistics, and even then the maps that form especially in the chambers often present rather unclear fields, as in Figure 2. Therefore, in the following analyses we consider a simplified burrow, with only three chambers and three tunnels connecting them, and compare the maps emerging there with those in a square box or in/on a sphere. Since the gridness score cannot be readily applied, we use instead the distributions of inter field distance (left column of Figure 4) and of the angles between triplets of nearby fields (right column of Figure 4); such triplets are defined by mutual distance in the range of 50-150% of the first peak in the field distance distribution. We generated data for the square box environment setting the strength of recurrent connections at φ ¼ 0:125, much stronger than in the sphere and burrow, where it was set at φ ¼ 0:05, in order to have in each environment as regular grid patterns as they could be (see Figure 5). The effect of recurrent strength in different environments will be described in details later. Other parameters were kept constant.
The inter-field distance distribution in the box environment (of size 1:5 Â 1:5m 2 ) has clear peaks, shown in Figure 4 upper left. The fourth and fifth peaks are shifted to the left compared with those of perfectly regular six-fold grids, probably because the virtual trajectories are limited by the hard border (which reflects the trajectory as in a mirror when it hits the border). The angles have a distribution centered at 60 degrees, shown in Figure 4 upper right.
The spherical environment, with radius r ¼ 0:5m, allows most grid units to develop 12 fields. Their distribution of field distances also has clear peaks (Figure 4 center left). The angle distribution is centered at 71:8 degrees (Figure 4 center right), just 0:2 degrees below the 72 degrees value of the perfectly regular five-fold grid pattern.
In the burrow environment, simulations have parameters consistent with those in the sphere. The field distance distribution does not have clear peaks, however (Figure 4 lower left). The angle distribution shows more variability than in the box and in the sphere (Figure 4 lower right). This suggests that the formation of regular grid patterns in natural environments, like rat burrows, is very challenging for the same system that produces them easily in laboratory conditions.
The grid maps of cells recorded at the same electrode position show generally a small correlation or rather an anti-correlation [10], because even with similar grid spacing and orientation, a relative phase shift between cells is sufficient to remove the correlation between them. The results from simulations in the flat box environment point at the same phenomenon, with in fact most pairs of grid units ending up negatively correlated, as shown in Figure 6 top. Away from six-fold symmetry, however, things are a bit different. In the sphere, units can form five-fold symmetric grid patterns, when they have 12 fields, fields which cannot be translated on top of each other, because translations do not exist on curved surfaces. So the bulk of the units are less anti-correlated, and the peak correlation shifts to less negative. In the burrow, without regular grid patterns, map correlations show a peak located at even higher values, near zero.
Both in the box and sphere environments, the correlation between some units reaches to almost 1, while most pairs of units are actually anti-correlated. The distribution is much less spread out in the burrow environment where, as we said (Figure 6 top), most pairs of units have correlation close to zero, and the most correlated ones hardly reach above 0.6 spatial (Pearson) correlation. Despite this, the examples in Figure 6 bottom show that a standard K-means algorithm identifies 6 clusters of units in the burrow data, with the same or even greater ease than in the box or sphere data. It appears that the reason is that in the sphere, and even more in the box, different units map out with their fields a low-dimensional spatial continuum, so that breaking them into clusters is quite arbitraryan intuitive example would be that of grid units with fields equi-spaced on a 1D ring, that would themselves describe a ring if randomly spread out, and not a clustered structure. In the  multi-chamber environment of the simplified burrow, clusters apparently emerge spontaneously (see Figure 6 bottom).
Local recurrent connections have been identified as a key element of grid pattern formation [45], in particular to align the grids in a flat environment [35,46,47]. We asked how the strength of recurrent connections affects the pattern formation process in our model environments. We simulated the adaptation model in flat and curved environments, and took the standard deviation of the angles from local triangles as a measure of the regularity of the grid pattern.
Considering two flat environments, a square box and a trapezoid with the same area, grid patterns show minimal standard deviation in the square box when the strength of recurrent connections takes a specific value φ ¼ 0:14, as shown in Figure 5; and a larger minimum value (Figure 5) for somewhat weaker recurrent connections (φ ¼ 0:12) in the trapezoid, known to distort the grid pattern of real cells [23].
In the sphere, however, the minimum standard deviation, comparable with that in the box environment (as both allow for regular tessellation, five-fold in one case and six-fold in the other), is reached with much weaker recurrent connections, φ ¼ 0:05, as shown in Figure 5. In even the simplified burrow, the standard deviation of the angle distribution is inherently higher, because of the lack of longrange order even in the absence of recurrent connections, and recurrent connections are bound to increase the irregularity further (see Figure 4 lower left).
In general, the strength of the recurrent connections might contribute to the rigidity of the grid pattern across environments, but also perhaps to its flexibility in the interaction with walls [22], changes in the boundary [48] and the appearance of local cues [24], including goals [25].

Discussion
The structure of the natural habitat of any species would appear to be a prime determinant of exactly how that species has adapted to live in that habitat; yet in exploring the spatial memory and navigation abilities in rodents, and in particular the neural systems that subserve them, early experiments have focused on artificial laboratory environments, incongruent with those prevailing in the wild. The discovery of the remarkable spatial selectivity of grid cells, evident in such laboratory set-ups, has raised the issue of what grid cell firing patterns would look like, in an ecological setting.
More recent experiments have pointed at increased irregularity and plasticity of grid activity patterns, whether due to large environments [20], non-standard shapes [23], modulation by local cues [24], boundary changes [48] or the presence of goals [25]. These observations, however, were largely framed as deviations or perturbations from the ideal notion of a regular tessellation of the environment, exhibiting long-range order ad infinitum, which had been evoked by the early findings.
The possibility that long-range order may not apply at all in an ecological setting was raised initially by looking at the activation patterns that emerge, with the adaptation model, in 3D [27] or on curved 2D surfaces [37,38], and is confirmed in a long-running experimental study in bats [26]. While bats fly, rats are burrowing animals, and natural burrows are much more complicate structures than open arenas or other schematic laboratory settings.
In the present study, we have modeled the burrow environment based on the detailed quantitative descriptions by John B. Calhoun, and we have let a virtual rat randomly explore it; then using our self-organizing adaptation model we have observed grid pattern formation in model units. Grid units can attain stable representation of the whole environment, if acquiring it slowly, but less explored sub environments tend to be represented by blurred maps. The limited size of the chambers in natural burrows only allows grid units to express very few fields, challenging the very idea that grid cells may show long-range order outside the lab. One may wonder whether the reports of a six-fold symmetry in imaging data from humans, a putative signature of an underlying grid-like representation, might be due to large virtual arenas used in those studies [31]. It comes as no surprise, then, that the characteristic signature was not observed in the limited and non-flat vowel space [49], although of course there may be many other reasons for a null result.
The continuity of spatial representations depends on the exploration. In [50], with a multi-compartment environment, real grid cells firing patterns could establish a single, continuous representation that spanned both compartments after prolonged experience. In natural burrows however, tunnels are so narrow that they are effectively 1D structures, and as such they necessarily break any potential continuity in the representation of the chambers. What is left, at least when studied with the adaptation model, is effectively a representation in terms of disjoint spatial fragments, which coincide, in our modeling framework, with the better explored chambers.
The fragmentary nature of these spatial representations finds expression also at the level of neural populations. Compared with simulations in regular environments (in the square box, but also to some extent in the large hemi-sphere which can accommodate 6 fields), grid units simulated in burrows have more of a tendency to cluster in groups with similar fields. This might be part of the drive that leads to the observed modularity of grid activity [36,51].
In flat environments recurrent connections promote regularity (and can align out-of-spatial-phase patterns). In simple environments with constant non-zero curvature, recurrent connections promote irregularity [39]. In real-life environments, it is likely that they cause both irregularity and clustering into groups of units with similar selectivity, running against the principle of representing space evenly, expressed in the most idealized conceptual model by the notion of a continuous attractor.
Experiments in artificial laboratory settings, which utilize well-controlled and simplified paradigms, thus gave us the opportunity to admire a most impressive feat of the rodent nervous system, its ability to approximate a regular tiling of an infinite plane. While an exhilarating experience, this may have distracted us from understanding the characteristics of grid cells in ecological conditions, and possibly their function in an evolutionary perspective.