Source-linked AI summary
Representation Topology Divergence: A Method for Comparing Neural Network Representations
Serguei Barannikov, Ilya Trofimov, Nikita Balabin, Evgeny Burnaev
TL;DR
Comparing representations is ill-posed without a ground-truth answer, and few methods study them independently of downstream-task quality. RTD compares the multi-scale topology of paired point clouds, including clouds in different ambient spaces; experiments report intuitive alignment, topological sensitivity, and strong comparisons with existing metrics.
Problem
Representation comparison is ill-posed without a ground-truth answer, and only a few methods study representations independently of downstream-task quality.
Source: §1 · p. 1Method
RTD measures multi-scale topological dissimilarity between equal-size point clouds with one-to-one correspondence, even when they lie in different ambient spaces.
Source: §1 · pp. 1–2Results
RTD agrees with intuitive similarity, is sensitive to topological structure, correlates with prediction disagreement, and outperforms CKA, IMD, and SVCCA in the reported experiments.
Source: §1 · p. 2Takeaways & Limitations
The paper applies RTD to representation analysis in computer vision and NLP and describes it as a general tool for comparing paired point clouds, including in 3D computer vision.
Source: §4 · p. 8
Abstract
from arXiv · showhide
Comparison of data representations is a complex multi-aspect problem that has not enjoyed a complete solution yet. We propose a method for comparing two data representations. We introduce the Representation Topology Divergence (RTD), measuring the dissimilarity in multi-scale topology between two point clouds of equal size with a one-to-one correspondence between points. The data point clouds are allowed to lie in different ambient spaces. The RTD is one of the few TDA-based practical methods applicable to real machine learning datasets. Experiments show that the proposed RTD agrees with the intuitive assessment of data representation similarity and is sensitive to its topological structure. We apply RTD to gain insights on neural networks representations in computer vision and NLP domains for various problems: training dynamics analysis, data distribution shift, transfer learning, ensemble learning, disentanglement assessment.
1. Introduction
The introduction frames neural-representation comparison as an ill-posed problem with few task-independent methods, and proposes a topological approach for comparing paired representations. Experiments report that RTD reflects intuitive similarity and captures topological differences.
1. Introduction
- Representation comparison lacks a ground-truth answer, and only a few methods study neural representations without relying on downstream-task quality.Source: §1 · p. 1
- Existing geometric and topological methods either omit one-to-one correspondence or restrict point clouds to the same ambient space.The introduction presents these constraints as motivation for RTD’s paired-cloud setting.Source: §1 · p. 1
- RTD measures multi-scale topological dissimilarity between equal-size representations with one-to-one point correspondence, including point clouds in different ambient spaces.It is defined based on the R-Cross-Barcode.Source: §1 · pp. 1–2
- Across computer vision and NLP applications, RTD matches intuitive similarity, detects topological differences, correlates with prediction disagreement, and outperforms CKA, IMD, and SVCCA.The reported applications include training dynamics, distribution shift, transfer learning, ensemble learning, and disentanglement.Source: §1 · p. 2
2. Comparing Neural Network Representations
The section develops a multiscale graph-topology comparison for corresponding embeddings, then summarizes discrepancies with RTD from R-Cross-Barcode interval lengths. It specifies the construction and computation, including distance-scale normalization and repeated sampling.
2. Comparing Neural Network Representations
- The comparison assumes two embeddings of the same sampled objects, potentially in different ambient spaces, and studies thresholded simplicial approximations across scales rather than choosing one threshold.Source: §2 · p. 2
2.1. Topological features for a pair of weighted graphs
- At each threshold, added edges can merge clusters or reconnect distant parts; H0-kernel and H1-cokernel dimensions count these discrepancies across thresholds via an auxiliary-graph barcode computation.Source: §2.1 · p. 3
2.2. R-Cross-Barcode
- The R-Cross-Barcode uses a doubled-vertex graph and Vietoris-Rips filtration to record topological discrepancies between embeddings over thresholds.Source: §2.2 · pp. 3–4
2.3. Representation Topology Divergence.
- RTD sums R-Cross-Barcode interval lengths, and the usual score averages the two directional RTD values.Source: §2.3 · p. 4
- If directional RTDs vanish in every degree, the weighted graphs have the same barcodes and their topological features coincide at every threshold.Source: §2.3 · p. 4
2.4. Algorithm
- The algorithm aligns pairwise-distance 0.9 quantiles, sums 1D barcode lengths in both directions, and averages repeated samples; about 10 iterations usually suffice.Source: §2.4 · pp. 4–5
- RTD perfectly detects cluster structures in comparisons of one cluster with 2–12 clusters, while rival measures fail.Source: Figure 3 · p. 5
- Distance matrices cost O(|V|^2(D + D̃)); barcode computation is worst-case cubic in simplex count but is often fast because real-data boundary matrices are sparse.Source: §2.4 · p. 5
3. Experiments
The experiments test whether RTD tracks changes in topology and representation similarity across synthetic point clouds, UMAP embeddings, neural architectures, and several network-analysis settings. Across these settings, RTD aligns with intuitive similarity judgments and shows high correlation with prediction disagreement.
3.1. Experiments with synthetic point clouds
- For synthetic clusters, RTD’s Kendall-tau correlation was 1.0, while CKA was 0.23, IMD 0.43, and SVCCA 0.14; for rings, RTD and IMD were 0.8, while CKA and SVCCA were -0.2.The cluster experiment reports RTD tracking topological complexity while alternatives mostly fail; in the rings experiment, RTD almost ideally reflects complexity changes.Source: §3.1 · p. 6
3.2. Comparing representations from UMAP
- Across UMAP representations of MNIST, RTD follows a monotonic pattern as the neighbor count changes, whereas CKA values are described as chaotic.The UMAP neighbor setting changes cluster structure, from crisp local clusters at low values to often-overlapping clusters at high values.Source: §3.2 · p. 6
3.3. Experiments with NAS-Bench-NLP
- For 90 randomly selected NAS-Bench-NLP architectures, similar word embeddings correspond to similar log perplexity, and RTD satisfies the triangle inequality for 97% of architecture triplets.The embeddings contain 400 dimensions for 10,000 words per architecture; Figure 5 colors the MDS visualization by log perplexity.Source: §3.3 · p. 6, Figure 5 · p. 6
3.4.1. TRAINING DYNAMICS
- During training, representations become more similar to their final-epoch versions, and RTD follows the same dynamics as prediction disagreement while correlating with disagreement better.The metrics are scaled by their maximum values for this comparison.Source: §3.4.1 · p. 7
3.4.2. LAYERS
- Across trained-network layer blocks, RTD and 1−CKA show similar patterns, including small adjacent-layer differences and substantial changes at the final ResNet-20 block.The comparisons cover VGG-11 and ResNet-20; similar experiments are also reported for ImageNet-1k-pretrained ResNet-50 and ConvNeXt-tiny.Source: §3.4.2 · p. 7, Figure 6 · p. 7
3.4.3. DATA DISTRIBUTION SHIFT
- Under image distribution shifts, RTD and other metrics change monotonically with transformation strength, and RTD correlates with prediction disagreement better.The shifts include noise, blur, grayscale, and hue changes.Source: §3.4.3 · p. 7, Table 2 · p. 7
3.4.4. ENSEMBLES
- For classical and Fast Geometric Ensembles, RTD measures diversity on the same scale as prediction disagreement.The comparison averages metrics across all member pairs for four models of each ensemble type; FGE is described as having lower diversity.Source: §3.4.4 · p. 7, Table 3 · p. 8
3.4.5. TRANSFER LEARNING
- During CIFAR-100-to-CIFAR-10 transfer, RTD has high correlation with disagreement; additional experiments report disentanglement assessment and agreement between BigGAN representation comparisons by RTD and image comparisons by FID.The transfer experiment uses full fine-tuning with a small learning rate for the convolutional part; the authors also note continual learning as a possible application for tracking representation changes.Source: §3.4.5 · p. 8, §3.5 · p. 8, Table 4 · p. 8
4. Conclusions
The paper presents RTD as a topological approach to comparing neural network representations and reports that it matches natural assessments of their similarity. It applies RTD across computer vision and NLP problems and identifies possible broader uses for the tools.
4. Conclusions
- RTD coincides with the natural assessment of representation similarity.The paper applies it to neural-network representations in computer vision and NLP.Source: §4 · p. 8
- RTD is used to study training dynamics, distribution shift, transfer learning, ensemble learning, and disentanglement.Source: §4 · p. 8
- R-Cross-Barcode and RTD are general tools for comparing corresponding point clouds, and RTD correlates strikingly well with model-prediction disagreement.The authors identify 3D computer vision as one possible application and describe prediction disagreement as a topic for further research.Source: §4 · p. 8
A. Background on Simplicial Complexes. Barcodes
Simplicial complexes and their homology provide a way to represent topological features, while filtrations track those features as complexes grow. The appendix uses exact sequences to relate changes in homology to features measured by the R-Cross-Barcode.
A. Background on Simplicial Complexes. Barcodes
- A simplicial complex is a collection of simplexes closed under taking subsets; one containing only vertices and edges is a graph.A k-simplex is a set of k + 1 vertices.Source: A. Background on Simplicial Complexes.… · p. 12
- Homology groups encode topological features: H0 corresponds to connected components, while H1 corresponds to classes of nontrivial closed paths.Source: A. Background on Simplicial Complexes.… · p. 12
A.1. Exact sequence and topological features
- For graph inclusions, the H0-map kernel represents merged clusters and the H1-map cokernel represents new cycles; the exact-sequence result reduces feature calculation to H1 of the Rips complex.The appendix identifies that calculation with R-Cross-Barcode1(P, P̃).Source: A. Background on Simplicial Complexes.… · p. 12, §A.1 · p. 12
A. Background on Simplicial Complexes. Barcodes
- A filtration is a nested sequence of complexes, and its barcode records when each basic topological feature appears and disappears.Source: A. Background on Simplicial Complexes.… · p. 12
A.2. Construction of R-Cross-Barcode
The R-Cross-Barcode construction uses a union-like graph built from two representations and tracks topological features associated with failures of induced homology maps to be isomorphisms. The CKA discussion describes its kernel-based formulation and questions its use for comparing different layers of one network.
A.2. Construction of R-Cross-Barcode
- The Rips complex of Gmin(w, w̃) includes edges whose distances are below α in at least one representation.Source: §A.2 · p. 13
- R-Cross-Barcodes list topological features that describe failures of homology maps induced by inclusions to be isomorphisms.Source: §A.2 · p. 13
- The construction introduces a weighted graph with a doubled vertex set, adding a paired vertex for each original vertex and two extra vertices, O and O′.Source: §A.2 · p. 13
B. Discussion of CKA
- CKA compares two equal-size series using kernel matrices, with HSIC as its dependence measure.HSIC is described as an empirical estimate of the Hilbert-Schmidt norm of the cross-covariance operator.Source: B. Discussion of CKA · p. 15
- CKA use for different layers is described as questionable when Y = f(X), because the representations are tightly dependent and their joint distribution factorizes as P(Y|X)P(X).Source: B. Discussion of CKA · pp. 15–16
C. Details on experiments with synthetic point clouds
The synthetic-cloud experiments report runtime comparisons for RTD, CKA, IMD, and SVCCA on cluster and ring data. A figure presents R-Cross-Barcodes for a one-cluster cloud compared with clouds having varying cluster counts.
C. Details on experiments with synthetic point clouds
- Figure 11 shows R-Cross-Barcodes for a one-cluster cloud against clouds with 2, 3, 4, 5, 6, 10, or 12 clusters, with the two comparison directions in separate rows.Source: Figure 11 · p. 16
- The runtime comparison reports total wall time for experiments with synthetic point clouds.Source: C. Details on experiments with… · p. 16
- 19.7 s RTD vs 0.07 s CKA, 83 s IMD, and 0.03 s SVCCA on clusters; rings: 144 s RTD, 0.7 s CKA, 91 s IMD, and 0.6 s SVCCA.Source: C. Details on experiments with… · p. 16
D. Details on the “rings” experiment
The rings experiment reports that RTD detects topological changes across point clouds with five, four, three, two, and one rings.
- RTD perfectly detects topology changes when comparing point clouds containing five, four, three, two, and one rings.Source: Figure 12 · p. 16
E. Experiment with BigGAN
The BigGAN experiment compares representations and generated images as latent codes receive progressively stronger Gaussian noise. RTD correlates more highly with FID than CKA does.
- The experiment compares a baseline set of 100 random latent codes with sets formed by adding Gaussian noise whose standard deviation increases from 0.001 to 0.25.Source: E. Experiment with BigGAN · p. 16
- The noisy latent-code sets and a “husky” class encoding are passed through BigGAN to obtain internal representations and generated images for comparison.RTD and CKA compare the representations; FID compares the image sets.Source: E. Experiment with BigGAN · pp. 16–17
- RTD correlates with FID at 0.97, compared with 0.79 for CKA.The comparison uses RTD and CKA on internal representations and FID on generated image sets.Source: E. Experiment with BigGAN · p. 17, Figure 14 · p. 17
F. Details on experiments with convolutional networks
The convolutional-network analyses examine metric behavior under data distribution shifts, including correlations with disagreement and error rate and dynamics under image transformations.
- The ResNet-20 shift analyses correlate RTD and 1−CKA with disagreement and error rate.Source: Table 5 · p. 17, Table 6 · p. 18
- A figure tracks scaled metric dynamics as different image transformations are applied monotonically to ResNet-20 representations.Source: Figure 15 · p. 18
G. Experiments with disentanglement
The disentanglement experiment assesses whether generated-data slices along interpretable latent factors have similar topology. The MNIST UMAP analysis also reports inconsistent CKA comparisons across embeddings.
G. Experiments with disentanglement
- The experiment compares generated-data slices at different latent-factor values, using nearby samples from a slice and a shifted sample with a natural pointwise mapping.RTD estimates the homological similarity of the generated samples.Source: G. Experiments with disentanglement · p. 18
- Except for the categorical shape axis, RTD estimates significantly less topological dissimilarity for axis-aligned dSprites slices than for random directions.The authors note that the approach may not apply to the categorical factor; they calculate RTD in pixel space and state it can also be applied to image representations on more complex datasets.Source: G. Experiments with disentanglement · p. 18
H. Details on dimensionality reduction of MNIST with UMAP
- CKA ranks UMAP embeddings inconsistently: U(10) is closer to U(200) than U(20), while U(200) is closer to U(10) than U(100).Source: H. Details on dimensionality reduction… · p. 19
I. Additional experiments
Alternative similarity measures did not outperform linear-kernel CKA in the clusters experiments, while RTD highlighted the block structure of trained network architectures better than CKA and SVCCA. The section also includes visualizations of latent-space directions and MNIST embeddings, plus a dSprites disentanglement evaluation table.
I. Additional experiments
- For the clusters experiments, RBF-kernel CKA had Kendall-tau correlations of 0.23, 0.04, and 0.14, while topological loss scored -0.52.The tested alternatives were not better than linear-kernel CKA, and the topological-loss result was described as poor.Source: §I · p. 19
J. Internal similarity of Neural Network layers
- The accompanying materials show dSprites along random and axis-aligned latent directions, MNIST UMAP embeddings across five neighborhood sizes, and a table evaluating disentanglement across latent directions.The UMAP neighborhood sizes are 10, 20, 50, 100, and 200.Source: Table 10 · p. 19, Figure 16 · p. 20, Figure 17 · p. 20
- RTD highlights ResNet-50’s [3, 4, 6, 3] block structure more clearly than CKA and SVCCA in layer-output comparisons.The architecture’s block sequence appears as sub-squares of corresponding sizes in the RTD comparison.Source: J. Internal similarity of Neural… · pp. 19–20, Figure 18 · p. 20