mlsanityData to 7 Oct 2026

How not to Stitch Representations to Measure Similarity: Task Loss Matching versus Direct Matching

arXiv 2412.11299 ↗First posted 15 Dec 2024cs.LG stat.MLcited by 4

Not on the map. Why?

Abstract (arXiv)

Measuring the similarity of the internal representations of deep neural networks is an important and challenging problem. Model stitching has been proposed as a possible approach, where two half-networks are connected by mapping the output of the first half-network to the input of the second one. The representations are considered functionally similar if the resulting stitched network achieves good task-specific performance. The mapping is normally created by training an affine stitching layer on the task at hand while freezing the two half-networks, a method called task loss matching. Here, we argue that task loss matching may be very misleading as a similarity index. For example, it can indicate very high similarity between very distant layers, whose representations are known to have different functional properties. Moreover, it can indicate very distant layers to be more similar than architecturally corresponding layers. Even more surprisingly, when comparing layers within the same network, task loss matching often indicates that some layers are more similar to a layer than itself. We argue that the main reason behind these problems is that task loss matching tends to create out-of-distribution representations to improve task-specific performance. We demonstrate that direct matching (when the mapping minimizes the distance between the stitched representations) does not suffer from these problems. We compare task loss matching, direct matching, and well-known similarity indices such as CCA and CKA. We conclude that direct matching strikes a good balance between the structural and functional requirements for a good similarity index.

Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 18 of its 32 references that are in the map. First posted on arXiv 15 Dec 2024.

Builds on

18 of 32 references.

References · 18

  1. 2015Deep Residual Learning for Image Recognitioncited by 51,809
  2. 2019Similarity of Neural Network Representations Revisitedcited by 1,695
  3. 2020Energy-based Out-of-distribution Detectioncited by 1,296
  4. 2018Deep Anomaly Detection with Outlier Exposurecited by 939
  5. 2020Prevalence of Neural Collapse during the terminal phase of deep learning trainingcited by 713
  6. 2021Do Vision Transformers See Like Convolutional Neural Networks?cited by 671
  7. 2019Your Classifier is Secretly an Energy Based Model and You Should Treat it Like Onecited by 402
  8. 2018Insights on representational similarity in neural networks with canonical correlationcited by 318
  9. 2021Revisiting Model Stitching to Compare Neural Representationscited by 203
  10. 2017What do Neural Machine Translation Models Learn about Morphology?cited by 165
  11. 2017Offline bilingual word vectors, orthogonal transformations and the inverted softmaxcited by 94
  12. 2021Similarity and Matching of Neural Network Representationscited by 77
6 more
  1. 2023Masked Autoencoders with Multi-Window Local-Global Attention Are Better Audio Learnerscited by 11
  2. 2023Model Stitching: Looking For Functional Similarity Between Representationscited by 10
  3. 2023Are Neurons Actually Collapsed? On the Fine-Grained Structure in Neural Representationscited by 10
  4. 2023Stitched ViTs are Flexible Vision Backbonescited by 8
  5. 2023StitchNet: Composing Neural Networks from Pre-Trained Fragmentscited by 2
  6. 2024Stitching for Neuroevolution: Recombining Deep Neural Networks without Breaking Themcited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 1; 2026: 3.

4 papers.