Introduction

Working with neural data is difficult for many reasons. It is messy, heterogeneous, noisy, high-dimensional and, most frustratingly, often insufficiently constrained for the question we want to ask. This is not the fault of the experimentalist. They are doing an amazing job of providing people like myself with well-documented, cleaned-up data. A clean data matrix is usually evidence that someone else has already suffered.

But even a beautifully prepared dataset does not tell us what question to ask or what an analysis would establish. It is easy to construct an analysis, find a result and then realize that the result was already implied by how we constructed the analysis. The goal of these notes is to work through a few mathematical distinctions that might help us avoid doing that. They will not make an analysis falsifiable on their own, but they can help us see what a proposed explanation actually predicts and what could count against it.

My experience with my PI, Evan Schaffer, led me to write this. For months, Evan told me to “look for what’s not obvious.” I banged my head trying to understand what that meant. Nothing was obvious to me. Why did he keep saying that? Every analysis I initially thought was exciting turned out to produce something “trivial.” It took me a long time to understand how a complicated method could produce a result that told us very little. There was a gap between my ability to compute something and my understanding of what that computation could actually tell us.

To keep these ideas easy to follow, I will use an orchestra as a running analogy. Think of each neuron as a musician and its activity as how loudly that musician is playing at a given moment. We can ask how many musicians are playing, which ones they are, how the volume is distributed across them and how they coordinate. These are different questions, even though we are listening to the same orchestra.

At any moment, we could write down one number for each musician’s volume. That list is our population activity vector. Over the performance, those numbers change, producing a sequence of states. We can then ask what remains the same between two performances: the musicians, their individual contributions, their coordination or the relationships among those states. Calling the performance “stable” leaves quite a lot unanswered. This analogy keeps track of activity levels and their relationships. It does not capture everything we would hear in an actual performance, such as pitch or timbre.

I think part of closing the gap I struggled with is identifying the object we are working with and the operation we are applying to it. We begin with a matrix of neurons by time, average over some feature and perform dimensionality reduction. Each step seems reasonable. But averaging each musician’s volume over an entire movement gives us a different object from retaining the moment-to-moment performance. The average might tell us who contributed most while hiding whether they played together or took turns. The same issue appears when we average neural activity over position, trials or time. What we discard helps determine what questions remain answerable.

What Are We Actually Measuring?

I want to begin with four properties of neural population activity: sparsity, the distribution of activity, co-activity and geometry. We can understand the first three by watching the orchestra. Geometry takes a little more construction, but it gives us a way to compare entire patterns of activity rather than describing one musician at a time.

Sparsity concerns how much of the population is active, once we specify what counts as active and over what interval. In the orchestra, we might count how many musicians are playing at each moment. But the number does not tell us their identities. Ten musicians could stop and ten others could begin without changing that count. I will call these two properties the sparsity level and recruitment identity. Measuring the first does not establish the stability of the second.

The distribution of activity concerns how strongly the participating neurons contribute. All the musicians could play at roughly the same volume, or a few could dominate. Everyone could become louder without changing their relative contributions. We also need to distinguish the distribution across musicians at one moment from the distribution of one musician’s volume over the performance. Both are activity distributions, but they summarize different things.

Co-activity concerns how neurons vary together across observations. Two musicians could spend exactly half a movement playing while either playing together or taking turns. Their individual activity levels do not tell us which happened. Correlation, covariance and temporal synchronization describe different aspects of this coordination, so saying that co-activity is preserved is incomplete unless we specify the measurement.

To describe geometry, imagine a display with one volume slider for each musician. The complete set of slider positions is one population state. With $N$ musicians, we write it as

\[\mathbf{x}(t)\in\mathbb{R}^N.\]

Each moment gives us a point in this space. Across the performance, those points form a trajectory. We can ask how far apart two configurations are, which directions the trajectory explores and how much variation occurs along each direction. We cannot generally recover those relationships from a count of active musicians or a summary of their individual volumes.

Neural Coordinates and Intrinsic Geometry

The slider display gives each musician a coordinate. Changing a slider changes the population state. But the coordinates of the states and the relationships among the states are different things. Suppose we exchange the complete volume histories of two musicians. The slider values assigned to those identities change, yet the Euclidean distance between every pair of configurations remains the same. We have rearranged the coordinates consistently across the whole performance.

For these notes, I will use intrinsic geometry to mean the pairwise Euclidean distance relationships among corresponding population states. For states $\mathbf{x}_1,\ldots,\mathbf{x}_T$, these are described by

\[D_{ij}=\|\mathbf{x}_i-\mathbf{x}_j\|_2.\]

This measures the size of the combined change in slider positions between observations $i$ and $j$. Two representations preserve this geometry exactly when their distance matrices agree for every corresponding pair of states. I am using the term in this limited sense, rather than trying to describe every possible notion of manifold geometry.

The word “corresponding” matters. If we compare two performances at matching points in a score, we have supplied a correspondence. If we compare neural states averaged over matching position bins, we have supplied another. The distance matrix does not decide which observations should be matched. We have to establish that before interpreting the comparison.

This gives us a more precise question than whether the performance changed. Did the individual slider histories change? Did the distances among configurations change? Did both change? These questions can have different answers.

Principles of Neural Population Organization

The number of participants does not tell us who they are

Suppose four musicians have volumes

\[\mathbf{x}_1=(2,4,0,0), \qquad \mathbf{x}_2=(0,0,2,4).\]

In both states, two musicians are playing at volumes 2 and 4. The sparsity level and the distribution among active participants are unchanged, but the participating musicians are completely different. Counting active neurons would miss that change in recruitment.

Keeping the musicians fixed does not fix their contributions either. The configurations $(2,2,2)$ and $(1,3,8)$ contain the same active participants, but the balance among them has changed. How many participate, which ones participate and how strongly they participate are separate measurements. None is a complete description of the others.

Individual activity does not determine coordination

Consider two musicians whose activity across four observations is

\[A=(1,1,0,0), \qquad B=(1,1,0,0).\]

They play together for the first half and remain silent for the second. Now reorder the second musician’s activity:

\[B'=(0,0,1,1).\]

Each musician still plays in half the observations, but they now take turns. Their individual activity distributions are unchanged while their correlation has moved from perfectly positive to perfectly negative. A summary of how often each musician plays has discarded the information needed to distinguish these performances.

We can also change activity magnitudes while preserving a particular measure of coordination. Suppose the second musician plays twice as loudly at every observation. More generally, for a positive constant $c$ and nonzero activity variances,

\[\operatorname{Corr}(A,cB)=\operatorname{Corr}(A,B).\]

Pearson correlation retains the relationship between their fluctuations while removing their absolute scales. Covariance generally changes under this rescaling. So even the statement that two musicians “coordinate in the same way” needs a more precise definition. The answer depends on what we choose to measure.

Different participants can preserve the same geometry

Imagine replacing every musician with someone else who follows exactly the same volume history. If the old and new musicians occupy different coordinates in a larger population, recruitment has changed completely. Yet every distance between corresponding population states can remain unchanged. Different participants are expressing the same configuration of relationships.

The mathematical version is a consistent permutation of neural coordinates. More generally, if

\[\mathbf{y}_i=R\mathbf{x}_i+\mathbf{b}, \qquad R^\top R=I,\]

then

\[\|\mathbf{y}_i-\mathbf{y}_j\|_2 = \|\mathbf{x}_i-\mathbf{x}_j\|_2.\]

The translation cancels when we subtract the states, and the orthogonal transformation preserves length. A coordinate permutation is one example. Arbitrary rotations are useful mathematical examples too, although they need not preserve nonnegative activity values. They should not automatically be interpreted as physically possible changes in firing rates or volume.

The same musicians can also remain active while changing their volume histories enough to alter the geometry. Recruitment therefore does not determine whether the relationships among states are preserved. In the orchestra analogy, preserving these distances would not establish that two performances sound identical. It establishes one particular mathematical equivalence between their activity patterns.

Neuron correlations and population geometry describe different relationships

We have been comparing complete slider configurations across moments. We could instead compare the histories of two sliders to ask how two musicians vary together. The first comparison concerns relationships among population states. The second concerns relationships among participants.

For the matrix calculations that follow, let each row of $X$ be a population state and each column be a neuron. An orthogonal change of neural coordinates,

\[Y=XR, \qquad R^\top R=I,\]

preserves distances between rows while generally changing correlations between columns. Conversely, multiplying each column by its own positive constant preserves pairwise Pearson correlations, provided the variances are nonzero, while generally changing distances between rows. This is the orchestra becoming louder by different amounts across musicians: the correlations can remain unchanged even as the distances among volume configurations change.

A correlation matrix and a distance matrix therefore cannot be substituted for one another. They describe different relationships and retain different information.

Distance alone does not tell us where the population went

Suppose we choose one orchestra configuration as a reference and measure how far each later configuration is from it:

\[\Delta\mathbf{x}(t)=\mathbf{x}(t)-\mathbf{x}_{\mathrm{ref}}, \qquad d(t)=\|\Delta\mathbf{x}(t)\|_2.\]

The same distance could arise because the violinists became louder or because the percussionists did. It tells us the size of the combined change in slider positions, but it does not identify which sliders moved or in what direction.

A sequence of configurations can therefore keep changing while remaining at a constant nonzero distance from the reference. A flat distance trace does not establish a stationary population state. Likewise, equal distances in two conditions do not establish equal states. If the reference is the initial state, the distance starts at zero, but the ambiguity still applies to later observations with equal nonzero distances.

Coordinate stability is a stronger requirement than geometric stability

If every musician retains exactly the same volume at every matched observation, all distances between those observations must remain unchanged. The reverse does not follow. We have already seen how exchanging entire volume histories between musicians can preserve distances while changing their individual contributions.

This is why I find statements about a “stable representation” difficult to interpret without further explanation. Are the same neurons maintaining the same activity? Are the distance relationships among states preserved? Does a fixed decoder continue to work? Each claim places different constraints on what is allowed to change. We need to choose the relevant requirement before measuring stability.

Many active participants can produce few independent patterns

Imagine an orchestra with a hundred musicians who all follow the same volume curve, each at a fixed multiple of it. All hundred may be active, but the slider configurations lie along a single line. One changing quantity determines the entire population state. Adding musicians has not added independent directions of variation.

For a slightly less restrictive example, suppose three neurons satisfy

\[x_3(t)=x_1(t)+x_2(t).\]

The third neuron’s activity is determined by the first two, so the population explores at most two independent linear directions. No neuron needs to become silent for this dependence to exist.

For a centered activity matrix, exact linear dimensionality is its rank. Here I mean the dimension of the affine span of the observed states. That differs from the intrinsic dimension of a nonlinear manifold: a curved trajectory can depend on one parameter while spanning several linear directions. Whenever we discuss dimensionality, we need to specify which meaning we intend.

Exact preservation and approximate preservation impose different constraints

If every pairwise distance between corresponding population states is preserved exactly, the dimension of their affine span must also be preserved. An exact collapse into a lower-dimensional affine space would change at least some distances.

But suppose most of the orchestra follows two independent volume patterns while one small section adds a very faint third pattern. Ignoring that section’s independent variation could remove a dimension while barely changing the distances among configurations. The geometry would be approximately preserved, even though its exact dimension changed.

This is the distinction between exact and approximate preservation. Whether the faint pattern matters depends on the question and the precision of the measurement. A small geometric difference can be negligible for one purpose and consequential for another.

Rank and effective dimensionality describe different aspects of variation

Suppose the covariance eigenvalues along three principal directions are

\[\lambda_1=10,\qquad \lambda_2=5,\qquad \lambda_3=0.01.\]

All three directions have nonzero variance, but the third contributes very little. In our orchestra, three independent patterns are present, although almost all variation comes from two of them. Rank counts the nonzero directions. Effective dimensionality describes how concentrated the variance is among those directions.

One measure of effective dimensionality is the participation ratio:

\[d_{\mathrm{PR}} = \frac{\left(\sum_k\lambda_k\right)^2} {\sum_k\lambda_k^2}.\]

Unlike rank, it changes continuously as variance becomes more or less concentrated. An orchestra can become increasingly dominated by a few shared patterns without losing any independent pattern completely. Strong correlations may accompany this concentration, but they do not automatically establish exact linear dependence. Noise makes exact rank particularly difficult to interpret biologically, so the algebraic rank of a measured matrix should not be casually equated with the number of meaningful signal dimensions.

Low dimensionality does not establish stability or specify dynamics

An orchestra could follow only two independent volume patterns while changing those patterns between performances. Another could express many independent patterns and reproduce them exactly. Dimensionality tells us how many directions the activity occupies, or how variation is distributed across them. It does not tell us whether a chosen property remains stable.

A static collection of configurations also leaves out part of the performance. The orchestra could visit the same configurations in a different order or move between them at different speeds. A cloud of states does not retain that information unless we also retain its temporal organization. If our question concerns dynamics, the arrangement of states is only part of what we need to understand.

An Exact Condition for Preserving Intrinsic Geometry

We can now give the distinction between coordinates and geometry an algebraic form. Suppose $X_c$ and $Y_c$ contain corresponding population states in their rows, with each matrix centered by subtracting its mean population state. In the orchestra, this means subtracting each musician’s average volume from their activity at every observation. Each configuration then describes deviations from the average performance.

Define the centered Gram matrices:

\[G_X=X_cX_c^\top, \qquad G_Y=Y_cY_c^\top.\]

Their entries are inner products between centered population states. An entry compares the pattern of deviations across musicians at two observations. The squared distance between those observations can be recovered from the Gram matrix:

\[D_{ij}^2=G_{ii}+G_{jj}-2G_{ij}.\]

The entire centered Gram matrix can also be recovered from the squared distances. If $D^{(2)}$ is the matrix of squared pairwise distances and

\[H=I-\frac{1}{T}\mathbf{1}\mathbf{1}^\top\]

is the centering matrix for $T$ observations, then

\[G=-\frac{1}{2}HD^{(2)}H.\]

These two relationships give us an exact equivalence:

\[G_X=G_Y \quad\Longleftrightarrow\quad D_X=D_Y.\]

Equality of the centered Gram matrices is therefore necessary and sufficient for preserving the Euclidean distance geometry defined here. We can even compare configurations expressed by different numbers of neurons, provided the observations correspond, because both Gram matrices are indexed by observations rather than neurons.

What the variance spectrum leaves out

Writing the centered activity matrix using its compact SVD,

\[X_c=U\Sigma V^\top,\]

gives

\[G_X=U\Sigma^2U^\top.\]

The Gram matrix depends on both the singular values and the left singular vectors. Matching singular values means matching the strengths of the independent modes of variation. It does not tell us how those modes are expressed across the corresponding observations. Two performances could have equally strong modes of variation while using them at different points in the score. Their variance spectra could match while the distances among matched configurations differ.

This also helps distinguish the two products

\[X_cX_c^\top \qquad\text{and}\qquad X_c^\top X_c.\]

The first compares moments in the performance through their population configurations. The second compares musicians through their activity across observations and is proportional to the neuron covariance matrix. The products have the same nonzero eigenvalues, but their entries describe different relationships.

This seems almost embarrassingly simple once written down. But moving between these objects without noticing can lead us to make a claim about relationships among population states using a measurement of relationships among neurons. Sharing a spectrum does not make the two objects interchangeable.

What Does This Tell Us About Remapping?

Returning to the orchestra, saying that the performance changed could mean that different musicians participated, that the balance of volumes shifted, that their coordination changed or that the relationships among complete configurations changed. Those possibilities are related, but one does not establish all the others. I think remapping is more useful as the beginning of a question than as a complete description of what happened.

A change in recruitment does not necessarily change intrinsic geometry, and neither does a change in neuron correlations. Preserving the variance spectrum does not guarantee geometric preservation either. Exact preservation of every pairwise distance does, however, preserve the affine dimensionality of the observed configuration. Understanding these relationships helps us see which conclusions follow from a measurement and which require additional evidence.

Decoding introduces another question. Imagine trying to identify the movement being played from the orchestra’s volume configurations. A successful readout would establish that the movement can be identified from those measurements under the chosen procedure. It would not establish whether the useful information came from a few distinctive musicians, a change in overall volume or a coordinated population pattern. Likewise, a neural decoder tests whether information about a specified variable is accessible through a particular class of readouts under a particular training and evaluation procedure. Its success does not identify which property made that information accessible.

Preprocessing also belongs in the interpretation. Centering subtracts each musician’s average contribution. Z-scoring expresses fluctuations relative to each musician’s own variability, changing the metric used to compare configurations. Averaging over a movement removes the sequence of events within it. Allowing an orthogonal alignment before comparing performances means accepting certain coordinate changes as compatible with the similarity we want to measure. Each operation defines part of the question rather than merely preparing the data for it.

My goal is to understand what each measurement allows us to conclude and what remains unresolved. Before running an analysis, I want to be able to say what changes it would detect, what changes it would miss and which outcomes already follow from its construction. I think this is closer to what Evan meant by looking for what is not obvious. It is difficult to recognize a surprising result if we have not first worked out what was mathematically inevitable.