Lune

AAAI2025Top-tier venue

How Not to Stitch Representations to Measure Similarity: Task Loss Matching Versus Direct Matching

András Balogh, Márk Jelasity

Abstract

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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

4 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Grounding Functional Similarity by Invariance-Aware Model Stitching cites Similarity and Matching of Neural Network Representations
  • Grounding Functional Similarity by Invariance-Aware Model Stitching cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Grounding Functional Similarity by Invariance-Aware Model Stitching cites Grounding Representation Similarity Through Statistical Testing
  • KLAS: Using Similarity to Stitch Neural Networks for Improved Accuracy-Efficiency Tradeoffs cites Similarity and Matching of Neural Network Representations
  • KLAS: Using Similarity to Stitch Neural Networks for Improved Accuracy-Efficiency Tradeoffs cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Do Vision Transformers See Like Convolutional Neural Networks? cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Revisiting Model Stitching In the Foundation Model Era cites Similarity and Matching of Neural Network Representations
  • Less Is More: Rethinking Parameter-Efficient Fine-Tuning from a Subtractive Perspective cites Similarity and Matching of Neural Network Representations
  • Less Is More: Rethinking Parameter-Efficient Fine-Tuning from a Subtractive Perspective cites Do Vision Transformers See Like Convolutional Neural Networks?
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers4

  1. KLAS: Using Similarity to Stitch Neural Networks for Improved Accuracy-Efficiency TradeoffsDebopam Sanyal, Anantharaman S. Iyer, Alind Khare, Trisha Jain et al.ICLR 2026 · 2 citations
  2. Revisiting Model Stitching In the Foundation Model EraZheda Mai, Ke Zhang, Fu-En Wang, Zixiao Ken Wang et al.CVPR 2026 · 2 citations
  3. Grounding Functional Similarity by Invariance-Aware Model StitchingIoannis Athanasiadis, Anmar Karmush, Michael FelsbergICML 2026 · 1 citation
  4. Less Is More: Rethinking Parameter-Efficient Fine-Tuning from a Subtractive PerspectiveTianqi Jiang, Liu Yang, Xi-Le Zhao, Zixuan Qin et al.AAAI 2026

Builds on11

  1. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
  2. Do Vision Transformers See Like Convolutional Neural Networks?Maithra Raghu, Thomas Unterthiner, Simon Kornblith, Chiyuan Zhang et al.NeurIPS 2021 · 1,553 citations
  3. Your classifier is secretly an energy based model and you should treat it like oneWill Grathwohl, Kuan-Chieh Wang, Jörn-Henrik Jacobsen, David Duvenaud et al.ICLR 2020 · 643 citations
  4. Similarity and Matching of Neural Network RepresentationsAdrián Csiszárik, Péter Korösi-Szabó, Ákos K. Matszangosz, Gergely Papp et al.NeurIPS 2021 · 105 citations
  5. Grounding Representation Similarity Through Statistical TestingFrances Ding, Jean-Stanislas Denain, Jacob SteinhardtNeurIPS 2021 · 88 citations

Related papers

  1. Revisiting Model Stitching to Compare Neural RepresentationsYamini Bansal, Preetum Nakkiran, Boaz BarakNeurIPS 2021 · 253 citations
  2. On the Functional Similarity of Robust and Non-Robust Neural RepresentationsAndrás Balogh, Márk JelasityICML 2023 · 4 citations
  3. Bridging Functional and Representational Similarity via Usable InformationAntonio Almudévar, Alfonso OrtegaICML 2026 · 1 citation
  4. Functional Alignment Can Mislead: Examining Model StitchingDamian Smith, Harvey Mannering, Antonia MarcuICML 2025
  5. Deconfounded Representation Similarity for Comparison of Neural NetworksTianyu Cui, Yogesh Kumar, Pekka Marttinen, Samuel KaskiNeurIPS 2022 · 27 citations
Dusk over the sea between two cliffs drawn in fine vertical lines