English

When Are Two Networks the Same? Tensor Similarity for Mechanistic Interpretability

Machine Learning 2026-05-15 v1

Abstract

Mechanistic interpretability aims to break models into meaningful parts; verifying that two such parts implement the same computation is a prerequisite. Existing similarity measures evaluate either empirical behaviour, leaving them blind to out-of-distribution mechanisms, or basis-dependent parameters, meaning they disregard weight-space symmetries. To address these issues for the class of tensor-based models, we introduce a weight-based metric, tensor similarity, that is invariant to such symmetries. This metric captures global functional equivalence and accounts for cross-layer mechanisms using an efficient recursive algorithm. Empirically, tensor similarity tracks functional training dynamics, such as grokking and backdoor insertion, with higher fidelity than existing metrics. This reduces measuring similarity and verifying faithfulness into a solved algebraic problem rather than one of empirical approximation.

Keywords

Cite

@article{arxiv.2605.15183,
  title  = {When Are Two Networks the Same? Tensor Similarity for Mechanistic Interpretability},
  author = {ML Nissen Gonzalez and Melwina Albuquerque and Laurence Wroe and Jacob Meyer Cohen and Logan Riggs Smith and Thomas Dooms},
  journal= {arXiv preprint arXiv:2605.15183},
  year   = {2026}
}

Comments

22 pages, 8 figures. Code: https://github.com/tdooms/tensor-similarity

R2 v1 2026-07-22T07:12:58.244Z