A Framework for Standardizing Similarity Measures in a Rapidly Evolving Field

Nathan Cloos, Guangyu Robert Yang, Christopher J. Cueva

TL;DR

Researchers at MIT have introduced a framework and Python repository to standardize the "Tower of Babel" of similarity measures used to compare artificial neural networks and biological brains. By decomposing complex measures like Centered Kernel Alignment (CKA) into their mathematical building blocks, the team provides a path toward reproducible, cross-study comparisons in representational alignment.

What Problem Does This Paper Address?

In the quest to understand how AI models relate to the human brain, researchers rely on "similarity measures"—mathematical tools that quantify how closely two systems represent the same information. However, the field is currently a Wild West of implementation.

Even a single popular measure, like Centered Kernel Alignment (CKA), has at least 12 different variations depending on the choice of kernel, estimator, and scoring method. Because different research groups use different naming conventions and code implementations, it is often impossible to tell if a difference in results is due to the underlying science or just a subtle implementation choice (like how a matrix was centered). This lack of standardization hinders the community's ability to build upon previous findings.

Methods

The authors developed a four-step standardization procedure to bring order to this chaos:

  1. Collection: Identifying similarity measures from prominent GitHub repositories.
  2. Interface Standardization: Ensuring all functions handle data arrays (e.g., transposing or centering) in a consistent way.
  3. Compositional Naming: Mapping each implementation to a name that reflects its mathematical components. For example, instead of just "CKA," a measure might be named cka-kernel_linear-hsic_gretton-score.
  4. Consistency Validation: Testing if different implementations assigned the same name actually produce the same output.
Figure 2: Our standardized naming convention unifies existing variations of CKA measures. The convention is designed to reflect the underlying compositional structure by highlighting the kernel method, the HSIC estimator, and the scoring method as the three main components that constitute the various CKA measures. Standardized names separate these components with a dash symbol. See Appendix A.2 for details.

Datasets

To validate their framework, the authors used synthetic datasets. They generated a base Gaussian dataset $X$ with a specific eigenspectrum and created a sequence of comparison datasets $Y$ by adding varying levels of Gaussian noise. This allowed them to precisely control the "ground truth" similarity and test how different measure implementations responded to the same data.

Key Insights and Ideas

  • Implementation details are not "details": The authors show that subtle choices—like which estimator is used for the Hilbert-Schmidt Independence Criterion (HSIC)—can lead to wildly different similarity scores for the exact same data.
  • The Complexity-Consistency Trade-off: A naming convention that is too simple (e.g., calling everything "CKA") leads to high "consistency error" because different algorithms get the same name. Conversely, giving every single piece of code a unique name is too complex. The authors' framework finds the "sweet spot" where names are as simple as possible while maintaining zero consistency error.
  • Deriving the Missing Links: By standardizing the math, the authors can often "derive" versions of a measure that a specific paper didn't originally implement. For instance, if a paper provides a "score" version of CKA, the framework can automatically generate the "angular distance" version.
Figure 1: We register and standardize existing implementations of similarity measures to facilitate comparisons across studies. Dark blue entries are the similarity measures originally implemented in the GitHub repositories associated with their respective papers: [Kriegeskorte et al., 2008a], [Kornblith et al., 2019], [Tang et al., 2020], [Williams et al., 2021], [Ding et al., 2021], [Lange et al., 2022], [Huh et al., 2024], [Soni et al., 2024]. We aim to include all papers that provide code for similarity measures but here we show only a subset of the packages implemented in the full online repository. Light blue entries indicate additional measures that we can automatically derive from the original ones, thereby expanding the grounds for comparison.

Key Results

  • Scale: The repository currently incorporates approximately 100 different similarity measures from 14 different code packages.
  • Zero Consistency Error: The proposed standardized naming convention achieved a consistency error of zero, meaning that any two measures sharing a name in their system are guaranteed to produce identical results.
  • Non-Equivalence: The authors demonstrated that different variations of CKA are not just linearly scaled versions of each other; they provide "different windows" into the similarity between datasets. As shown in Figure 5, the relationship between different CKA variants is often non-linear, meaning you cannot easily convert a result from one paper to another without this standardization framework.
Variations of CKA capture different information; the lack of consistency suggests different variations provide different windows into similarity.

Limitations and Future Work

The authors acknowledge that because the field is rapidly evolving, no naming convention can be truly "definitive" or fixed. Their framework is designed to be flexible and evolve alongside new research.

One technical limitation is that not all variations are mathematically derivable from one another (e.g., you cannot easily derive an unbiased estimator from a biased one just by tweaking inputs/outputs). Future work will likely involve expanding the repository to include even more diverse measures beyond the CKA and RSA families and developing more automated ways to validate new implementations as they are published.

Code available at: https://github.com/nacloos/similarity-repository

Summary updated

BibTeX
@inproceedings{cloos2024framework,
  author = {Nathan Cloos and Guangyu Robert Yang and Christopher J. Cueva},
  title = {{A Framework for Standardizing Similarity Measures in a Rapidly Evolving Field}},
  booktitle = {UniReps @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=vyRAYoxUuA},
}
Figure