TL;DR
The authors introduce Representation Topology Divergence (RTD), a new metric for comparing neural network representations based on Topological Data Analysis (TDA). Unlike standard statistical measures, RTD is sensitive to the multi-scale "shape" of data and correlates remarkably well with the actual disagreement in model predictions.
The Problem with Current Metrics
Deep neural networks are often treated as "black boxes." To understand them, researchers try to compare the internal representations—the features learned in hidden layers—across different models, epochs, or architectures.
Existing methods like Canonical Correlation Analysis (CCA) and Centered Kernel Alignment (CKA) are the current standards, but they have a major blind spot: they are largely based on linear correlations or global statistical properties. They often fail to detect complex geometric changes, such as the formation of clusters or "holes" in the data manifold, that fundamentally change how a model perceives information. The authors argue that comparing representations is a geometric problem, not just a statistical one.
Introducing Representation Topology Divergence (RTD)
The core of the paper is the R-Cross-Barcode, a tool derived from persistent homology.
- Point Cloud Comparison: RTD compares two point clouds (e.g., the activations of Layer A and Layer B) that have a one-to-one correspondence, meaning they were generated from the same input images.
- Multi-scale Topology: Instead of picking a single distance threshold to define "similarity," the method uses a "filtration" process. It builds a sequence of graphs (Vietoris-Rips complexes) by connecting points at increasing distance scales.
- The "Cross" Innovation: Standard TDA looks at one point cloud at a time. The R-Cross-Barcode specifically tracks topological features that exist in a "merged" version of the two representations but are missing in the individual ones. This highlights exactly where the two representations diverge in structure.
- RTD Score: The final RTD score is a scalar value calculated by summing the lengths of the "bars" in this barcode. A higher score means a greater topological discrepancy.
To ensure the metric is robust, the authors normalize distances using the 0.9 quantile of pairwise distances, making the score invariant to simple scaling.
Experimental Datasets
The authors validated RTD across a wide variety of settings, ranging from simple synthetic shapes to complex generative models:
- Synthetic Data: "Clusters" and "Rings" experiments designed to test sensitivity to specific topological changes.
- Computer Vision: MNIST (processed via UMAP), CIFAR-10, and CIFAR-100.
- Natural Language Processing: The PTB dataset (via the NAS-Bench-NLP benchmark).
- Large-Scale Models: Pre-trained ResNet-50 and ConvNeXt-tiny on ImageNet-1k.
- Generative Models: The dSprites dataset for evaluating disentanglement in latent spaces.
Key Insights and Results
The "Disagreement" Link
One of the most striking findings is that RTD correlates much more strongly with prediction disagreement than CKA does. If RTD indicates that two layers are different, those models are highly likely to make different errors on the test set.
Sensitivity to Structure
In synthetic tests, RTD perfectly tracked the number of clusters (Kendall-tau correlation of 1.0), while CKA and SVCCA were nearly "blind" to these changes (correlations of 0.23 and 0.14, respectively).
Visualizing Block Structure and Training Dynamics
When comparing layers within a single network (like ResNet-50), RTD clearly reveals the "block structure" of the architecture. It shows that representations remain stable within a residual block and change significantly only at the boundaries. Furthermore, RTD can "watch" a model learn: as training progresses, internal representations move monotonically toward their final state, mirroring the decrease in training error.
Robustness to Shifts and Ensembles
- Distribution Shifts: Under image corruptions (noise, blur, hue changes), RTD tracked the intensity of the shift with a higher correlation to model error than CKA (e.g., 0.966 vs 0.927 for noise).
- Transfer Learning: When fine-tuning a model from CIFAR-100 to CIFAR-10, RTD accurately measured the "topological leap" the model took to adapt to the new task.
- Ensemble Diversity: RTD successfully measured the diversity of model ensembles, correctly identifying that models in a "Classical Ensemble" (different seeds) were topologically more diverse than those in a "Fast Geometric Ensemble."
Limitations and Future Work
While powerful, RTD has a few limitations:
- Computational Complexity: TDA algorithms are traditionally computationally expensive ($O(N^3)$ in the worst case). While the authors used GPU-accelerated libraries to make it practical for batches of 500-1000 points, it remains slower than simple linear metrics like CKA.
- Correspondence Requirement: RTD requires a one-to-one correspondence between points in the two sets. This makes it difficult to compare models trained on entirely different datasets without a shared reference set.
- Hyperparameters: While more robust than CCA, the choice of the 0.9 quantile for normalization is a heuristic that might need adjustment for specialized data types.
Future work could extend RTD to 3D computer vision and more complex generative model evaluations, opening new doors for understanding the geometric nature of neural representations.
Summary updated