- Rating
- 5
- Clarity
- 3
- Confidence
- 5
- Originality
- 4
- Quality
- 3
- Significance
- 3
Read review
Summary
This paper introduces a new metric for comparing artificial neural networks based on Riemannian geometry. In particular, for two networks, the Riemannian metric is calculated via the Jacobian across the input manifold, following which they are compared using a spectral ratio metric. They demonstrate how intrinsic and extrinsic geometric similarity are distinct and go on to apply their metric to study rich versus lazy hidden representations in MLPs, memory maintenance in RNNs and SSMs, and information geometry in text embeddings in diffusion models.
Strengths and weaknesses
Strengths
The paper is mathematically rigorous, the motivation is strong, and the method appears to be fast and has useful properties. It appears like it has a wide range of applications and the interpretations of the results seem reasonable. I especially thought the section of comparing information geometry was highly novel. Overall, the paper reads well and the method seems valuable and genuinely novel in the field.
Weaknesses
I have a number of concerns but all are tractable. If they are addressed satisfactorily I would be happy to raise my score:
-
The authors seem to have missed the paper on Topological RSA (Lin and Kriegeskorte PNAS 2024), which proposes utilizing nonlinear geodesic distances to extend RSA for intrinsic geometry, as well as other threshold metrics for comparing topology of data. This is a necessary baseline, as it’s the most directly similar to the proposed MSA metric. It was also shown (Alex Williams 2024) that nonlinear CKA can capture some of the features as topological RSA, so it seems like this metric’s parameters were not tuned carefully in the paper’s application (nor was it ever stated how or why some particular parameters were chosen).
-
Similarly, it seems like DSA was also tuned improperly, given that there’s no clear diagonal of zeros in the distance matrix (a zero order sanity check). I looked into their package and found a number of useful tips: they noted that the GL(n) metric (which was not in the original paper) didn’t converge well and should be replaced with the Wasserstein metric on eigenvalues. Also, they mention that the parameters should be tuned by minimizing DMD prediction error, but I didn’t see any justification for parameter selection here.
-
The paper puts MSA on even footing with the other metrics, stating that all are “proposed to compare the representations of neural networks.” While this is not strictly untrue, it’s important to note that MSA requires having access to the model itself, while the others are data driven, and most were developed to be able to used on experimental data as well. That is a limitation of MSA and needs to be mentioned, perhaps in table 1. It may also be worth adding baselines that operate in a similar fashion as well.
-
On the distance metric: The spectral ratio distance is not intuitively described in what it is trying to compare and why that is useful. Is the motivation just that it satisfies particular metric properties, or does it actually capture something relevant? I didn't understand where the distance metric came from, or what the other metrics were in the Table (AIRM and Hilbert). Likewise, I’m not certain coordinate invariance makes the metric more suited for similarity analyses. Why is this the case?
Small issues:
-
Figure 8 doesn’t have a description for the leftmost panel and what the trajectory on it represents.
-
Figure 7 panels are referenced out of order and there’s not enough detail in the legend to interpret.
-
Figure 10c should swap time and guidance parameters so that it is more legible in following similarity over time.
-
Procrustes is often used on whitened data and using an angular arccos metric, which should be mentioned in table 1 as well.
-
The first sentence of the intro is incorrect—neuroscientists have been using similarity metrics for decades, which has at least in part inspired similarity metrics in ML.
-
The paper’s usage of the term SSM also doesn’t appear to be in line with the literature—SSMs are composed of linear dynamical systems followed by MLPs in each layer. The models here are more like nonlinear multilayer RNNs with structured matrices, unless I’m misreading. Either the models or terminology should be reframed.
Questions
-
In the RNN analysis, how do you define the Riemannian metric on the time dimension? I vaguely understood it as defined via the computation of the Jacobian , where is the hidden representation at time and is the input at time , but then the overall Jacobian structure is a 4-tensor (hidden state dim x hidden state time x input dim x input time) and how this gets to the Riemannian metric was not clear. The line "Specifically, we consider time as a separate coordinate, forming a 3-dimensional manifold..." further confused things for me. A more formal or algorithmic description here would be useful.
-
How does the metric “compare nonlinear dynamics” in the sense of comparison to dynamical structure?
-
Can you explain further what the metric captures more specifically and intuitively, versus the other Riemannian distances?
-
When would one pick the other distances (AIRM and Hilbert)?
-
How was RSA applied on the RNNs? Was it averaged or time? Would specific times or layers be able to separate the model classes better?
-
Given the similarities to topological RSA (and variants) why pick MSA over it?
Limitations
The limitation of requiring the models should be added, likewise that both models must take in the same input (or partly the same), neither of which are necessary for other methods.
Paper formatting concerns
None
Final justification
Authors and I had a solid discussion that lead to a good detail of clarification and improved experiments + theoretical detail. They engaged well with related work that wasn't included previously and even derived a theoretical relationship between their metric and existing ones. They've agreed to improve sections that weren't clear on first read and expand detail on limitations and experiments. These motivated raising my score to a 5.
(note: I changed my contribution type to general, I hope that has registered).
Summary
We thank the reviewer for their detailed and constructive feedback which has helped us improve the paper.
Overall, we have added the following:
We respond to each point below.
Response to Weaknesses:
W1. kCKA and MSA. We thank the reviewer for this feedback, which pushed us to think deeper about the relationship between nonlinear CKA (CKA with RBF kernel, “kCKA” in the paper) and the pullback metric. In short, it can be shown that in the limit of dense sampling, kCKA with an RBF kernel reduces to computing: ∫Mf(G(1),G(2))dvolg where: f(G(1),G(2))=det(G(1)+G(2))−1/2, and G(1), G(2) are the pullback metrics associated with networks (1) and (2) (we have dropped the normalizing factor for brevity). Similarly to the SR in MSA, the integrand f is a function on the SPD cone but its form is fundamentally different, and arguably less suited for geometric similarity analysis:
Taking the mean of the metrics doesn't distiguish networks expanding the same vs. different input directions. Consider jointly diagonalizable metrics G(1)=VΛ1V⊤ and G(2)=VΛ2V⊤ with opposing expansions/compressions: λk(1)=2k and λk(2)=2−2/k. Their contribution to the dissimilarity is f(G(1),G(2))=∏k(2λk(1)+λk(2))−1/2=1. This is the same dissimilarity as that between the Euclidean metric λk(1)=λk(2)=1 and itself, which is paradoxical.
We find this connection between MSA and kCKA could be insightful to the reader, and will include its derivation in the appendix along with a reference to it in the main text.
TopRSA. TopRSA is not explicitly a similarity measure: the paper proposes computing the input x input representational dissimilarity matrix of a single network. But as the reviewer pointed out, Williams 2024 [45] shows that this is equivalent to the first step of kCKA. Performing the additional step of computing the normalised Hilbert-Schmidt inner product between the centered TopRSA matrices of two networks gives a full nonlinear kCKA distance metric.
While TopRSA has a geometric interpretation when studying a single network’s TopRSA matrix (in terms of geodesics), when used as a similarity measure between networks through kCKA it becomes non-geometric because f above is not coordinate invariant (while MSA is thanks to the SR).
We agree that this relationship deserves a better description in the main text. We will cite TopRSA in the introduction and discuss its relationship to kCKA [45] in the appendix.
Note that we had originally performed kCKA(/TopRSA) on the rich-lazy example (see “kCKA” fig. 6b). We have now also performed kCKA(/TopRSA) on the RNN-SSM example and will add these results to the manuscript.
W2. DSA hyperparameter tuning. We sincerely thank the reviewer for these tips, as it helped us to better tune DSA's hyperparameters. We have now repeated these analyses with the suggested changes, leading to more robust results.
As suggested, optimization over O(n) seems to yield better convergence than over GL(n), which removes the non-1 diagonal artifacts.
Table 1. DSA similarity matrix with O(n) and cosine similarity.
Tab 2. DSA dissimilarity matrix with O(n) and Wasserstein (eig) distance.
In short, DSA correctly uncovers that TrainedRNN is most similar to TrainedRNN, followed by TrainedSSM, UntrainedRNN, UntrainedSSM. However, the relative ordering of similarities remains different from that of MSA, confirming that MSA and DSA do in fact uncover different features.
We will correct Fig. 7d and add a supplementary figure showing the DSA similarity matrix with different hyperparameters. We will also provide additional details regarding hyperparameter choices of DSA in the appendix (including variability of the results to the rank and step size choice).
W3. MSA vs data-driven metrics. We believe that using information regarding the function mapping the input manifold to the representation is a strength rather than a limitation. In nearly all applications of similarity metrics in AI, and many in computational neuroscience modelling, the equation of the model is readily available, yet the vast majority of existing methods such as CKA do not leverage that fact.
In our numerical analyses, we operated in the dense sampling regime discussed above, where kCKA and MSA differ only through the choice of integrand (SR versus f above). Hence, differences between the methods are due to this distinction, rather than their model-based versus data-driven formulations. A similar argument can be made regarding RSA/linearCKA.
For data applications of MSA, this simply means that a model must be fit to the data (e.g. a kernel, as kCKA does) before its geometry can be compared to a task-trained model. A potential limitation of this approach is that different models fit to data (e.g. splines vs. neural net) may infer different pullback metrics from finite data due to implicit biases.
We will: 1) discuss in the methods section how to apply MSA to data and 2) explicitly discuss the limitations of this approach compared to existing data-driven metrics.
Response to Questions
Q1. Definition of the pullback metric in RNN analysis. We applied MSA two ways (Fig 7c and 7d). At time point t, for a given x(0), the RNN state is a function of the inputs and time: RNN(θ1,θ2,t)=x(t) (similarly for the SSM). Previous work has shown that the state of such a system lies on the manifold and that its pullback metric can be defined [26].
In 7c, to visualize how the geometry of the task representation evolved over time, we compared the similarity of the geometry of the torus of RNN activity at two different, fixed time points t and t′: MSA(RNN(⋅,⋅,t),RNN(⋅,⋅,t′)). This entailed calculating the Jacobian ∂θi∂x(t)∈R2.
In 7d, we calculate MSA between the RNN and SSM over all time by treating time the same as the inputs: MSA(RNN(⋅,⋅,⋅),SSM(⋅,⋅,⋅)). This entailed calculating the Jacobian ∂Θ∂x(t)∈R3 where Θ=[θ1,θ2,t].
We will clarify this distinction in the text.
Q2. How does MSA compare nonlinear dynamics? In “input-time MSA” (7d as explained above), the r.h.s. of the dynamical system appears directly as one of the terms in the pullback metric, i.e., ∂t∂x(t). Thus input-time MSA captures information about how neural activations are changed over time via the nonlinear dynamics of the models. We believe there may be a link to the Koopman theory underlying DSA (see discussion with reviewer 3sMz), which would be an interesting direction for future work.
We will specify this in the revision.
Q3-4. Intuition behind the Spectral Ratio the AIRM and Hilbert metrics. These metrics are standard Riemannian metrics on the SPD cone (the smooth manifold of SPD matrices). These induce geodesic distances between SPD matrices with closed form equations based on generalized eigenvalues.
The intuition behind the SR is straightforward: it is the ratio of the smallest to largest local expansion of space on the input manifold, under the neural representational geometry.
The main motivation for the SR is because it is naturally bounded (Table 1, lines 91-93). This makes it more attractive for similarity analysis, where it is often preferable to obtain a normalized score between 0 and 1. Another option could be to apply a saturating nonlinearity to the AIRM distance, but this may not necessarily preserve the triangle inequality, and there is an arbitrariness in the choice of nonlinearity.
That said, we will discuss that it is possible to use MSA while replacing the SR distance with other distances on the SPD cone, if an unbounded distance is preferred, or if information regarding all directions of local expansions must be preserved.
Q5. RSA on RNNs. RSA was applied to the flattened neurons x time-points matrix. Our goal here was to compare the full trajectories to methods that capture dynamics directly (MSA and DSA). However we agree that particular time points could separate the models better, which would complement the Fig 7c time x time MSA similarity well.
We will clarify the description of RSA and include the time-resolved RSA analysis.
Q6. MSA vs. TopRSA. Please see response to Weaknesses 1.
Small issues:
1-4. We will add the requested details to figures 8, 7 & 10 as well as Table 1.
5. Fair point; we will replace "Recent interest” with “Growing interest".
6. Thanks for pointing this out. We included tanh in the SSM for a fairer comparison with the RNN but we agree that may lead to confusion. We have now rerun the analysis without the tanh (i.e., two LDS chained by a one-layer MLP) and added them to the appendix.