Stimulus symmetries can confound representational similarity analyses

Farhad Pashakhanloo, Jacob A. Zavatone-VetharXiv 2026

TL;DR

Representational Similarity Matrices (RSMs) are a standard tool for comparing neural codes across brains and AI models, but they suffer from a major blind spot: stimulus symmetries. This paper demonstrates that external symmetries (like rotation) allow networks to form multiple "functionally equivalent" configurations that produce completely different RSMs. Consequently, standard comparative metrics can falsely conclude that two identical-acting networks have fundamentally different internal representations.

What Problem Does This Paper Address?

How do we know if two neural networks—or a biological brain and an artificial model—are representing the world in the same way? To answer this, researchers frequently turn to Representational Similarity Analysis (RSA) and Centered Kernel Alignment (CKA). These methods rely on Representational Similarity Matrices (RSMs), which track the pairwise similarity of a network's hidden layer responses to a set of stimuli.

RSMs are highly popular because they are invariant to internal rotations of the representation space; if you simply rotate a network's weight vectors, the RSM stays the same. However, the external sensory world is full of symmetries (e.g., rotating an object doesn't change its identity). This paper addresses a critical gap: how do these extrinsic stimulus symmetries affect our ability to compare neural codes? The authors reveal a fundamental mismatch: while a network's decoding performance is invariant to stimulus symmetries, its RSM is not.

Methods

The authors combine mathematical formalization with controlled neural network simulations.

  1. Toy Model: They construct a minimal model of orientation tuning where $n$ neurons with ReLU activations uniformly tile a one-dimensional circular stimulus space ($S^1$). They introduce a "gauge variable" ($\phi$) representing the global orientation offset of this tiling.
  2. Mathematical Formalization: Using group theory, they prove that while decoding accuracy is invariant to changes in this gauge variable, the resulting RSM is highly dependent on it unless the network architecture enforces strict orthogonal equivariance.
  3. Learning Simulations: To see if standard optimization algorithms naturally exploit or resolve this ambiguity, they train two-layer autoencoders using Stochastic Gradient Descent (SGD) with weight decay and $L_1$ regularization (to mimic biological energetic constraints).

Datasets

  • Synthetic Data: Isotropic Gaussian data in 2D, 3D, and 10D spaces to isolate latent spherical symmetries ($S^{d-1}$).
  • Rotated Image Data: A benchmark created by taking a handwritten digit from the Kuzushiji-MNIST dataset and generating 180 rotated versions covering a full circle.
  • Pretrained Models: Feature representations from standard vision models, including ResNet-18, ConvNeXt-Tiny, and DINOv2-S/14-reg, to demonstrate the phenomenon in general-purpose vision architectures.

Key Insights and Ideas

  • The "Gauge" Ambiguity: Just like choosing a coordinate system in physics, a network must choose how to anchor its receptive fields over a symmetric stimulus space. Different anchors (gauges) yield different representational geometries despite providing identical decoding capacity.
  • Nonlinear Breakdown: While linear or equivariant networks map input rotations to clean rotations in representation space (preserving the RSM), common nonlinearities like ReLU break this relationship. Functionally identical nonlinear networks do not have rotationally aligned representations.
Figure 2: Gauge dependence and the geometry of representational manifolds. The schematics show a) the latent space Z = S1, and two examples of b) linear and c) nonlinear embeddings of it in R3. Points are color-coded by the stimulus angle, and angle zero is marked by star (⋆). The left and right columns have a gauge difference of ∆φ = π/2. The two manifolds in (b) can be transformed into each other using an orthogonal transformation, but this is not possible in (c). Consequently, per Section 3.3, the representations in (c) have gauge-dependent RSMs.
  • Representational Drift: Under continual learning with SGD, networks continuously drift along this gauge symmetry over time. This means a network's RSM can change continuously even if its task performance remains perfectly stable, offering an alternative explanation for representational drift observed in biological brains.
  • Sparsity Magnifies the Problem: Biological constraints like energy minimization ($L_1$ regularization) encourage sparse codes (fewer active neurons). The authors show that sparsity significantly increases the volatility and gauge-dependence of the RSM.

Key Results

  • RSM Volatility: In the 4-neuron toy model, changing the gauge variable $\phi$ can alter the off-diagonal elements of the normalized RSM from 0 (purely diagonal) to 0.5, completely changing the apparent geometry.
Figure 1: Gauge-dependent representations in a toy model. a) Left: RF center vectors (wi) of four neurons tiling a one-dimensional ring. To specify a tiling, one must choose a global orientation φ. Right: corresponding angular tuning curves. b) Representations h1 and h2 of two trial stimuli s1 and s2 in the four-dimensional representation space. The angle between h1 and h2 depends on φ. c) RSMs for two values of the gauge variable φ. d) RSM diagonal and off-diagonal entries as a function of φ. The variation of the RSM with φ is the key phenomenon which this work explores.
  • Asymptotic Convergence: The authors analytically derive that RSM variability scales as $O(n^{-2})$ for dense representations. While the confound vanishes as the number of neurons goes to infinity, it remains severe in sparse, low-effective-neuron regimes.
  • Real-World Confounding: When training 1,000 independent autoencoders on rotated Kuzushiji-MNIST digits, the networks achieved identical reconstruction losses but exhibited randomly distributed gauges. This caused the CKA similarity between functionally identical networks to drop significantly (down to ~0.82), purely due to latent symmetry alignment.

Limitations and Future Work

The theoretical framework relies on highly idealized assumptions, such as the perfect invertibility of the data-generating function and strict group invariance of the data metric, which may only hold approximately in real-world scenarios.

To fix this confound, researchers need to design similarity metrics that are explicitly invariant to data symmetries (e.g., using pullback metrics on the intrinsic data manifold). However, current manifold-aware methods require complete, explicit knowledge of the stimulus distribution, which is rarely available. This study highlights an urgent need for the development of symmetry-robust representational metrics.

Summary updated

Abstract

What can representational similarity matrices (RSMs) tell us about a neural code? As the popularity of these summary statistics grows, so too does the need for a more complete characterization of their properties. Here, we show that symmetries in network inputs can confound RSM-based analyses. Stimulus symmetries render many representations functionally equivalent, but these different configurations can lead to different RSMs. These different RSMs reflect qualitatively different representational geometries. We show that stochastic gradient descent or energetic regularization can generate sparse, drifting codes, leading in turn to drifting RSMs. Moreover, we demonstrate that these phenomena are present in networks trained to encode image data, where the symmetry is latent. Our results illustrate the challenges inherent in comparing nonlinear neural codes, when functionally-equivalent representations are not related by a simple rotation.
BibTeX
@misc{pashakhanloo2026stimulus,
  author = {Farhad Pashakhanloo and Jacob A. Zavatone-Veth},
  title = {{Stimulus symmetries can confound representational similarity analyses}},
  year = {2026},
  eprint = {2605.21324},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.21324},
}

Loading related content...

Figure