How not to Stitch Representations to Measure Similarity: Task Loss Matching versus Direct Matching
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
- 2015Deep Residual Learning for Image Recognitioncited by 51,809
- 2019Similarity of Neural Network Representations Revisitedcited by 1,695
- 2020Energy-based Out-of-distribution Detectioncited by 1,296
- 2018Deep Anomaly Detection with Outlier Exposurecited by 939
- 2020Prevalence of Neural Collapse during the terminal phase of deep learning trainingcited by 713
- 2021Do Vision Transformers See Like Convolutional Neural Networks?cited by 671
- 2019Your Classifier is Secretly an Energy Based Model and You Should Treat it Like Onecited by 402
- 2018Insights on representational similarity in neural networks with canonical correlationcited by 318
- 2021Revisiting Model Stitching to Compare Neural Representationscited by 203
- 2017What do Neural Machine Translation Models Learn about Morphology?cited by 165
- 2017Offline bilingual word vectors, orthogonal transformations and the inverted softmaxcited by 94
- 2021Similarity and Matching of Neural Network Representationscited by 77
6 more
- 2023Masked Autoencoders with Multi-Window Local-Global Attention Are Better Audio Learnerscited by 11
- 2023Model Stitching: Looking For Functional Similarity Between Representationscited by 10
- 2023Are Neurons Actually Collapsed? On the Fine-Grained Structure in Neural Representationscited by 10
- 2023Stitched ViTs are Flexible Vision Backbonescited by 8
- 2023StitchNet: Composing Neural Networks from Pre-Trained Fragmentscited by 2
- 2024Stitching for Neuroevolution: Recombining Deep Neural Networks without Breaking Themcited by 2
Built on by
Citing papers per year: 2025: 1; 2026: 3.
4 papers.
- 2026Revisiting Model Stitching In the Foundation Model Eracited by 2
- 2026KLAS: Using Similarity to Stitch Neural Networks for Improved Accuracy-Efficiency Tradeoffscited by 1
- 2025Sharing Knowledge without Sharing Data: Stitches can improve ensembles of disjointly trained modelscited by 0
- 2026A Stitch in Time Saves Nine: Preserving Policy Compatibility Under Perception Updates in End-to-End Autonomous Drivingcited by 0
- 2026A Stitch in Time Saves Nine: Preserving Policy Compatibility Under Perception Updates in End-to-End Autonomous Driving19 Jun 2026
- 2026KLAS: Using Similarity to Stitch Neural Networks for Improved Accuracy-Efficiency Tradeoffs28 May 2026
- 2026Revisiting Model Stitching In the Foundation Model Era12 Mar 2026
- 2025Sharing Knowledge without Sharing Data: Stitches can improve ensembles of disjointly trained models19 Dec 2025