Neural networks encode inputs as high-dimensional vectors, known as representations, that capture how models process data by encoding task-relevant structure and semantics. Representation alignment refers to the degree to which different models, layers, or training conditions produce similar representations for the same inputs, with important implications for model interpretation, selection, and robustness analysis. Existing approaches to measure alignment primarily rely on geometric properties, such as neighborhood and cluster similarity, offering limited insight into the global organization of representations. In this work, we present TopoAlign, a topology-aware framework for visually comparing model representations from a structural perspective. Leveraging mapper graphs from topological data analysis, TopoAlign jointly analyzes graphs constructed from representations of shared inputs across different models or layers. The framework supports a top-down comparative workflow: it first performs global structure alignment via joint force-directed optimization to produce coordinated graph layouts; it then identifies local correspondences through automated detection of structurally matching regions, visualized with Bubble Sets; and finally it enables fine-grained pattern inspection through motif-based queries and membrane-inspired visualizations. We demonstrate TopoAlign through case studies on language and multimodal models, complemented by expert feedback. Our results show that TopoAlign provides meaningful insights into representation structure and alignment from a topological perspective.
翻译:神经网络将输入编码为高维向量(即表征),通过编码任务相关结构与语义来捕捉模型处理数据的方式。表征对齐指不同模型、层或训练条件下对相同输入产生相似表征的程度,这对模型解释、选择及鲁棒性分析具有重要意义。现有对齐度量方法主要依赖几何属性(如邻域与聚类相似性),对表征的全局组织方式提供有限洞察。本文提出TopoAlign——一种从结构视角对模型表征进行可视化比较的拓扑感知框架。该框架利用拓扑数据分析中的Mapper图,联合分析不同模型或层对共享输入构建的表征图。TopoAlign支持自上而下的比较工作流:首先通过联合力导向优化实现全局结构对齐,生成协同图形布局;继而通过自动检测结构匹配区域(以Bubble Set可视化)识别局部对应关系;最终通过基于基序的查询与膜启发式可视化实现细粒度模式检查。我们通过语言与多模态模型的案例研究及专家反馈验证了TopoAlign的效能。结果表明,TopoAlign能从拓扑视角为表征结构与对齐提供富有意义的洞见。