TopoAlign: Topology-Aware Visual Representation Alignment

Xinyuan Yan, Rita Sevastjanova, Mennatallah El-Assady, Bei WangarXiv 2026

TL;DR

TopoAlign is a novel visual analytics framework that leverages Topological Data Analysis (TDA) to compare and align high-dimensional neural network representations. By abstracting complex embedding spaces into intuitive "mapper graphs," it allows researchers to visually track how structural features evolve across different training epochs, layers, architectures, and modalities.

What Problem Does This Paper Address?

To understand, select, and improve deep learning models, researchers need to analyze their internal representation spaces—the high-dimensional vectors models use to encode data semantics. A key task here is representation alignment: determining how similarly two different models (or different layers of the same model) organize the same input data.

Existing alignment methods typically rely on aggregate geometric metrics (like Canonical Correlation Analysis or neighborhood similarity) that collapse entire spaces into a single scalar score. These geometric approaches fail to capture the "global shape" and structural organization of the data. They cannot easily show whether a semantic feature is being split, merged, or completely reorganized across models or training stages.

Methods

TopoAlign bridges this gap by treating representation spaces as topological shapes rather than just collections of independent points.

  1. Mapper Graphs: The framework first abstracts high-dimensional point clouds into a graph. Nodes represent local clusters of data points, and edges represent overlapping data between clusters, preserving both local neighborhoods and global topology.
Fig. 2: An illustration of mapper graph construction. Left: a point cloud X equipped with a height function f. Middle: a cover U = {U1, U2, . . . } of X induced by an overlapping cover V = {V1, V2, . . . } of f(X), consisting of six intervals with 25% overlap. Right: the one-dimensional nerve of U produces the mapper graph.
  1. Global Graph Alignment: To compare two different mapper graphs side-by-side, TopoAlign introduces a joint force-directed optimization framework. It applies cross-graph alignment forces that pull nodes sharing common data points into similar spatial layouts across both visualizations.
  2. Automatic Local Alignment Discovery: Using alignment-aware spectral clustering on a joint graph representation, the system automatically detects corresponding subgraphs (regions where the models handle data similarly) and highlights them using Bubble Sets.
  3. Alignment Motifs: Local alignments are automatically categorized into five structural patterns to help users quickly query specific behaviors:
  4. One-to-one: Consistent feature representation.
  5. Fan-out: A single feature splitting into multiple refined subfeatures.
  6. Fan-in: Multiple features merging into an aggregate representation.
  7. Crossing: Complex feature reorganization and mixing.
  8. Vanishing/Appearance: Features unique to only one model.
  9. Multiscale Membrane Visualization: To prevent visual clutter from dense cross-graph edges, TopoAlign uses a conditional-entropy-guided aggregation strategy to progressively merge nodes into "supernodes," allowing multi-scale, layer-like inspection of local correspondences.

Datasets

The authors evaluated TopoAlign using two primary datasets across language and multimodal tasks:

  • STREUSLE v4.2: A dataset containing 4,872 annotated words used to fine-tune BERT-base and BERT-Tiny on a word-level semantic classification task (Supersense Role labels like location and time).
  • MS COCO (Validation Set): Consisting of 5,000 image-caption pairs used to evaluate the multimodal representation alignment of CLIP's image and text encoders.

No new benchmarks were introduced.

Key Insights and Ideas

  • Fine-Tuning as Disentanglement: By comparing BERT at epoch 2 versus epoch 6, TopoAlign visually demonstrates that fine-tuning progressively untangles mixed semantic categories, moving from messy, overlapping clusters to cleanly separated topological components.
  • The Lexical-to-Semantic Shift: Comparing early layers (Layer 3) to final layers (Layer 12) in BERT reveals a clear crossing motif. Early layers group words strictly by their surface form (lexical identity), whereas later layers completely reorganize these groups into task-aligned semantic categories.
  • Capacity Constraints Visualized: Comparing BERT-Base to BERT-Tiny shows that the smaller model exhibits highly entangled topological structures. It struggles with complex distinctions (e.g., separating different semantic meanings of the word "like"), which the larger model separates easily.
  • Modality Granularity in CLIP: TopoAlign reveals that CLIP's image and text spaces partition concepts differently. For instance, visually diverse scenes (tennis players, dining tables) often map to a single coarse text concept (Fan-in), while a single image concept can map to multiple highly specific textual descriptions (Fan-out).

Key Results

The authors validated TopoAlign through detailed case studies and a preliminary expert study with 5 deep learning researchers:

  • Global Layout Effectiveness: Experts confirmed that the coordinated global layout eliminated the tedious need to manually inspect individual node labels to find correspondences between graphs.
  • Motif Discovery: The automated motif classification successfully accelerated the discovery of training anomalies (like potential overfitting shown by unnecessary cluster splitting) and model weaknesses.
  • Quantitative Backing: Topological structures identified as "entangled" or "mixed" by TopoAlign directly correlated with lower downstream model prediction accuracies (e.g., a mixed cluster in BERT-Tiny yielded only 58% accuracy compared to BERT-Base's 100% on the same clean structures).

Limitations and Future Work

  • Cluster-Level Resolution: Because the alignment operates on clusters (nodes) rather than individual points, it can produce low-quality alignments if the underlying representation spaces are completely divergent and lack clear node correspondences.
  • Manual Semantic Interpretation: While the framework integrates GPT-4o to summarize text within nodes, users must still manually reason about the semantic relationships across crossing edges.
  • Pairwise Restriction: TopoAlign currently only supports the comparison of two graphs at a time. The authors note that future work will extend this to sequential multi-graph comparisons to track representations continuously across all layers or training epochs simultaneously.

Summary updated

BibTeX
@misc{yan2026topoalign,
  author = {Xinyuan Yan and Rita Sevastjanova and Mennatallah El-Assady and Bei Wang},
  title = {{TopoAlign: Topology-Aware Visual Representation Alignment}},
  year = {2026},
  eprint = {2605.25541},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.25541},
}
Figure