Taskdependent optimal representations for cerebellar learning
Abstract
The cerebellar granule cell layer has inspired numerous theoretical models of neural representations that support learned behaviors, beginning with the work of Marr and Albus. In these models, granule cells form a sparse, combinatorial encoding of diverse sensorimotor inputs. Such sparse representations are optimal for learning to discriminate random stimuli. However, recent observations of dense, lowdimensional activity across granule cells have called into question the role of sparse coding in these neurons. Here, we generalize theories of cerebellar learning to determine the optimal granule cell representation for tasks beyond random stimulus discrimination, including continuous inputoutput transformations as required for smooth motor control. We show that for such tasks, the optimal granule cell representation is substantially denser than predicted by classical theories. Our results provide a general theory of learning in cerebellumlike systems and suggest that optimal cerebellar representations are taskdependent.
Editor's evaluation
Models of cerebellar function and the coding of inputs in the cerebellum often assume that random stimuli are a reasonable standin for real stimuli. However, the important contribution of this paper is that conclusions about optimality and sparseness in these models do not generalize to potentially more realistic sets of stimuli, for example, those drawn from a lowdimensional manifold. The mathematical analyses in the paper are convincing and possible limitations, including the abstraction from biological details, are well discussed.
https://doi.org/10.7554/eLife.82914.sa0Introduction
A striking property of cerebellar anatomy is the vast expansion in number of granule cells compared to the mossy fibers that innervate them (Eccles et al., 1967). This anatomical feature has led to the proposal that the function of the granule cell layer is to produce a highdimensional representation of lowerdimensional mossy fiber activity (Marr, 1969; Albus, 1971; CaycoGajic and Silver, 2019). In such theories, granule cells integrate information from multiple mossy fibers and respond in a nonlinear manner to different input combinations. Detailed theoretical analysis has argued that anatomical parameters such as the ratio of granule cells to mossy fibers (Babadi and Sompolinsky, 2014), the number of inputs received by individual granule cells (LitwinKumar et al., 2017; CaycoGajic et al., 2017), and the distribution of granulecelltoPurkinjecell synaptic weights Brunel et al., 2004 have quantitative values that maximize the dimension of the granule cell representation and learning capacity. Sparse activity, which increases dimension, is also cited as a key property of this representation (Marr, 1969; Albus, 1971; Babadi and Sompolinsky, 2014; but see Spanne and Jörntell, 2015). Sparsity affects both learning speed (CaycoGajic et al., 2017) and generalization, the ability to predict correct labels for previously unseen inputs (Barak et al., 2013; Babadi and Sompolinsky, 2014; LitwinKumar et al., 2017).
Theories that study the effects of dimension on learning typically focus on the ability of a system to perform categorization tasks with random, highdimensional inputs (Barak et al., 2013; Babadi and Sompolinsky, 2014; LitwinKumar et al., 2017; CaycoGajic et al., 2017). In this case, increasing the dimension of the granule cell representation increases the number of inputs that can be discriminated. However, cerebellar circuits participate in diverse behaviors, including dexterous movements, interlimb coordination, the formation of internal models, and cognitive behaviors (Ito and Itō, 1984; Wolpert et al., 1998; Strick et al., 2009). Cerebellumlike circuits, such as the insect mushroom body and the electrosensory system of electric fish, support other functions such as associative learning (Modi et al., 2020) and the cancellation of selfgenerated sensory signals (Kennedy et al., 2014), respectively. This diversity raises the question of whether learning highdimensional categorization tasks is a sufficient framework for probing the function of granule cells and their analogs.
Several recent studies have reported dense activity in cerebellar granule cells in response to sensory stimulation or during motor control tasks (Jörntell and Ekerot, 2006; Knogler et al., 2017; Wagner et al., 2017; Giovannucci et al., 2017; Badura and De Zeeuw, 2017; Wagner et al., 2019), at odds with classical theories (Marr, 1969; Albus, 1971). Moreover, there is evidence that granule cell firing rates differ across cerebellar regions (Heath et al., 2014; Witter and De Zeeuw, 2015). In contrast to this reported dense activity in cerebellar granule cells, odor responses in Kenyon cells, the analogs of granule cells in the Drosophila mushroom body, are sparse, with 5–10% of neurons responding to odor stimulation (Turner et al., 2008; Honegger et al., 2011; Lin et al., 2014).
We propose that these differences can be explained by the capacity of representations with different levels of sparsity to support learning of different tasks. We show that the optimal level of sparsity depends on the structure of the inputoutput relationship of a task. When learning inputoutput mappings for motor control tasks, the optimal granule cell representation is much denser than predicted by previous analyses. To explain this result, we develop an analytic theory that predicts the performance of cerebellumlike circuits for arbitrary learning tasks. The theory describes how properties of cerebellar architecture and activity control these networks’ inductive bias: the tendency of a network toward learning particular types of inputoutput mappings (Sollich, 1998; Jacot et al., 2018; Bordelon et al., 2020; Canatar et al., 2021b; Simon et al., 2021). The theory shows that inductive bias, rather than the dimension of the representation alone, is necessary to explain learning performance across tasks. It also suggests that cerebellar regions specialized for different functions may adjust the sparsity of their granule cell representations depending on the task.
Results
In our model, a granule cell layer of $M$ neurons receives connections from a random subset of $N$ mossy fiber inputs. Because $M\gg N$ in the cerebellar cortex and cerebellumlike structures (approximately $M=200,000$ and $N=7,000$ for the neurons presynaptic to a single Purkinje cell in the cat brain; Eccles et al., 1967), we refer to the granule cell layer as the expansion layer and the mossy fiber layer as the input layer (Figure 1A and B).
A typical assumption in computational theories of the cerebellar cortex is that inputs are randomly distributed in a highdimensional space (Marr, 1969; Albus, 1971; Brunel et al., 2004; Babadi and Sompolinsky, 2014; Billings et al., 2014; LitwinKumar et al., 2017). While this may be a reasonable simplification in some cases, many tasks, including cerebellumdependent tasks, are likely bestdescribed as being encoded by a lowdimensional set of variables. For example, the cerebellum is often hypothesized to learn a forward model for motor control (Wolpert et al., 1998), which uses sensory input and motor efference to predict an effector’s future state. Mossy fiber activity recorded in monkeys correlates with position and velocity during natural movement (van Kan et al., 1993). Sources of motor efference copies include motor cortex, whose population activity lies on a lowdimensional manifold (Wagner et al., 2019; Huang et al., 2013; Churchland et al., 2010; Yu et al., 2009). We begin by modeling the low dimensionality of inputs and later consider more specific tasks.
We therefore assume that the inputs to our model lie on a $D$dimensional subspace embedded in the $N$dimensional input space, where $D$ is typically much smaller than $N$ (Figure 1B). We refer to this subspace as the ‘task subspace’ (Figure 1C). A location in this subspace is described by a $D$ dimensional vector $\mathbf{x}$, while the corresponding input layer activity is given by $\mathbf{n}=\mathbf{A}\mathbf{x}$, with $\mathbf{A}$ an $N\times D$ matrix describing the embedding of the task variables in the input layer. An $M\times D$ effective weight matrix $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}}=\mathbf{J}\mathbf{A}{\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}$, which describes the selectivity of expansion layer neurons to task variables, is determined by $\mathbf{A}$ and the $M\times N$ inputtoexpansionlayer synaptic weight matrix $\mathbf{J}$. The activity of neurons in the expansion layer is given by:
where $\varphi $ is a rectified linear activation function $\varphi (u)=\mathrm{max}(u,0)$ applied elementwise. Our results also hold for other thresholdpolynomial activation functions. The scalar threshold $\theta $ is shared across neurons and controls the coding level, which we denote by $f$, defined as the average fraction of neurons in the expansion layer that are active. We show results for $f<0.5$, since extremely dense codes are rarely observed in experiments (Olshausen and Field, 2004; see Discussion). For analytical tractability, we begin with the case where the entries of $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}$ are independent Gaussian random variables, as in previous theories (Rigotti et al., 2013; Barak et al., 2013; Babadi and Sompolinsky, 2014). This holds when the columns of $\mathbf{A}$ are orthonormal (ensuring that the embedding of the task variables in the input layer preserves their geometry) and the entries of $\mathbf{J}$ are independent and Gaussian. Later, we will show that networks with more realistic connectivity behave similarly to this case.
Optimal coding level is taskdependent
In our model, a learning task is defined by a mapping from task variables $\mathbf{x}$ to an output $f(\mathbf{x})$, representing a target change in activity of a readout neuron, for example a Purkinje cell. The limited scope of this definition implies our results should not strongly depend on the influence of the readout neuron on downstream circuits. The readout adjusts its incoming synaptic weights from the expansion layer to better approximate this target output. For example, for an associative learning task in which sensory stimuli are classified into categories such as appetitive or aversive, the task may be represented as a mapping from inputs to two discrete firing rates corresponding to the readout’s response to stimuli of each category (Figure 2A). In contrast, for a forward model, in which the consequences of motor commands are computed using a model of movement dynamics, an input encoding the current sensorimotor state is mapped to a continuous output representing the readout neuron’s tuning to a predicted sensory variable (Figure 2B).
To examine how properties of the expansion layer representation influence learning performance across tasks, we designed two families of tasks: one modeling categorization of random stimuli, which is often used to study the performance of expanded neural representations (Rigotti et al., 2013; Barak et al., 2013; Babadi and Sompolinsky, 2014; LitwinKumar et al., 2017; CaycoGajic et al., 2017), and the other modeling learning of a continuously varying output. The former we refer to as a ‘random categorization task’ and is parameterized by the number of input patterntocategory associations $P$ learned during training (Figure 2C). During the training phase, the network learns to associate random input patterns $\mathbf{x}}^{\mu}\in {\mathbb{R}}^{D$ for $\mu =1,\mathrm{\dots},P$ with random binary categories ${y}^{\mu}=\pm 1$. The elements of $\mathbf{x}}^{\mu$ are drawn i.i.d. from a normal distribution with mean 0 and variance $1/D$. We refer to $\mathbf{x}}^{\mu$ as ‘training patterns’. To assess the network’s generalization performance, it is presented with ‘test patterns’ generated by adding noise (parameterized by a noise magnitude $\u03f5$; see Methods) to the training patterns. Tasks with continuous outputs (Figure 2D) are parameterized by a length scale that determines how quickly the output changes as a function of the input (specifically, inputoutput functions are drawn from a Gaussian process with length scale $\gamma $ for variations in $f(\mathbf{x})$ as a function of $\mathbf{x}$; see Methods). In this case, both training and test patterns are drawn uniformly on the unit sphere. Later, we will also consider tasks implemented by specific cerebellumlike systems. See Table 1 for a summary of parameters throughout this study.
We trained the readout to approximate the target output for training patterns and generalize to unseen test patterns. The network’s prediction is $\hat{f}(\mathbf{x})=\mathbf{w}\cdot \mathbf{h}(\mathbf{x})$ for tasks with continuous outputs, or $\hat{f}(\mathbf{x})=\mathrm{s}\mathrm{i}\mathrm{g}\mathrm{n}(\mathbf{w}\cdot \mathbf{h}(\mathbf{x}))$ for categorization tasks, where $\mathbf{w}$ are the synaptic weights of the readout from the expansion layer. These weights were set using least squares regression. Performance was measured as the fraction of incorrect predictions for categorization tasks, or relative mean squared error for tasks with continuous targets: $\mathrm{E}\mathrm{r}\mathrm{r}\mathrm{o}\mathrm{r}=\frac{\mathbb{E}[(f(\mathbf{x})\hat{f}(\mathbf{x}){)}^{2}]}{\mathbb{E}[f(\mathbf{x}{)}^{2}]}$, where the expectation is across test patterns.
We began by examining the dependence of learning performance on the coding level of the expansion layer. For random categorization tasks, performance is maximized at low coding levels (Figure 2E), consistent with previous results (Barak et al., 2013; Babadi and Sompolinsky, 2014). The optimal coding level remains below 0.1 in the model, regardless of the number of associations $P$, the level of input noise, and the dimension $D$ (Figure 2—figure supplement 1). For continuously varying outputs, the dependence is qualitatively different (Figure 2F). The optimal coding level depends strongly on the length scale, with learning performance for slowly varying functions optimized at much higher coding levels than quickly varying functions. This dependence holds for different choices of thresholdnonlinear functions (Figure 2—figure supplement 2) or input dimension (Figure 2—figure supplement 3) and is most pronounced when the number of training patterns is limited (Figure 2—figure supplement 4). Our observations are at odds with previous theories of the role of sparse granule cell representations (Marr, 1969; Albus, 1971; Babadi and Sompolinsky, 2014; Billings et al., 2014) and show that sparse activity does not always optimize performance for this broader set of tasks.
Geometry of the expansion layer representation
To determine how the optimal coding level depends on the task, we begin by quantifying how the expansion layer transforms the geometry of the task subspace. Later we will address how this transformation affects the ability of the network to learn a target. For ease of analysis, we will assume for now that inputs are normalized, $\Vert \mathbf{x}\Vert =1$, so that they lie on the surface of a sphere in $D$ dimensions. The set of neurons in the expansion layer activated by an input $\mathbf{x}$ are those neurons $i$ for which the alignment of their effective weights with the input, $\mathbf{J}}_{i}^{\mathrm{e}\mathrm{f}\mathrm{f}}\cdot \mathbf{x$, exceeds the activation threshold $\theta $ (Equation 1; Figure 3A). Increasing $\theta $ reduces the size of this set of neurons and hence reduces the coding level.
Different inputs activate different sets of neurons, and more similar inputs activate sets with greater overlap. As the coding level is reduced, this overlap is also reduced (Figure 3B). In fact, this reduction in overlap is greater than the reduction in number of neurons that respond to either of the individual inputs, reflecting the fact that representations with low coding levels perform ‘pattern separation’ (Figure 3B, compare purple and red or blue regions).
This effect is summarized by the ‘kernel’ of the network (Schölkopf and Smola, 2002; Rahimi and Recht, 2007), which measures overlap of representations in the expansion layer as a function of the task variables:
Equations 1 and 2 show that the threshold $\theta $, which determines the coding level, influences the kernel through its effect on the expansion layer activity $\mathbf{h}(\mathbf{x})$. When inputs are normalized and the effective weights are Gaussian, we compute a semianalytic expression for the kernel of the expansion layer in the limit of a large expansion ($M\to \mathrm{\infty}$; see Appendix). In this case, the kernel depends only on the overlap of the task variables, $K(\mathbf{x},{\mathbf{x}}^{\mathrm{\prime}})=K(\mathbf{x}\cdot {\mathbf{x}}^{\mathrm{\prime}})$. Plotting the kernel for different choices of coding level demonstrates that representations with lower coding levels exhibit greater pattern separation (Figure 3C; Babadi and Sompolinsky, 2014). This is consistent with the observation that decreasing the coding level increases the dimension of the representation (Figure 3D).
Frequency decomposition of kernel and task explains optimal coding level
We now relate the geometry of the expansion layer representation to performance across the tasks we have considered. Previous studies focused on highdimensional, random categorization tasks in which inputs belong to a small number of wellseparated clusters whose centers are random uncorrelated patterns. Generalization is assessed by adding noise to previously observed training patterns (Babadi and Sompolinsky, 2014; LitwinKumar et al., 2017; Figure 4A). In this case, performance depends only on overlaps at two spatial scales: the overlap between training patterns belonging to different clusters, which is small, and the overlap between training and test patterns belonging to the same cluster, which is large (Figure 4B). For such tasks, the kernel evaluated near these two values—specifically, the behavior of $K(\mathbf{x}\cdot {\mathbf{x}}^{\mathrm{\prime}})$ near $\mathbf{x}\cdot {\mathbf{x}}^{\mathrm{\prime}}=0$ and $\mathbf{x}\cdot {\mathbf{x}}^{\mathrm{\prime}}=1\mathrm{\Delta}$, where $\mathrm{\Delta}$ is a measure of withincluster noise—fully determines generalization performance (Figure 4C; see Appendix). Sparse expansion layer representations reduce the overlap of patterns belonging to different clusters, increasing dimension and generalization performance (Figure 3D, Figure 2E).
We study tasks where training patterns used for learning and test patterns used to assess generalization are both drawn according to a distribution over a lowdimensional space of task variables. While the mean overlap between pairs of random patterns remains zero regardless of dimension, fluctuations around the mean increase when the space is low dimensional, leading to a broader distribution of overlaps (Figure 4B). In this case, generalization performance depends on values of the kernel function evaluated across this entire range of overlaps. Methods from the theory of kernel regression (Sollich, 1998; Jacot et al., 2018; Bordelon et al., 2020; Canatar et al., 2021b; Simon et al., 2021) capture these effects by quantifying a network’s performance on a learning task through a decomposition of the target function into a set of basis functions (Figure 4D). Performance is assessed by summing the contribution of each mode in this decomposition to generalization error.
The decomposition expresses the kernel as a sum of eigenfunctions weighted by eigenvalues, $K(\mathbf{x},{\mathbf{x}}^{\mathrm{\prime}})=\sum _{\alpha}{\lambda}_{\alpha}{\psi}_{\alpha}(\mathbf{x}){\psi}_{\alpha}({\mathbf{x}}^{\mathrm{\prime}})$. The eigenfunctions are determined by the network architecture and the distribution of inputs. As we show below, the eigenvalues ${\lambda}_{\alpha}$ determine the ease with which each corresponding eigenfunction ${\psi}_{\alpha}(\mathbf{x})$—one element of the basis function decomposition—is learned by the network. Under our present assumptions of Gaussian effective weights and uniformly distributed, normalized input patterns, the eigenfunctions are the spherical harmonic functions. These functions are ordered by increasing frequency, with higher frequencies corresponding to functions that vary more quickly as a function of the task variables. Spherical harmonics are defined for any input dimension; for example, in two dimensions they are the Fourier modes. We find that coding level substantially changes the frequency dependence of the eigenvalues associated with these eigenfunctions (Figure 4E). Higher coding levels increase the relative magnitude of the low frequency eigenvalues compared to highfrequency eigenvalues. As we will show, this results in a different inductive bias for networks with different coding levels.
To calculate learning performance for an arbitrary task, we decompose the target function in the same basis as that of the kernel:
The coefficient ${c}_{\alpha}$ quantifies the weight of mode $\alpha $ in the decomposition. For the Gaussian process targets, we have considered, increasing length scale corresponds to a greater relative contribution of low versus high frequency modes (Figure 4F). Using these coefficients and the eigenvalues (Figure 4E), we obtain an analytical prediction of the meansquared generalization error (‘Error’) for learning any given task (Figure 4G; see Methods):
where C_{1} and C_{2} do not depend on $\alpha $ (Canatar et al., 2021b; Simon et al., 2021; see Methods). Equation 4 illustrates that for equal values of ${c}_{\alpha}$, modes with greater ${\lambda}_{\alpha}$ contribute less to the generalization error.
Our theory reveals that the optima observed in Figure 2F are a consequence of the difference in eigenvalues of networks with different coding levels. This reflects an inductive bias (Sollich, 1998; Jacot et al., 2018; Bordelon et al., 2020; Canatar et al., 2021b; Simon et al., 2021) of networks with low and high coding levels toward the learning of high and low frequency functions, respectively (Figure 4E, Figure 4—figure supplement 1). Thus, the coding level’s effect on a network’s inductive bias, rather than dimension alone, determines learning performance. Previous studies that focused only on random categorization tasks did not observe this dependence, since errors in such tasks are dominated by the learning of high frequency components, for which sparse activity is optimal (Figure 4—figure supplement 2).
Performance of sparsely connected expansions
To simplify our analysis, we have so far assumed full connectivity between input and expansion layers without a constraint on excitatory or inhibitory synaptic weights. In particular, we have assumed that the effective weight matrix $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}$ contains independent Gaussian entries (Figure 5A, top). However, synaptic connections between mossy fibers and granule cells are sparse and excitatory (Sargent et al., 2005), with a typical indegree of $K=4$ mossy fibers per granule cell (Figure 5A, bottom). We therefore analyzed the performance of model networks with more realistic connectivity. Surprisingly, when $\mathbf{J}$ is sparse and nonnegative, both overall generalization performance and the taskdependence of optimal coding level remain unchanged (Figure 5B).
To understand this result, we examined how $\mathbf{J}$ and $\mathbf{A}$ shape the statistics of the effective weights onto the expansion layer neurons $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}$. A desirable property of the expansion layer representation is that these effective weights sample the space of task variables uniformly (Figure 3A), increasing the heterogeneity of tuning of expansion layer neurons (LitwinKumar et al., 2017). This occurs when $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}$ is a matrix of independent random Gaussian entries. If the columns of $\mathbf{A}$ are orthornormal and $\mathbf{J}$ is fullyconnected with independent Gaussian entries, $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}$ has this uniform sampling property.
However, when $\mathbf{J}$ is sparse and nonnegative, expansion layer neurons that share connections from the same input layer neurons receive correlated input currents. When $N$ is small and $\mathbf{A}$ is random, fluctuations in $\mathbf{A}$ lead to biases in the input layer’s sampling of task variables which are inherited by the expansion layer. We quantify this by computing the distribution of correlations between the effective weights for pairs of expansion layer neurons, $\mathbf{C}\mathbf{o}\mathbf{r}\mathbf{r}\left({\mathbf{J}}_{i}^{\mathrm{e}\mathrm{f}\mathrm{f}},{\mathbf{J}}_{j}^{\mathrm{e}\mathrm{f}\mathrm{f}}\right)$. This distribution indeed deviates from uniform sampling when $N$ is small (Figure 5C). However, even when $N$ is moderately large (but much less than $M$), only small deviations from uniform sampling of task variables occur for low dimensional tasks as long as $D<K\ll N$ (see Appendix). In contrast, for highdimensional tasks ($D\sim N$), $K\ll D$ is sufficient, in agreement with previous findings (LitwinKumar et al., 2017). For realistic cerebellar parameters ($N=7,000$ and $K=4$), the distribution is almost indistinguishable from that corresponding to uniform sampling (Figure 5C), consistent with the similar learning performance of these two cases (Figure 5B).
In the above analysis, an important assumption is that $\mathbf{A}$ is dense and random, so that the input layer forms a distributed representation in which each input layer neuron responds to a random combination of task variables (Figure 5D, top). If, on the other hand, the input layer forms a clustered representation containing groups of neurons that each encode a single task variable (Figure 5D, bottom), we may expect different results. Indeed, with a clustered representation, sparse connectivity dramatically reduces performance (Figure 5E). This is because the distribution of $\mathbf{C}\mathbf{o}\mathbf{r}\mathbf{r}\left({\mathbf{J}}_{i}^{\mathrm{e}\mathrm{f}\mathrm{f}},{\mathbf{J}}_{j}^{\mathrm{e}\mathrm{f}\mathrm{f}}\right)$ deviates substantially from that corresponding to uniform sampling (Figure 5F), even as $N\to \mathrm{\infty}$ (see Appendix). Specifically, increasing $N$ does not reduce the probability of two expansion layer neurons being connected to input layer neurons that encode the same task variables and therefore receiving highly correlated currents. As a result, expansion layer neurons do not sample task variables uniformly and performance is dramatically reduced.
Our results show that networks with small $K$, moderately large $N$, and a distributed input layer representation approach the performance of networks that sample task variables uniformly. This equivalence validates the applicability of our theory to these more realistic networks. It also argues for the importance of distributed sensorimotor representations in the corticocerebellar pathway, consistent with the distributed nature of representations in motor cortex (Shenoy et al., 2013; Muscinelli et al., 2023).
Optimal cerebellar architecture is consistent across tasks
A history of theoretical modeling has shown a remarkable correspondence between anatomical properties of the cerebellar cortex and model parameters optimal for learning. These include the indegree $K$ of granule cells (Marr, 1969; LitwinKumar et al., 2017; CaycoGajic et al., 2017), the expansion ratio of the granule cells to the mossy fibers $M/N$(Babadi and Sompolinsky, 2014; LitwinKumar et al., 2017), and the distribution of synaptic weights from granule cells to Purkinje cells (Brunel et al., 2004; Clopath et al., 2012; Clopath and Brunel, 2013). In these studies, model performance was assessed using random categorization tasks. We have shown that optimal coding level is dependent on the task being learned, raising the question of whether optimal values of these architectural parameters are also taskdependent.
Sparse connectivity ($K$=4, consistent with the typical indegree of cerebellar granule cells) has been shown to optimize learning performance in cerebellar cortex models (LitwinKumar et al., 2017; CaycoGajic et al., 2017). We examined the performance of networks with different granule cell indegrees learning Gaussian process targets. The optimal indegree is small for all the tasks we consider, suggesting that sparse connectivity is sufficient for high performance across a range of tasks (Figure 6A). This is consistent with the previous observation that the performance of a sparsely connected network approaches that of a fully connected network (Figure 5B).
Previous studies also showed that the expansion ratio from mossy fibers to granule cells $M/N$ controls the dimension of the granule cell representation (Babadi and Sompolinsky, 2014; LitwinKumar et al., 2017). The dimension increases with expansion ratio but saturates as expansion ratio approaches the anatomical value ($M/N\approx 30$ when $f\approx 0.1$ for the inputs presynaptic to an individual Purkinje cell). These studies assumed that mossy fiber activity is uncorrelated ($D=N$) rather than lowdimensional ($D<N$). This raises the question of whether a large expansion is beneficial when $D$ is small. We find that when the number of training patterns $P$ is sufficiently large, performance still improves as $M/N$ approaches its anatomical value, showing that Purkinje cells can exploit their large number of presynaptic inputs even in the case of lowdimensional activity (Figure 6B).
Brunel et al., 2004 showed that the distribution of granulecelltoPurkinje cell synaptic weights is consistent with the distribution that maximizes the number of random binary inputoutput mappings stored. This distribution exhibits a substantial fraction of silent synapses, consistent with experiments. These results also hold for analog inputs and outputs (Clopath and Brunel, 2013) and for certain forms of correlations among binary inputs and outputs (Clopath et al., 2012). However, the case we consider, where targets are a smoothly varying function of task variables, has not been explored. We observe a similar weight distribution for these tasks (Figure 6C), with the fraction of silent synapses remaining high across coding levels (Figure 6D). The fraction of silent synapses is lower for networks learning Gaussian process targets than those learning random categorization tasks, consistent with the capacity of a given network for learning such targets being larger (Clopath et al., 2012).
Although optimal coding level is taskdependent, these analyses suggest that optimal architectural parameters are largely taskindependent. Whereas coding level tunes the inductive bias of the network to favor the learning of specific tasks, these architectural parameters control properties of the representation that improve performance across tasks. In particular, sparse connectivity and a large expansion support uniform sampling of lowdimensional task variables (consistent with Figure 5C), while a large fraction of silent synapses is a consequence of a readout that maximizes learning performance (Brunel et al., 2004).
Modeling specific behaviors dependent on cerebellumlike structures
So far, we have considered analytically tractable families of tasks with parameterized inputoutput functions. Next, we extend our results to more realistic tasks constrained by the functions of specific cerebellumlike systems, which include both highly structured, continuous inputoutput mappings and random categorization tasks.
To model the cerebellum’s role in predicting the consequences of motor commands (Wolpert et al., 1998), we examined the optimal coding level for learning the dynamics of a twojoint arm (Fagg et al., 1997). Given an initial state, the network predicts the change in the future position of the arm (Figure 7A). Performance is optimized at substantially higher coding levels than for random categorization tasks, consistent with our previous results for continuous inputoutput mappings (Figure 2E and F).
The mushroom body, a cerebellumlike structure in insects, is required for learning of associations between odors and appetitive or aversive valence (Modi et al., 2020). This behavior can be represented as a mapping from random representations of odors in the input layer to binary category labels (Figure 7B). The optimal coding level in a model with parameters consistent with the Drosophila mushroom body is less than 0.1, consistent with our previous results for random categorization tasks (Figure 2E) and the sparse odorevoked responses in Drosophila Kenyon cells (Turner et al., 2008; Honegger et al., 2011; Lin et al., 2014).
The prediction and cancellation of selfgenerated sensory feedback has been studied extensively in mormyrid weakly electric fish and depends on the electrosensory lateral line lobe (ELL), a cerebellumlike structure (Bell et al., 2008). Granule cells in the ELL provide a temporal basis for generating negative images that are used to cancel selfgenerated feedback (Figure 7C). We extended a detailed model of granule cells and their inputs (Kennedy et al., 2014) to study the influence of coding level on the effectiveness of this basis. The performance of this model saturated at relatively high coding levels, and notably the coding level corresponding to biophysical parameters estimated from data coincided with the value at which further increases in performance were modest. This observation suggests that coding level is also optimized for task performance in this system.
A canonical function of the mammalian cerebellum is the adjustment of the vestibuloocular reflex (VOR), in which motion of the head is detected and triggers compensatory ocular motion in the opposite direction. During VOR learning, Purkinje cells are tuned to head velocity, and their tuning curves are described as piecewise linear functions (Lisberger et al., 1994; Figure 7D). Although in vivo population recordings of granule cells during VOR adaptation are not, to our knowledge, available for comparison, our model predicts that performance for learning such tuning curves is high across a range of coding levels and shows that sparse codes are sufficient (although not necessary) for such tasks (Figure 7D).
These results predict diverse coding levels across different behaviors dependent on cerebellumlike structures. The odor categorization and VOR tasks both have inputoutput mappings that exhibit sharp nonlinearities and can be efficiently learned using sparse representations. In contrast, the forward modeling and feedback cancellation tasks have smooth inputoutput mappings and exhibit denser optima. These observations are consistent with our previous finding that more structured tasks favor denser coding levels than do random categorization tasks (Figure 2E and F).
Discussion
We have shown that the optimal granule cell coding level depends on the task being learned. While sparse representations are suitable for learning to categorize inputs into random categories, as predicted by classic theories, tasks involving structured inputoutput mappings benefit from denser representations (Figure 2). This reconciles such theories with the observation of dense granule cell activation during movement (Knogler et al., 2017; Wagner et al., 2017; Giovannucci et al., 2017; Badura and De Zeeuw, 2017; Wagner et al., 2019). We also show that, in contrast to the taskdependence of optimal coding level, optimal anatomical values of granule cell and Purkinje cell connectivity are largely taskindependent (Figure 6). This distinction suggests that a stereotyped cerebellar architecture may support diverse representations optimized for a variety of learning tasks.
Relationship to previous theories
Previous studies assessed the learning performance of cerebellumlike systems with a model Purkinje cell that associates random patterns of mossy fiber activity with one of two randomly assigned categories (Marr, 1969; Albus, 1971; Brunel et al., 2004; Babadi and Sompolinsky, 2014; LitwinKumar et al., 2017; CaycoGajic et al., 2017), a common benchmark for artificial learning systems (Gerace et al., 2022). In this case, a low coding level increases the dimension of the granule cell representation, permitting more associations to be stored and improving generalization to previously unseen inputs. The optimal coding level is low but not arbitrarily low, as extremely sparse representations introduce noise that hinders generalization (Barak et al., 2013; Babadi and Sompolinsky, 2014).
To examine a broader family of tasks, our learning problems extend previous studies in several ways. First, we consider inputs that may be constrained to a lowdimensional task subspace. Second, we consider inputoutput mappings beyond random categorization tasks. Finally, we assess generalization error for arbitrary locations on the task subspace, rather than only for noisy instances of previously presented inputs. As we have shown, these considerations require a complete analysis of the inductive bias of cerebellumlike networks (Figure 4). Our analysis generalizes previous approaches (Barak et al., 2013; Babadi and Sompolinsky, 2014; LitwinKumar et al., 2017) that focused on dimension and noise alone. In particular, both dimension and noise for random patterns can be directly calculated from the kernel function (Figure 3C; see Appendix).
Our theory builds upon techniques that been developed for understanding properties of kernel regression (Sollich, 1998; Jacot et al., 2018; Bordelon et al., 2020; Canatar et al., 2021b; Simon et al., 2021). Kernel approximations of wide neural networks are a major area of current research providing analytically tractable theories (Rahimi and Recht, 2007; Jacot et al., 2018; Chizat et al., 2018). Prior studies have analyzed kernels corresponding to networks with zero (Cho and Saul, 2010) or meanzero Gaussian thresholds (Basri et al., 2019; Jacot et al., 2018), which in both cases produce networks with a coding level of 0.5. Ours is the first kernel study of the effects of nonzero average thresholds. Our full characterization of the eigenvalue spectra and their decay rates as a function of the threshold extends previous work (Bach, 2017; Bietti and Bach, 2021). Furthermore, artificial neural network studies typically assume either fullyconnected or convolutional layers, yet pruning connections after training barely degrades performance (Han et al., 2015; Zhang et al., 2018). Our results support the idea that sparsely connected networks may behave like dense ones if the representation is distributed (Figure 5), providing insight into the regimes in which pruning preserves performance.
Other studies have considered tasks with smooth inputoutput mappings and lowdimensional inputs, finding that heterogeneous Golgi cell inhibition can improve performance by diversifying individual granule cell thresholds (Spanne and Jörntell, 2013). Extending our model to include heterogeneous thresholds is an interesting direction for future work. Another proposal states that dense coding may improve generalization (Spanne and Jörntell, 2015). Our theory reveals that whether or not dense coding is beneficial depends on the task.
Assumptions and extensions
We have made several assumptions in our model for the sake of analytical tractability. When comparing the inductive biases of networks with different coding levels, our theory assumes that inputs are normalized and distributed uniformly in a linear subspace of the input layer activity. This allows us to decompose the target function into a basis in which we can directly compare eigenvalues, and hence learning performance, for different coding levels (Figure 4E–G). A similar analysis can be performed when inputs are not uniformly distributed, but in this case the basis is determined by an interplay between this distribution and the nonlinearity of expansion layer neurons, making the analysis more complex (see Appendix). We have also assumed that generalization is assessed for inputs drawn from the same distribution as used for learning. Recent and ongoing work on outofdistribution generalization may permit relaxations of this assumption (Shen et al., 2021; Canatar et al., 2021a).
When analyzing properties of the granule cell layer, our theory also assumes an infinitely wide expansion. When $P$ is small enough that performance is limited by number of samples, this assumption is appropriate, but finitesize corrections to our theory are an interesting direction for future work. We also have not explicitly modeled inhibitory input provided by Golgi cells, instead assuming such input can be modeled as a change in effective threshold, as in previous studies (Billings et al., 2014; CaycoGajic et al., 2017; LitwinKumar et al., 2017). This is appropriate when considering the dimension of the granule cell representation (LitwinKumar et al., 2017), but more work is needed to extend our model to the case of heterogeneous inhibition.
Another key assumption concerning the granule cells is that they sample mossy fiber inputs randomly, as is typically assumed in MarrAlbus models (Marr, 1969; Albus, 1971; LitwinKumar et al., 2017; CaycoGajic et al., 2017). Other studies instead argue that granule cells sample from mossy fibers with highly similar receptive fields (Garwicz et al., 1998; Brown and Bower, 2001; Jörntell and Ekerot, 2006) defined by the tuning of mossy fiber and climbing fiber inputs to cerebellar microzones (Apps et al., 2018). This has led to an alternative hypothesis that granule cells serve to relay similarly tuned mossy fiber inputs and enhance their signaltonoise ratio (Jörntell and Ekerot, 2006; Gilbert and Chris Miall, 2022) rather than to reencode inputs. Another hypothesis is that granule cells enable Purkinje cells to learn piecewise linear approximations of nonlinear functions (Spanne and Jörntell, 2013). However, several recent studies support the existence of heterogeneous connectivity and selectivity of granule cells to multiple distinct inputs at the local scale (Huang et al., 2013; Ishikawa et al., 2015). Furthermore, the deviation of the predicted dimension in models constrained by electronmicroscopy data as compared to randomly wired models is modest (Nguyen et al., 2023). Thus, topographically organized connectivity at the macroscopic scale may coexist with disordered connectivity at the local scale, allowing granule cells presynaptic to an individual Purkinje cell to sample heterogeneous combinations of the subset of sensorimotor signals relevant to the tasks that Purkinje cell participates in. Finally, we note that the optimality of dense codes for learning slowly varying tasks in our theory suggests that observations of a lack of mixing (Jörntell and Ekerot, 2002) for such tasks are compatible with MarrAlbus models, as in this case nonlinear mixing is not required.
We have quantified coding level by the fraction of neurons that are above firing threshold. We focused on coding levels $f<0.5$, as extremely dense codes are rarely found in experiments (Olshausen and Field, 2004), but our theory applies for $f>0.5$ as well. In general, representations with coding levels of $f$ and $1f$ perform similarly in our model due to the symmetry of most of their associated eigenvalues (Figure 4—figure supplement 1 and Appendix). Under the assumption that the energetic costs associated with neural activity are minimized, the $f<0.5$ region is likely the biologically plausible one. We also note that coding level is most easily defined when neurons are modeled as rate, rather than spiking units. To investigate the consistency of our results under a spiking code, we implemented a model in which granule cell spiking exhibits Poisson variability and quantify coding level as the fraction of neurons that have nonzero spike counts (Figure 7—figure supplement 1; Figure 7C). In general, increased spike count leads to improved performance as noise associated with spiking variability is reduced. Granule cells have been shown to exhibit reliable burst responses to mossy fiber stimulation (Chadderton et al., 2004), motivating models using deterministic responses or subPoisson spiking variability. However, further work is needed to quantitatively compare variability in model and experiment and to account for more complex biophysical properties of granule cells (Saarinen et al., 2008).
For the Purkinje cells, our model assumes that their responses to granule cell input can be modeled as an optimal linear readout. Our model therefore provides an upper bound to linear readout performance, a standard benchmark for the quality of a neural representation that does not require assumptions on the nature of climbing fibermediated plasticity, which is still debated. Electrophysiological studies have argued in favor of a linear approximation (Brunel et al., 2004). To improve the biological applicability of our model, we implemented an online climbing fibermediated learning rule and found that optimal coding levels are still taskdependent (Figure 7—figure supplement 2). We also note that although we model several timingdependent tasks (Figure 7), our learning rule does not exploit temporal information, and we assume that temporal dynamics of granule cell responses are largely inherited from mossy fibers. Integrating temporal information into our model is an interesting direction for future investigation.
Implications for cerebellar representations
Our results predict that qualitative differences in the coding levels of cerebellumlike systems, across brain regions or across species, reflect an optimization to distinct tasks (Figure 7). However, it is also possible that differences in coding level arise from other physiological differences between systems. In the Drosophila mushroom body, which is required for associative learning of odor categories, random and sparse subsets of Kenyon cells are activated in response to odor stimulation, consistent with our model (Figure 7B; Turner et al., 2008; Honegger et al., 2011; Lin et al., 2014). In a model of the electrosensory system of the electric fish, the inferred coding level of a model constrained by the properties of granule cells is similar to that which optimizes task performance (Figure 7C). Within the cerebellar cortex, heterogeneity in granule cell firing has been observed across cerebellar lobules, associated with both differences in intrinsic properties (Heath et al., 2014) and mossy fiber input (Witter and De Zeeuw, 2015). It would be interesting to correlate such physiological heterogeneity with heterogeneity in function across the cerebellum. Our model predicts that regions involved in behaviors with substantial lowdimensional structure, for example smooth motor control tasks, may exhibit higher coding levels than regions involved in categorization or discrimination of highdimensional stimuli.
Our model also raises the possibility that individual brain regions may exhibit different coding levels at different moments in time, depending on immediate behavioral or task demands. Multiple mechanisms could support the dynamic adjustment of coding level, including changes in mossy fiber input (Ozden et al., 2012), Golgi cell inhibition (Eccles et al., 1966; Palay and ChanPalay, 1974), retrograde signaling from Purkinje cells (Kreitzer and Regehr, 2001), or unsupervised plasticity of mossy fibertogranule cell synapses (Schweighofer et al., 2001). The predictions of our model are not dependent on which of these mechanisms are active. A recent study demonstrated that local synaptic inhibition by Golgi cells controls the spiking threshold and hence the population coding level of cerebellar granule cells in mice (Fleming et al., 2022). Further, the authors observed that granule cell responses to sensory stimuli are sparse when movementrelated selectivity is controlled for. This suggests that dense movementrelated activity and sparse sensoryevoked activity are not incompatible.
While our analysis makes clear qualitative predictions concerning comparisons between the optimal coding levels for different tasks, in some cases it is also possible to make quantitative predictions about the location of the optimum for a single task. Doing so requires determining the appropriate time interval over which to measure coding level, which depends on the integration time constant of the readout neuron. It also requires estimates of the firing rates and biophysical properties of the expansion layer neurons. In the electrosensory system, for which a wellcalibrated model exists and the learning objective is wellcharacterized (Kennedy et al., 2014), we found that the coding level estimated based on the data is similar to that which optimizes performance (Figure 7C).
If coding level is taskoptimized, our model predicts that manipulating coding level artificially will diminish performance. In the Drosophila mushroom body, disrupting feedback inhibition from the GABAergic anterior paired lateral neuron onto Kenyon cells increases coding level and impairs odor discrimination (Lin et al., 2014). A recent study demonstrated that blocking inhibition from Golgi cells onto granule cells results in denser granule cell population activity and impairs performance on an eyeblink conditioning task (Fleming et al., 2022). These examples demonstrate that increasing coding level during sensory discrimination tasks, for which sparse activity is optimal, impairs performance. Our theory predicts that decreasing coding level during a task for which dense activity is optimal, such as smooth motor control, would also impair performance.
While dense activity has been taken as evidence against theories of combinatorial coding in cerebellar granule cells (Knogler et al., 2017; Wagner et al., 2019), our theory suggests that the two are not incompatible. Instead, the coding level of cerebellumlike regions may be determined by behavioral demands and the nature of the input to granulelike layers (Muscinelli et al., 2023). Sparse coding has also been cited as a key property of sensory representations in the cerebral cortex (Olshausen and Field, 1996). However, recent population recordings show that such regions exhibit dense movementrelated activity (Musall et al., 2019), much like in cerebellum. While the theory presented in this study does not account for the highly structured recurrent interactions that characterize cerebrocortical regions, it is possible that these areas also operate using inductive biases that are shaped by coding level in a similar manner to our model.
Methods
Network model
The expansion layer activity is given by $\mathbf{h}=\varphi ({\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}}\mathbf{x}\theta ),$ where $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}}=\mathbf{J}\mathbf{A$ describes the selectivity of expansion layer neurons to task variables. For most simulations, $\mathbf{A}$ is an $N\times D$ matrix sampled with random, orthonormal columns and $\mathbf{J}$ is an $M\times N$ matrix with i.i.d. unit Gaussian entries. The nonlinearity $\varphi $ is a rectified linear activation function $\varphi (u)=\mathrm{max}(u,0)$ applied elementwise. The input layer activity $\mathbf{n}$ is given by $\mathbf{n}=\mathbf{A}\mathbf{x}.$
Sparsely connected networks
To model sparse excitatory connectivity, we generated a sparse matrix $\mathbf{J}}^{E$, where each row contains precisely $K$ nonzero elements at random locations. The nonzero elements are either identical and equal to 1 (homogeneous excitatory weights) or sampled from a unit truncated normal distribution (heterogeneous excitatory weights). To model global feedforward inhibition that balances excitation, $\mathbf{J}={\mathbf{J}}^{E}{\mathbf{J}}^{I}$, where $\mathbf{J}}^{I$ is a dense matrix with every element equal to $\frac{1}{MN}{\sum}_{ij}{J}_{ij}^{E}$.
For Figure 5B, Figure 6A and B, Figure 7B, sparsely connected networks were generated with homogeneous excitatory weights and global inhibition. For Figure 5E, the network with clustered representations was generated with homogeneous excitatory weights without global inhibition. For Figure 5C and F, networks were generated with heterogeneous excitatory weights and global inhibition.
Clustered representations
For clustered inputlayer representations, each input layer neuron encodes one task variable (that is, $\mathbf{A}$ is a block matrix, with nonoverlapping blocks of $N/D$ elements equal to 1 for each task variable). In this case, in order to obtain good performance, we found it necessary to fix the coding level for each input pattern, corresponding to winnertakeall inhibition across the expansion layer.
Dimension
The dimension of the expansion layer representation (Figure 3D) is given by Abbott et al., 2011; LitwinKumar et al., 2017:
where $\lambda}_{i$ are the eigenvalues of the covariance matrix ${C}_{ij}^{\mathbf{h}}=\mathrm{C}\mathrm{o}\mathrm{v}({h}_{i},{h}_{j})$ of expansion layer responses (not to be confused with ${\lambda}_{\alpha}$, the eigenvalues of the kernel operator). The covariance is computed by averaging over inputs $\mathbf{x}$.
Learning tasks
Random categorization task
In a random categorization task (Figure 2E, Figure 7B), the network learns to associate a random input pattern $\mathbf{x}}^{\mu}\in {\mathbb{R}}^{D$ for $\mu =1,\mathrm{\dots},P$ with a random binary category ${y}^{\mu}=\pm 1$. The elements of $\mathbf{x}}^{\mu$ are drawn i.i.d. from a normal distribution with mean 0 and variance $1/D$. Test patterns $\hat{\mathbf{x}}}^{\mu$ are generated by adding noise to the training patterns:
where $\mathit{\eta}\sim \mathcal{N}(0,\frac{1}{D}\mathbf{I})$. For Figure 2E, Figure 7B, and Figure 4—figure supplement 2, we set $\u03f5=0.1$.
Gaussian process tasks
To generate a family of tasks with continuously varying outputs (Figure 2D and F, Figure 4F and G, Figure 5B, and Figure 6), we sampled target functions from a Gaussian process (Rasmussen and Williams, 2006), $f(\mathbf{x})\sim \mathcal{G}\mathcal{P}(0,C)$, with covariance
where $\gamma $ determines the spatial scale of variations in $f(\mathbf{x})$. Training and test patterns are drawn uniformly on the unit sphere.
Learning of readout weights
With the exception of the ELL task and Figure 7—figure supplement 2, we performed unregularized least squares regression to determine the readout weights $\mathbf{w}$. For the ELL sensory cancellation task (Figure 7C), we used ${\mathrm{\ell}}^{2}$ regularization, a.k.a. ridge regression:
where ${\alpha}_{\mathrm{ridge}}$ is the regularization parameter. Solutions were found using Python’s scikitlearn package (Pedregosa, 2011).
In Figure 7—figure supplement 2, we implement a model of an online climbing fibermediated plasticity rule. The climbing fiber activity $c$ is assumed to encode the error between the target and the network prediction $c=f(\mathbf{x})\hat{f}(\mathbf{x})$. During each of ${N}_{\mathrm{epochs}}$ training epochs, the $P$ training patterns are shuffled randomly and each pattern is presented one at a time. For each pattern µ, the weights are updated according to $\mathrm{\Delta}{\mathbf{w}}^{\mu}=\eta \cdot c\cdot \mathbf{h}({\mathbf{x}}^{\mu})$. Parameter values were $P=30,\eta =0.7/M,M=10,000,{N}_{\mathrm{epochs}}=20,000$.
Performance metrics
For tasks with continuous targets, the prediction of the network is given by $\hat{f}(\mathbf{x})=\mathbf{w}\cdot \mathbf{h}(\mathbf{x})$, where $\mathbf{w}$ are the synaptic weights of the readout from the expansion layer. Error is measured as relative mean squared error (an expectation across patterns $\mathbf{x}$ in the test set): $\mathrm{E}\mathrm{r}\mathrm{r}\mathrm{o}\mathrm{r}=\frac{\mathbb{E}[(f(\mathbf{x})\hat{f}(\mathbf{x}){)}^{2}]}{\mathbf{x}[f(\mathbf{x}{)}^{2}]}$. In practice we use a large test set to estimate this error over $\mathbf{x}$ drawn from the distribution of test patterns. For categorization tasks, the network’s prediction is given by $\hat{f}(\mathbf{x})=\mathrm{s}\mathrm{i}\mathrm{g}\mathrm{n}(\mathbf{w}\cdot \mathbf{h}(\mathbf{x}))$. Performance is measured as the fraction of incorrect predictions. Error bars represent standard error of the mean across realizations of network weights and tasks.
Optimal granule–Purkinje cell weight distribution
We adapted our model to allow for comparisons with Brunel et al., 2004 by constraining readout weights $\mathbf{w}$ to be nonnegative and adding a bias, $f(\mathbf{x})=\mathbf{w}\cdot \mathbf{h}(\mathbf{x})+b$. To guarantee that the target function is nonnegative, we set $f(\mathbf{x})\in \{0,1\}$ for the random categorization task and $f(\mathbf{x})\leftarrow f(\mathbf{x})$ for the Gaussian process tasks. The weights and bias were determined with the Python convex optimization package cvxopt (Andersen et al., 2011).
Model of twojoint arm
We implemented a biophysical model of a planar twojoint arm (Fagg et al., 1997). The state of the arm is specified by six variables: joint angles ${\theta}_{1}$ and ${\theta}_{2}$, angular velocities ${\dot{\theta}}_{1}$ and ${\dot{\theta}}_{2}$, and torques u_{1} and u_{2}. The upper and lower segments of the arm have lengths l_{1} and l_{2} and masses m_{1} and m_{2}, respectively. The arm has the following dynamics:
where $\mathbf{M}\mathbf{(}\mathit{\theta}\mathbf{)}$ is the inertia matrix and $\mathbf{C}(\mathit{\theta},\dot{\mathit{\theta}})$ is the matrix of centrifugal, Coriolis, and friction forces:
where ${\overline{l}}_{2}$ is the center of mass of the lower arm, I_{1} and I_{2} are moments of inertia and D_{1} and D_{2} are friction terms of the upper and lower arm respectively. These parameters were ${m}_{1}=3\text{kg}$, ${m}_{2}=2.5\text{kg}$, ${l}_{1}=0.3\text{m}$, ${l}_{2}=0.35\text{m}$, ${\overline{l}}_{2}=0.21\text{m}$, ${I}_{1}=0.1{\text{kg m}}^{2}$, ${I}_{2}=0.12{\text{kg m}}^{2}$, ${D}_{1}=0.05{\text{kg m}}^{2}/\text{s}$ and ${D}_{2}=0.01{\text{kg m}}^{2}/\text{s}$.
The task is to predict the position of the hand based on the forward dynamics of the twojoint arm system, given the arm initial condition and the applied torques. More precisely, the $P$ network inputs $\mathbf{x}}^{\mu$ were generated by sampling 6dimensional Gaussian vectors with covariance matrix $\mathbf{C}=\text{diag}({\sigma}_{\theta},{\sigma}_{\theta},{\sigma}_{\dot{\theta}},{\sigma}_{\dot{\theta}},{\sigma}_{u},{\sigma}_{u})$, to account for the fact that angles, angular velocities and torques might vary on different scales across simulations. For our results, we used ${\sigma}_{\theta}={\sigma}_{\dot{\theta}}=0.1$ and ${\sigma}_{u}=1$. Each sample $\mathbf{x}}^{\mu$ was then normalized and used to generate initial conditions of the arm, by setting ${\theta}_{1}^{\mu}=\frac{\pi}{4}+{x}_{1}^{\mu}$, ${\theta}_{2}^{\mu}=\frac{\pi}{4}+{x}_{2}^{\mu}$, ${\dot{\theta}}_{1}^{\mu}={x}_{3}^{\mu}$, and ${\dot{\theta}}_{2}^{\mu}={x}_{4}^{\mu}$. Torques were generated by setting ${u}_{1}^{\mu}={x}_{5}^{\mu}$ and ${u}_{2}^{\mu}={x}_{6}^{\mu}$. The target was constructed by running the dynamics of the arm forward in time for a time $\delta =0.2\text{s}$, and by computing the difference in position of the “hand” (i.e. the end of the lower segment) in Cartesian coordinates. As a result, the target in this task is twodimensional, with each target dimension corresponding the one of the two Cartesian coordinates of the hand. The overall performance is assessed by computing the error on each task separately and then averaging the errors.
Model of electrosensory lateral line lobe (ELL)
We simulated 20,000 granule cells using the biophysical model of Kennedy et al., 2014. We varied the granule cell layer coding level by adjusting the spiking threshold parameter in the model. For each choice of threshold, we generated 30 different trials of spike rasters. Each trial is 160ms long with a 1ms time bin and consists of a timelocked response to an electric organ discharge command. Trialtotrial variability in the model granule cell responses arises from noise in the mossy fiber responses. To generate training and testing data, we sampled 4 trials ($P=640$ patterns) from the 30 total trials for training and 10 trials for testing (1600 patterns). Coding level is measured as the fraction of granule cells that spike at least once in the training data. We repeated this sampling process 30 times.
The targets were smoothed broadspike responses of 15 MG cells timelocked to an electric organ discharge command measured during experiments (Muller et al., 2019). The original data set consisted of 55 MG cells, each with a 300ms long spike raster with a 1ms time bin. The spike rasters were trialaveraged and then smoothed with a Gaussianweighted moving average with a 10ms time window. Only MG cells whose maximum spiking probability across all time bins exceeded 0.01 after smoothing were included in the task. The same MG cell responses were used for both training and testing. To match the length of the granule cell data, we discarded MG cell data beyond 160ms and then concatenated 4 copies of the 160ms long responses for training and 10 copies for testing. We measured the ability of the model to construct MG cell targets out of granule cell activity, generalizing across noise in granule cell responses. Errors for each MG cell target were averaged across the 30 repetitions of sampling of training and testing data, and then averaged across targets. Standard error of the mean was computed across the 30 repetitions.
Model of vestibuloocular reflex (VOR)
Recordings of Purkinje cell activity in monkeys suggest that these neurons exhibit piecewiselinear tuning to head velocity (Lisberger et al., 1994). Thus, we designed piecewiselinear target functions representing Purkinje cell firing rate as a function of head velocity $v$, a onedimensional input:
Inputs $v$ were sampled uniformly from $[1,1]$ 100 times. We generated 25 total target functions using all combinations of slopes m_{1} and m_{2} sampled from 5 equally spaced points on the interval $[2,2]$. We set $b=0.1$ and $c=0.2$.
Mossy fiber responses to head velocity input were modeled as exponential tuning curves:
where g_{j} is a gain term, ${r}_{j}\in \pm 1$ determines a mossy fiber preference for positive or negative velocities, and b_{j} is the baseline firing rate. We generated 24 different tuning curves from all combinations of the following parameter values: The gain g_{j} was sampled from 6 equally spaced points on the interval $[0.1,1]$, r_{j} was set to either –1 or 1, and b_{j} was set to either 0 or 1. Qualitative results did not depend strongly on this parameterization. Mossy fiber to granule cell weights were random zeromean Gaussians. Errors were averaged across targets.
Appendix 1
1 Connection between kernel and previous theories
Previous theories (Babadi and Sompolinsky, 2014; LitwinKumar et al., 2017) studied generalization performance for random clusters of inputs associated with binary targets, where test patterns are formed by adding noise to training patterns (Figure 4A). The readout is trained using a supervised Hebbian rule with meansubtracted expansion layer responses, $\mathbf{w}=\sum _{\mu}{y}^{\mu}({\mathbf{h}}^{\mu}\overline{\mathbf{h}})$, with $\overline{\mathbf{h}}=\frac{1}{P}\sum _{\mu =1}^{P}{\mathbf{h}}^{\mu}$. The net input to a readout in response to a test pattern $\hat{\mathbf{h}}}^{\mu$ from cluster µ is ${g}^{\mu}=\mathbf{w}\cdot ({\hat{\mathbf{h}}}^{\mu}\overline{\mathbf{h}})$. The statistics of ${g}^{\mu}$ determine generalization performance. For a Hebbian readout, the error rate is expressed in terms of the signaltonoise ratio (SNR) (Babadi and Sompolinsky, 2014):
SNR is given in terms of the mean and variance of ${g}^{\mu}$:
The numerator of SNR is proportional to the average overlap of the expansion layer representations of training and test patterns belonging to the same cluster, which can be expressed in terms of the kernel function $K$:
For large networks with Gaussian i.i.d. expansion weights, $K({\hat{\mathbf{x}}}^{\mu},{\mathbf{x}}^{\mu})=K(t)$, where $t={\hat{\mathbf{x}}}^{\mu}\cdot {\mathbf{x}}^{\mu}$, and the above equation reduces to $MK({t}_{\mathrm{t}\mathrm{r}\mathrm{a}\mathrm{i}\mathrm{n}/\mathrm{t}\mathrm{e}\mathrm{s}\mathrm{t}})\overline{\mathbf{h}}\cdot \overline{\mathbf{h}}$, where ${t}_{\mathrm{train}/\mathrm{test}}$ is the typical overlap of training and test patterns belonging to the same cluster. When ${\mathbf{x}}^{\mu}\cdot {\mathbf{x}}^{\mu}=1$, ${t}_{\mathrm{train}/\mathrm{test}}$ can be written as $t}_{\mathrm{t}\mathrm{r}\mathrm{a}\mathrm{i}\mathrm{n}/\mathrm{t}\mathrm{e}\mathrm{s}\mathrm{t}}=1\mathrm{\Delta$, where Δ is a measure of withincluster noise (Babadi and Sompolinsky, 2014; LitwinKumar et al., 2017).
Babadi and Sompolinsky, 2014 demonstrated that, for random categorization tasks and when $M$ and $D$ are large, $\mathrm{Var}\left({g}^{\mu}\right)=C(\frac{1}{M}+{Q}^{2}\frac{1}{D})$ where $C$ is a constant and $Q\in [0,1]$ is given by
assuming the entries of $\mathbf{x}$ are zeromean. ${Z}_{a}=\underset{\mu}{\mathbb{E}}[\Vert {\mathbf{a}}^{\mu}\overline{\mathbf{a}}{\Vert}^{2}]$ for $a\in \{h,x\}$ normalizes the overlaps to the typical overlap of a pattern with itself. The quantity ${Q}^{2}$ is the ratio of the variance of overlaps between patterns belonging to different clusters in the expansion layer to that of the input layer. This describes the extent to which the geometry of the input layer representation is preserved in the expansion layer. When overlaps in the input layer are small, as they are for random clusters, $\frac{1}{{Z}_{h}}({\mathbf{h}}^{\mu}\overline{\mathbf{h}})\cdot ({\mathbf{h}}^{\nu}\overline{\mathbf{h}})\approx \frac{Q}{{Z}_{x}}\cdot ({\mathbf{x}}^{\mu}\cdot {\mathbf{x}}^{\nu})$ as $M\to \mathrm{\infty}$. This relation illustrates that, for random clusters and $M\to \mathrm{\infty}$, $Q$ is equal to the slope of the normalized kernel function $K(t)$ evaluated at $t=0$. LitwinKumar et al., 2017 also showed that the dimension of the expansion layer representation is equal to $\frac{{C}^{\prime}}{(\frac{1}{M}+{Q}^{2}\frac{1}{D})}$, where ${C}^{\prime}$ is a constant.
Thus, for the random categorization task studied in Babadi and Sompolinsky, 2014; LitwinKumar et al., 2017, dimension and readout SNR can be calculated by evaluating $K({t}_{\mathrm{train}/\mathrm{test}})$ and the slope of $K(t)$ at $t=0$.
2 Dotproduct kernels with arbitrary threshold
As $M\to \mathrm{\infty}$, the normalized dot product between features (Equation 2) converges pointwise to
where $\mathbf{J}}_{1$ is a row of the weight matrix $\mathbf{J}$ (without loss of generality, the first row) with entries drawn i.i.d. from a Gaussian distribution $\mathcal{N}(0,1)$. Our goal is to compute Equation A5 for a given $\theta $ and inputs drawn on the unit sphere $\mathbf{x},{\mathbf{x}}^{\mathrm{\prime}}\in {\mathbb{S}}^{D1}$.
Because the Gaussian weight distribution is spherically symmetric, Equation A5 restricted to the unit sphere for any nonlinearity is only a function of the dotproduct $t:={\mathbf{x}}^{T}{\mathbf{x}}^{\mathrm{\prime}}$, making the kernel a dotproduct kernel $K(\mathbf{x},{\mathbf{x}}^{\mathrm{\prime}})=K(t)$.
Denote by ${J}_{i}$ the entries of $\mathbf{J}}_{1$. Let ${I}_{1}={\sum}_{i=1}^{D}{J}_{i}{x}_{i}$ and ${I}_{2}={\sum}_{i=1}^{D}{J}_{i}{x}_{i}^{\prime}$ be the preactivations for each input. Then $({I}_{1},{I}_{2})$ are jointly Gaussian with mean 0, variance 1, and covariance $\mathbb{E}[{I}_{1}{I}_{2}]=t$. If $t>0$, we can reparameterize these preactivations as the sum of an independent and shared component $I}_{i}={y}_{i}\sqrt{1t}+z\sqrt{t$, where ${y}_{i}\sim \mathcal{N}(0,1)$ for $i=1,2$ and $z\sim \mathcal{N}(0,1)$. In these coordinates, Equation A5 becomes
where the second line follows from the conditional independence of ${h}_{1}z$ and ${h}_{2}z$ and the third from the fact that they are identically distributed. Similarly, if $t<0$, we can write ${I}_{1}={y}_{1}\sqrt{1t}+z\sqrt{t}$, ${I}_{2}={y}_{2}\sqrt{1t}z\sqrt{t}$.
We will use Equation A6 to solve for the kernel assuming $\varphi $ is a ReLU nonlinearity. Let
Using the fact that $\varphi$ is nonzero only when ${y}_{1}\sqrt{1t}+z\sqrt{t}\theta >0$, i.e. for $y}_{1}>T=\frac{\theta z\sqrt{t}}{\sqrt{1t}$, we obtain
Performing a similar calculation for $t<0$ and collecting the results leads to:
3 Spherical harmonic decompositions
Our theory of generalization requires us to work in function spaces which are natural to the problem. The spherical harmonics are the natural basis for working with dotproduct kernels on the sphere. For a thorough treatment of spherical harmonics, see Atkinson and Han, 2012, whose notation we generally follow. Both our kernel and Gaussian process (GP) tasks are defined over the sphere in $D$ dimensions
A spherical harmonic ${Y}_{km}(\cdot )$—where $k$ indexes frequency and $m$ indexes modes of the same frequency—is a harmonic homogeneous polynomial of degree $k$ restricted to the sphere $\mathbb{S}}^{D1$. For each frequency $k\in \mathbb{Z}$, there are $N(D,k)$ linearly independent polynomials, where
3.1 Decomposition of the kernel and target function
We remind the reader here of the setting for our theory:
Ridge regression using random features with a dotproduct limiting kernel.
Data drawn uniformly from the unit sphere.
Let $\sigma $ be the Lebesgue measure on $\mathbb{S}}^{D1$. We will denote the surface area of the sphere as
On the other hand, the uniform probability measure on the sphere, denoted by $\overline{\sigma}$, must integrate to 1, so $\overline{\sigma}=\sigma /{\mathbb{S}}^{D1}$. Finally, we define the space of realvalued square integrable functions ${L}^{2}(\sigma )$ as the Hilbert space with inner product
and ${\parallel f\parallel}_{{L}^{2}(\sigma )}={\u27e8f,f\u27e9}_{{L}^{2}(\sigma )}^{1/2}$. The space ${L}^{2}(\overline{\sigma})$ is defined analogously.
Eigendecompositions describe the action of linear operators, not functions, thus we must associate a linear operator with our kernel for its eigenvalues to make sense. The kernel eigenvalues ${\lambda}_{\alpha}$ that we will use to compute the error are the eigenvalues of the integral operator ${\mathcal{T}}_{K}:{L}^{2}(\overline{\sigma})\to {L}^{2}(\overline{\sigma})$ defined as
This is because $\overline{\sigma}$ is the data distribution, and these eigenvalues are approximated by the eigenvalues of the kernel matrix evaluated on a large but finite dataset (Koltchinskii et al., 2000). Similarly, we define the analogous operator ${\mathcal{U}}_{K}:{L}^{2}(\sigma )\to {L}^{2}(\sigma )$ under the measure $\sigma $ with eigenvalues ${\xi}_{\alpha}$. Since ${\mathcal{T}}_{K}={\mathcal{U}}_{K}/{\mathbb{S}}^{D1}$, the eigenvalues are related by
and they share the same eigenfunctions, up to normalization. For the rest of this section we will study eigendecompositions of operator $\mathcal{U}}_{K$, which may be translated into statements about $\mathcal{T}}_{K$ via (18) (These differences are liable to cause some confusion and pain when reading the literature).
Under mild technical conditions that our kernels satisfy, Mercer’s theorem states that positive semidefinite kernels can be expanded as a series in the orthonormal basis of eigenfunctions ${\psi}_{\alpha}$ weighted by nonnegative eigenvalues ${\xi}_{\alpha}$:
Again, $({\lambda}_{\alpha},{\psi}_{\alpha})$ are eigenpairs for the operator $\mathcal{U}}_{K$ and form an orthonormal set under the ${L}^{2}(\sigma )$ inner product.
As stated earlier, the kernel (Equation A5) is spherically symmetric and thus a dotproduct kernel. Because of this, we can take the eigenfunctions ${\psi}_{\alpha}$ to be the spherical harmonics $Y}_{km$. The index $\alpha $ is a multiindex into mode $m$ of frequency $k$. Writing the Mercer decomposition in the spherical harmonic basis gives:
Because our kernel is rotation invariant, all $N(D,k)$ harmonics of frequency $k$ share eigenvalue ${\xi}_{k}$.
Any function in ${L}^{2}(\sigma )$ can be expanded in the spherical harmonic basis as follows:
The expansion is analogous to that of the Fourier series. In fact when $D=2$, the spherical harmonics are sines and cosines on the unit circle.
3.2 Ultraspherical polynomials
Adding together all harmonics of a given frequency relates them to a polynomial in $t$ by the addition formula
The polynomial ${P}_{k,D}(t)$ is the $k$ th ultraspherical polynomial. These are also called Legendre or Gegenbauer polynomials, although these usually have different normalizations and can be defined more generally.
The ultraspherical polynomials $\{{P}_{k,D}\}$ form an orthogonal basis for
As special cases, ${P}_{k,2}(t)$ and ${P}_{k,3}(t)$ are the classical Chebyshev and Legendre polynomials, respectively. For any $D$, the first two of these polynomials are ${P}_{0}(t)=1$ and ${P}_{1}(t)=t$. We use the Rodrigues formula (Atkinson and Han, 2012), which holds for $k\ge 0$ and $D\ge 2$, to generate these polynomials:
Combining Equation A20 with the addition formula (Equation A22), we can express the kernel in terms of ultraspherical polynomials evaluated at the dotproduct of the inputs:
3.3 Computing kernel eigenvalues
The FunkHecke theorem states that
Equation A25 implies that the eigenvalues of $\mathcal{U}}_{K$ are given as
For our kernels, the kernel eigenvalues can be conveniently computed using polar coordinates. When the entries of $\mathbf{J}}_{1$ are i.i.d. unit Gaussian,
where $\hat{\mathbf{x}}={\mathbf{J}}_{1}/r$ and $r=\Vert {\mathbf{J}}_{1}\Vert$. The ReLU nonlinearity is positively homogeneous, so $\varphi (r{\hat{\mathbf{J}}}^{T}\mathbf{x}\theta )=r\varphi ({\hat{\mathbf{J}}}^{T}\mathbf{x}\theta /r)$. We can write
where we have introduced a new kernel ${K}_{\mathrm{shell}}(t;\theta )$ which is ${\mathbb{S}}^{D1}$ times the dotproduct kernel that arises when the weights are distributed uniformly on the sphere ($\sigma $ is not the probability measure). The above equation shows that the network restricted to inputs $\mathbf{x},{\mathbf{x}}^{\mathrm{\prime}}\in {\mathbb{S}}^{D1}$ has different kernels depending on whether the weights are sampled according to a Gaussian distribution or uniformly on the sphere. Without the threshold, this difference disappears due to the positive homogeneity of the ReLU (Churchland et al., 2010).
Next we expand the nonlinearity in the spherical harmonic basis (following Bietti and Bach, 2021; Bach, 2017)
where the $k$ th coefficient is given by the FunkHecke formula (Equation A25) as
and we explicitly note the dependence on $\theta $. Using the representation Equation A28, we can recover the eigendecomposition:
which follows from orthonormality and the addition formula (Equation A22). We have that ${a}_{k}{(\theta )}^{2}$ is the $k$ th eigenvalue of ${K}_{\mathrm{shell}}(t;\theta )$.
Using Equation A30 in Equation A27 leads to
i.e. the eigenvalues satisfy
3.3.1 Eigenvalues of ${K}_{\mathrm{shell}}$
It is possible to compute ${a}_{k}(\theta )$ analytically (Bietti and Bach, 2021; Bach, 2017). Letting
we have that Equation A29 reduces to ${a}_{k}(\theta )={\mathbb{S}}^{D2}\left({I}_{1,k}({\theta}^{\ast})\theta {I}_{0,k}({\theta}^{\ast})\right)$. Equation A33 requires $\theta \in [1,1]$, but $\theta /r\to \pm \mathrm{\infty}$ in Equation A32 as $r\to 0$. So we take ${\theta}^{*}=\mathrm{min}(\mathrm{max}(\theta ,1),1)$, which still assures that Equation A29 is satisfied. For the rest of this section, assume wlog that $\theta \in [1,1)$.
Using Rodrigues’ formula (Equation A23) in Equation A33 gives
which may be integrated by parts. We will treat $\alpha =0$ and 1 separately.
In the case of $\alpha =0$, since ${t}^{\alpha}=1$ we have the integral of a derivative, so for $k\ge 1$
When $k=0$ we find that
For $\alpha =1$, we integrate by parts once and find that for $k\ge 2$,
When $\alpha =0$, we have a straightforward integral
Finally, for $k=1$, we obtain
3.3.2 Properties of the eigenvalues of ${K}_{\mathrm{shell}}$
The above show that for $k\ge 2$
Taking $\theta =1$ leads to ${a}_{k}=0$, since fewer derivatives than $k+(D3)/2$ appear in Equation A34, which reflects the fact that higher degree ultraspherical polynomials are orthogonal to a linear function. Furthermore, since $1{t}^{2}$ is an even function, the parity of a_{k} as a function of $\theta $ matches the parity of $k$. However, a_{k} appears squared in Equation A32, so ${\xi}_{k}$ will always be an even function of $\theta $. This explains the parity symmetry of the eigenvalues with coding level for $k\ge 2$. Also, Equation A34 for $\theta =0$ gives ${a}_{k}=0$ when $k$ is odd, as was shown by Bach, 2017; Basri et al., 2019. This is because
because the $j$ and $pj$ terms have opposite parity and cancel.
We may also compute the tail asymptotics of these eigenvalues for large $k$. Let $p=k2$ and $\ell =(D+1)/2$, so we want to evaluate
for large $p$ at $t=\theta \in (1,1)$. The first line follows from Cauchy’s intergral formula for a counterclockwise contour encircling $t$, and the second comes from defining
when $p$ is large and $\mathrm{\ell}$ is constant. We will use the saddle point method (Butler, 2007) to evaluate the contour integral asymptotically, ignoring the $o(p)$ term in the exponent. Note that the only singularity in the original integrand occurs at $z=t$.
The function $F$ has derivatives
We find the saddle points by setting ${F}^{\prime}(z)=0$. This leads to a quadratic equation with two roots: ${z}_{\pm}=t\pm \sqrt{{t}^{2}1}=\mathrm{sgn}(t)(t\pm i\sqrt{1{t}^{2}})$. Since these are evaluated at $t=\theta $ with $\theta <1$, both roots are complex, ${z}_{\pm}=1$, and ${F}^{\prime \prime}({z}_{\pm})\ne 0$. Also, the saddle points avoid the singularity in the original integrand, so we can deform our contour to pass through these points and apply the standard approximation.
Applying the saddle point approximation, we obtain
for some $c$ which is constant in $p$ and depends on $D$. In the last step, we use that ${z}_{+}^{p}+{z}_{}^{p}\le 2$ since ${z}_{\pm}$ are conjugate pairs with magnitude 1.
Now recall the full equation for the coefficients:
Plugging in the result from the saddle point approximation, substituting $p=k2$, and dropping all terms that are constant in $k$, we find that
where ${C}^{\prime}$ is a new constant. The rate of ${k}^{D/21}$ is the same decay rate found by Bach, 2017; Bietti and Bach, 2021 using a different mathematical technique for $\theta =0$. These decay rates are important for obtaining general worstcase bounds for kernel learning of general targets; (Bach, 2012) is an example.
3.4 Gaussian process targets
Taking our target function to be a GP on the unit sphere $f(\mathbf{x})\sim \mathbf{G}\mathbf{P}(0,C)$ with some covariance function $C:{\mathbb{S}}^{D1}\times {\mathbb{S}}^{D1}\to \mathbb{R}$, we can represent our target function by performing an eigendecomposition of the covariance operator $\mathcal{U}}_{C$. When $C$ itself is spherically symmetric and positive definite, this becomes
where ${\rho}_{k}>0$ are the eigenvalues. Then a sample from the GP with this covariance function is a random series
where ${g}_{km}\sim \mathcal{N}(0,1)$ by the KosambiKarhunen–Loève theorem (Kosambi, 1943). In other words, the coefficient of ${Y}_{km}$ in the series expansion of $f(\mathbf{x})$ is ${c}_{km}=\sqrt{{\rho}_{k}}{g}_{km}$.
We take the squared exponential covariance on the sphere
for $t={\mathbf{x}}^{\mu}\cdot {\mathbf{x}}^{\nu}$ and length scale $\gamma $.
3.5 Numerical details
All of our spherical harmonic expansions are truncated at frequency ${N}_{k}$. This is typically ${N}_{k}=50$ for experiments in $D=3$ dimensions. In higher dimensions, $N(D,k)$ grows very quickly in $k$, requiring truncation at a lower frequency.
To compute the kernel eigenvalues ${\lambda}_{k}$, we can either numerically integrate the FunkHecke formula (Equation A25) or compute the coefficients ${a}_{k}(\theta /r)$ semianalytically, following Equation A34, then integrate Equation A32 with numerical quadrature and rescale by Equation A18.
We use the FunkHecke formula (Equation A25) and numerical quadrature to find ${\rho}_{k}$. To compute the expected error using Equation A38, we use $\mathbb{E}[{c}_{\alpha}^{2}]={\rho}_{k}$. After generating a sample from the GP, we normalize the functions by dividing the labels and coefficients by their standard deviation. This ensures that the relative mean squared error is equivalent to the mean squared error computed in the next section.
4 Calculation of generalization error
The generalization error of kernel ridge regression is derived in Canatar et al., 2021a; Simon et al., 2021; Gerace et al., 2021, which show that the mean squared error, in the absence of noise in the target, can be written as
where ${\beta}_{\alpha}$ depend on $P$ and the kernel but not on the target, and ${c}_{\alpha}$ are the coefficients (Equation A21) of the target function in the basis ${L}^{2}(\sigma )$. The exact form of this expression differs from that given in Canatar et al., 2021b due to differences in the conventions we take for our basis expansions. Specifically,
where $\alpha $ indexes the kernel eigenfunctions and
with ${\alpha}_{\mathrm{ridge}}$ the ridge parameter. Note that Equation A41 is an implicit equation for $\kappa $, which we solve by numerical rootfinding.
Thus,
with ${C}_{1}=\left(\frac{1}{1\chi}\right)\frac{{\kappa}^{2}}{{P}^{2}}$ and ${C}_{2}=\frac{\kappa}{P}$.
5 Densesparse networks
To compare with more realistic networks, we break the simplifying assumption that $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}$ is densely connected and instead consider sparse connections between the input and expansion layer. Consider a random matrix $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}}=\mathbf{J}\mathbf{A$, where $\mathbf{A}\in {\mathbb{R}}^{N\times D}$ and $\mathbf{J}\in {\mathbb{R}}^{M\times N}$, with $N>D$ and $M>N$. The entries of $\mathbf{A}$ are i.i.d. Gaussian, i.e. ${A}_{ij}\sim \mathcal{N}\left(0,1/D\right)$. In contrast, $\mathbf{J}$ is a sparse matrix with exactly K nonzero entries per row, and nonzero entries equal to $1/\sqrt{K}$. With these scaling choices, the elements of $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}$ are of order $1/\sqrt{D}$, which is appropriate when the input features x_{i} are order 1. This is in contrast to the rest of this paper, where we considered features of order $1/\sqrt{D}$ and therefore assumed order 1 weights. The current scaling allows us to study the properties of $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}$ for different values of $D$, $N$ and $K$.
First, we examine properties of $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}}=\mathbf{J}\mathbf{A$ under these assumptions. Recall that the rows of $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}$ are the weights of each hidden layer neuron. Since $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}$ is Gaussian, any given row $\mathbf{J}}_{i}^{\mathrm{e}\mathrm{f}\mathrm{f}}\in {\mathbb{R}}^{D$ is marginally Gaussian and distributed identically to any other row. But the rows are not independent, since they are all linear combinations of the rows of $\mathbf{A}$. Thus, the kernel limit of an infinitely large densesparse network is equal to that of a fully dense network, but convergence to that kernel behaves differently and requires taking a limit of both $N,M\to \mathrm{\infty}$. In this section, we study how finite $N$ introduces extra correlations among the rows of $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}$ compared to dense networks.
The distribution of $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}$ is spherically symmetric in the sense that $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}$ and $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}}\mathbf{Q$ have the same distribution for any rotation matrix $\mathbf{Q}\in {\mathbb{R}}^{D\times D}$. In contrast, a densely connected network with weights $\mathbf{G}$ drawn i.i.d. as ${G}_{ij}\sim \mathcal{N}(0,1/D)$ will of course have independent rows and also be spherically symmetric. The spherical Gaussian is the only vector random variable which is spherically symmetric with independent entries (Nash and Klamkin, 1976). Furthermore, each row of $\mathbf{G}$ may be rotated by a different orthogonal matrix and the resulting random variable would still have the same distribution.
With these symmetry considerations in mind, the statistics of the rows of $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}$ can be described by their multipoint correlations. The simplest of these is the twopoint correlation, which in the case of spherical symmetry is captured by the overlaps:
The overlap ${\nu}_{ij}$ is doubly stochastic: one source of stochasticity are the elements of $\mathbf{A}$, and the second one is the random sampling of nonzero elements of $\mathbf{J}$. Ideally, we are interested in studying the statistics of ${\nu}_{ij}$ when varying $i$ and $j$, i.e. when $\mathbf{J}$ varies (since the rows of $\mathbf{J}$ are sampled independently from each other). However, this will leave us with the quenched disorder given by the specific realization of $\mathbf{A}$. To obtain a more general and interpretable result, we want to compute the probability distribution
Notice that the order in which we perform the averaging is irrelevant.
5.1Computation of the momentgenerating function
Instead of computing directly the probability distribution in Equation A44, we compute the momentgenerating function
which fully characterizes the probability distribution of ${\nu}_{ij}$. We indicate the set of indices in which the $i$th row of $\mathbf{J}$ takes nonzero values by ${S}^{i}=\{{S}_{1}^{i},{S}_{2}^{i},\mathrm{\dots},{S}_{K}^{i}\}$ such that ${J}_{i{S}_{l}^{i}}\ne 0$, $\forall l=1,\mathrm{\dots},K$, and analogously for the $j$th row. We also indicate the intersection ${S}^{ij}={S}^{i}\cap {S}^{j}$, i.e. the set of indices in which both the $i$th and the $j$th rows are nonzero. ${S}^{ij}$ has size $0\le {S}^{ij}\le K$. Notice that setting $i=j$ causes ${S}^{ij}=K$ deterministically. With this definitions, the overlap can be written as
We start by perform swapping the averaging order in Equation A45 and averaging over $\mathbf{A}$.
where in the first equality we marginalized over all the elements of $\mathbf{A}$ which do not enter the definition of ${\nu}_{ij}$, i.e. we went from having to integrate over $N\times D$ variables to only ${S}^{i}\cup {S}^{j}\times D=(2K{S}^{ij})\times D$ variables. In the second equality we factorized the columns of $\mathbf{A}$.
We now explicitly compute integral for a fixed value of $k$, by reducing it to a Gaussian integral:
where $\mathbf{P}\in {\mathbb{R}}^{{S}^{i}\cup {S}^{j}\times {S}^{i}\cup {S}^{j}}$, which has a 3by3 block structure and can be written as
where ${I}_{n}$ is the $n$by$n$ identity matrix and $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}$ is the $n$by$m$ matrix of all ones (if $m$ is omitted, then it is $n$by$n$). Due to the block structure, the determinant of the matrix above is identical to the determinant of a 3by3 matrix
By plugging this result into the expression for the momentgenerating function, we have that
This expression is our core result, and needs to be averaged over $\mathbf{J}$. This average can be written explicitly by noticing that, when $i\ne j$, ${S}^{ij}$ is a random variable that follows a hypergeometric distribution in which the number of draws is equal to number of success state and is equal to $K$. By using the explicit expression of the probability mass function of a hypergeometric distribution, we have that
Notice that the term $s=0$ yields the same momentgenerating function (up to a factor) as for a fullyconnected $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}$ with Gaussian i.i.d. entries with variance $1/D$. In contrast, when $i=j$ we obtain
5.2 Computation of the moments of ${\nu}_{ij}$
In this section, we assume that $i\ne j$ and use the momentgenerating function to compute the moments of ${\nu}_{ij}$. The noncentral moments of the overlap are easily obtained from the momentgenerating function as
which can be computed in a symbolic manipulation tool.
We now explicitly compute the first two moments of ${\nu}_{ij}$.
where we used the fact that the mean of $s\sim \text{Hypergeom}(N,K,K)$ is given by $\mathbb{E}[s]=\frac{{K}^{2}}{N}$. For the second moment, we have
while to compute the variance we use the law of total variance
As $N\to \mathrm{\infty}$ we have that $\text{Var}({\nu}_{ij})\sim \frac{1}{D}$, which is the same variance of the overlap for a fullyconnected $\mathbf{J}}^{\mathrm{e}\mathrm{f}\mathrm{f}$ with Gaussian i.i.d. entries. This is expected since when $N$ is large, the probability of $i$ and $j$ having common afferents goes to zero.
5.3 Comparison to clustered embedding
Instead of distributed embedding, i.e. $\mathbf{A}$ being a Gaussian matrix, here we consider a clustered embedding by setting
i.e. the Kronecker product of the $D$dimensional identity matrix and a vector of all ones and length $N/D$. This means that we can separate the input layer of $N$ neurons in $D$ non overlapping subsets ${B}_{n}=\{\frac{N}{D}(n1)+1,\frac{N}{D}(n1)+2,\mathrm{\dots},\frac{N}{D}n\}$, each of size $N/D$, and we can write
In this case the overlap is given by
where $1[\cdot ]$ is the indicator function, i.e. it is one if the argument is true and zero if the argument is false. We indicate by ${K}_{l}^{i}$ the number of elements of ${S}^{i}$ which belongs to group $l$, i.e. ${K}_{l}^{i}={\sum}_{m\in {S}^{i}}1[m\in {B}_{l}]$. The overlap can then be written as
The vector ${\mathbf{K}}^{i}=({K}_{1}^{i},\dots ,{K}_{D}^{i})$ follows a multivariate hypergeometric distribution with $D$ classes, $K$ draws, a population of size $N$, and number of successes for each class equal to $N/D$. Notice that $\mathbf{K}}^{i$ and $\mathbf{K}}^{j$ are independent from each other since each neuron samples its presynaptic partners independently. We can now compute explicitly the mean of ${\nu}_{ij}$ using the fact that $\mathbb{E}\left[{K}_{l}^{i}\right]=\frac{K}{D}$
Similarly, we can write the second moment of ${\nu}_{ij}$ as
Once again, we can use known result for variance and covariance of multivariate hypergeometric variables to simplify the above expression. Indeed, we can write
from which we obtain the final expression for the second moment
Data availability
The current manuscript is a computational study, so no data have been generated for this manuscript. Code implementing the model is available on github: https://github.com/marjoriexie/cerebellartaskdependent (copy archived at Xie, 2023).
References

BookInteractions between intrinsic and stimulusevoked activity in recurrent neural networksIn: Abbott LF, editors. The Dynamic Brain: An Exploration of Neuronal Variability and Its Functional Significance. Oxford University Press. pp. 65–82.https://doi.org/10.1093/acprof:oso/9780195393798.001.0001

A theory of cerebellar functionMathematical Biosciences 10:25–61.https://doi.org/10.1016/00255564(71)900514

BookInteriorpoint methods for largescale cone programmingIn: Andersen M, editors. Optimization for Machine Learning. MIT Press. pp. 1–26.https://doi.org/10.7551/mitpress/8996.001.0001

BookSpherical Harmonics and Approximations on the Unit Sphere: An IntroductionBerlin, Heidelberg: Springer.https://doi.org/10.1007/9783642259838

Breaking the curse of dimensionality with convex neural networksJournal of Machine Learning Research 18:1–53.

Cerebellar granule cells: dense, rich and evolving representationsCurrent Biology 27:R415–R418.https://doi.org/10.1016/j.cub.2017.04.009

The sparseness of mixed selectivity neurons controls the generalizationdiscrimination tradeoffThe Journal of Neuroscience 33:3844–3856.https://doi.org/10.1523/JNEUROSCI.275312.2013

ConferenceThe convergence rate of neural networks for learned functions of different frequenciesAdvances in Neural Information Processing Systems. pp. 4761–4771.

Cerebellumlike structures and their implications for cerebellar functionAnnual Review of Neuroscience 31:1–24.https://doi.org/10.1146/annurev.neuro.30.051606.094225

ConferenceSpectrum dependent learning curves in kernel regression and wide neural networksInternational Conference on Machine Learning. pp. 1024–1034.

BookSaddlepoint Approximations with ApplicationsCambridge University Press.https://doi.org/10.1017/CBO9780511619083

Outofdistribution generalization in kernel regressionAdvances in Neural Information Processing Systems 34:12600–12612.

Largemargin classification in infinite neural networksNeural Computation 22:2678–2697.https://doi.org/10.1162/NECO_a_00018

Stimulus onset quenches neural variability: a widespread cortical phenomenonNature Neuroscience 13:369–378.https://doi.org/10.1038/nn.2501

Storage of correlated patterns in standard and bistable Purkinje cell modelsPLOS Computational Biology 8:e1002448.https://doi.org/10.1371/journal.pcbi.1002448

Optimal properties of analog perceptrons with excitatory weightsPLOS Computational Biology 9:e1002919.https://doi.org/10.1371/journal.pcbi.1002919

The mossy fibregranule cell relay of the cerebellum and its inhibitory control by Golgi cellsExperimental Brain Research 1:82–101.https://doi.org/10.1007/BF00235211

BookThe Cerebellum as a Neuronal MachineBerlin, Heidelberg: Springer.https://doi.org/10.1007/9783662131473

ConferenceCerebellar learning for control of a twolink arm in muscle spaceProceedings of International Conference on Robotics and Automation. pp. 2638–2644.

Generalisation error in learning with random features and the hidden manifold model*Journal of Statistical Mechanics 2021:124013.https://doi.org/10.1088/17425468/ac3ae6

The expression pattern of a Cav3Kv4 complex differentially regulates spike output in cerebellar granule cellsThe Journal of Neuroscience 34:8800–8812.https://doi.org/10.1523/JNEUROSCI.098114.2014

Cellularresolution population imaging reveals robust sparse coding in the Drosophila mushroom bodyThe Journal of Neuroscience 31:11772–11785.https://doi.org/10.1523/JNEUROSCI.109911.2011

ConferenceNeural tangent kernel: Convergence and generalization in neural networksAdvances in Neural Information Processing Systems.

Properties of somatosensory synaptic integration in cerebellar granule cells in vivoThe Journal of Neuroscience 26:11786–11797.https://doi.org/10.1523/JNEUROSCI.293906.2006

A theory of cerebellar cortexThe Journal of Physiology 202:437–470.https://doi.org/10.1113/jphysiol.1969.sp008820

The Drosophila mushroom body: from architecture to algorithm in a learning circuitAnnual Review of Neuroscience 43:465–484.https://doi.org/10.1146/annurevneuro0803170621333

Singletrial neural dynamics are dominated by richly varied movementsNature Neuroscience 22:1677–1686.https://doi.org/10.1038/s4159301905024

Optimal routing to cerebellumlike structuresNature Neuroscience 26:1630–1641.https://doi.org/10.1038/s41593023014037

A spherical characterization of the normal distributionJournal of Mathematical Analysis and Applications 55:156–158.https://doi.org/10.1016/0022247X(76)902857

Sparse coding of sensory inputsCurrent Opinion in Neurobiology 14:481–487.https://doi.org/10.1016/j.conb.2004.07.007

BookCerebellar Cortex: Cytology and OrganizationBerlin, Heidelberg: Springer.https://doi.org/10.1007/9783642655814

Scikitlearn: machine learning in pythonJournal of Machine Learning Research 12:2825–2830.

ConferenceRandom features for largescale kernel machinesAdvances in Neural Information Processing Systems.

Stochastic differential equation model for cerebellar granule cell excitabilityPLOS Computational Biology 4:e1000004.https://doi.org/10.1371/journal.pcbi.1000004

BookLearning with Kernels: Support Vector Machines, Regularization, Optimization, and BeyondMIT press.

Cortical control of arm movements: A dynamical systems perspectiveAnnual Review of Neuroscience 36:337–359.https://doi.org/10.1146/annurevneuro062111150509

ConferenceApproximate learning curves for Gaussian processes9th International Conference on Artificial Neural Networks.https://doi.org/10.1049/cp:19991148

Questioning the role of sparse coding in the brainTrends in Neurosciences 38:417–427.https://doi.org/10.1016/j.tins.2015.05.005

Cerebellum and nonmotor functionAnnual Review of Neuroscience 32:413–434.https://doi.org/10.1146/annurev.neuro.31.060407.125606

Olfactory representations by Drosophila mushroom body neuronsJournal of Neurophysiology 99:734–746.https://doi.org/10.1152/jn.01283.2007

Movementrelated inputs to intermediate cerebellum of the monkeyJournal of Neurophysiology 69:74–94.https://doi.org/10.1152/jn.1993.69.1.74

Internal models in the cerebellumTrends in Cognitive Sciences 2:338–347.https://doi.org/10.1016/S13646613(98)012212

Softwarecerebellartaskdependents, version swh:1:rev:f56a3522566ac2273a65e0cd1d5f717e034c9312Software Heritage.

Gaussianprocess factor analysis for lowdimensional singletrial analysis of neural population activityJournal of Neurophysiology 102:614–635.https://doi.org/10.1152/jn.90941.2008
Article and author information
Author details
Funding
National Institutes of Health (T32NS06492)
 Marjorie Xie
Simons Foundation
 Samuel P Muscinelli
Swartz Foundation
 Samuel P Muscinelli
Washington Research Foundation
 Kameron Decker Harris
Burroughs Wellcome Fund
 Ashok LitwinKumar
Gatsby Charitable Foundation (GAT3708)
 Marjorie Xie
National Science Foundation (DBI1707398)
 Marjorie Xie
The funders had no role in study design, data collection and interpretation, or the decision to submit the work for publication.
Acknowledgements
The authors thank L F Abbott, N A CaycoGajic, N Sawtell, and S Fusi for helpful discussions and comments on the manuscript. The authors also thank S Muller for contributing data, code, and helpful discussions for analysis of ELL data. M X was supported by NIH grant T32NS064929. S M was supported by the Simons and Swartz Foundations. K D H was supported by a grant from the Washington Research Foundation. A LK was supported by the Simons and Burroughs Wellcome Foundations. M X, S M, and A LK were also supported by the Gatsby Charitable Foundation and NSF NeuroNex award DBI1707398.
Version history
 Preprint posted: August 15, 2022 (view preprint)
 Received: August 22, 2022
 Accepted: September 5, 2023
 Accepted Manuscript published: September 6, 2023 (version 1)
 Version of Record published: September 29, 2023 (version 2)
Copyright
© 2023, Xie et al.
This article is distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use and redistribution provided that the original author and source are credited.
Metrics

 996
 views

 191
 downloads

 2
 citations
Views, downloads and citations are aggregated across all versions of this paper published by eLife.
Download links
Downloads (link to download the article as PDF)
Open citations (links to open the citations from this article in various online reference manager services)
Cite this article (links to download the citations from this article in formats compatible with various reference manager tools)
Further reading

 Computational and Systems Biology
 Genetics and Genomics
Runsofhomozygosity (ROH) segments, contiguous homozygous regions in a genome were traditionally linked to families and inbred populations. However, a growing literature suggests that ROHs are ubiquitous in outbred populations. Still, most existing genetic studies of ROH in populations are limited to aggregated ROH content across the genome, which does not offer the resolution for mapping causal loci. This limitation is mainly due to a lack of methods for the efficient identification of shared ROH diplotypes. Here, we present a new method, ROHDICE (runsofhomozygous diplotype cluster enumerator), to find large ROH diplotype clusters, sufficiently long ROHs shared by a sufficient number of individuals, in large cohorts. ROHDICE identified over 1 million ROH diplotypes that span over 100 single nucleotide polymorphisms (SNPs) and are shared by more than 100 UK Biobank participants. Moreover, we found significant associations of clustered ROH diplotypes across the genome with various selfreported diseases, with the strongest associations found between the extended human leukocyte antigen (HLA) region and autoimmune disorders. We found an association between a diplotype covering the homeostatic iron regulator (HFE) gene and hemochromatosis, even though the wellknown causal SNP was not directly genotyped or imputed. Using a genomewide scan, we identified a putative association between carriers of an ROH diplotype in chromosome 4 and an increase in mortality among COVID19 patients (pvalue = 1.82 × 10^{−11}). In summary, our ROHDICE method, by calling out large ROH diplotypes in a large outbred population, enables further population genetics into the demographic history of large populations. More importantly, our method enables a new genomewide mapping approach for finding diseasecausing loci with multimarker recessive effects at a population scale.

 Biochemistry and Chemical Biology
 Computational and Systems Biology
Previously, Tuller et al. found that the first 30–50 codons of the genes of yeast and other eukaryotes are slightly enriched for rare codons. They argued that this slowed translation, and was adaptive because it queued ribosomes to prevent collisions. Today, the translational speeds of different codons are known, and indeed rare codons are translated slowly. We reexamined this 5’ slow translation ‘ramp.’ We confirm that 5’ regions are slightly enriched for rare codons; in addition, they are depleted for downstream Start codons (which are fast), with both effects contributing to slow 5’ translation. However, we also find that the 5’ (and 3’) ends of yeast genes are poorly conserved in evolution, suggesting that they are unstable and turnover relatively rapidly. When a new 5’ end forms de novo, it is likely to include codons that would otherwise be rare. Because evolution has had a relatively short time to select against these codons, 5’ ends are typically slightly enriched for rare, slow codons. Opposite to the expectation of Tuller et al., we show by direct experiment that genes with slowly translated codons at the 5’ end are expressed relatively poorly, and that substituting faster synonymous codons improves expression. Direct experiment shows that slow codons do not prevent downstream ribosome collisions. Further informatic studies suggest that for natural genes, slow 5’ ends are correlated with poor gene expression, opposite to the expectation of Tuller et al. Thus, we conclude that slow 5’ translation is a ‘spandrel’a nonadaptive consequence of something else, in this case, the turnover of 5’ ends in evolution, and it does not improve translation.