Grounding Functional Similarity by Invariance-Aware Model Stitching

Ioannis Athanasiadis, Anmar Karmush, Michael Felsberg

Introduction

In deep learning, evaluating "functional similarity" helps researchers understand whether two independently trained models learn the same input-output relationships and represent the world in the same way. The standard technique for this is model stitching: connecting the early layers (the "front") of one model to the later layers (the "back") of another using a simple linear layer. If the resulting hybrid model performs well on a task, the models are typically deemed functionally similar.

However, recent studies highlight a critical flaw in this approach: standard model stitching is overly forgiving. Two models might rely on entirely different information cues—for instance, one recognizing a cat by its shape and another relying on a spurious pixel shortcut—yet still be successfully stitched together. This paper introduces invariance-aware model stitching, a rigorous framework that requires models to share the same "blind spots" or invariances, thereby revealing functional discrepancies that traditional methods completely miss.

The Illusion of Forward Compatibility

The fundamental issue with standard stitching is its exclusive reliance on forward compatibility—simply asking if the features from Model A can be mapped to solve Model B's task. This process is highly opportunistic. If there is any mathematical way to map the features, the stitch will find it, sometimes even exploiting cues that neither original model used.

What standard stitching ignores is backward compatibility: whether the models ignore the same irrelevant information. If Model A and Model B do not share the same invariances, they are not truly functionally similar, regardless of how well they stitch together.

Methodology: Enforcing Forward-Backward Compatibility

To address this limitation, the authors propose a new requirement called Forward-Backward Compatibility, implemented through two key innovations:

1. Invariance-Aware Training via IRIs

Instead of training the stitch on standard dataset images, the authors utilize Identically Represented Inputs (IRIs), or "metamers." These are distinct images that the front model perceives as identical at the representation level. By forcing the stitch to operate on IRIs, the framework demands that if Model A is invariant to a specific change (e.g., adding noise to an image), the stitched Model B must also treat those inputs as identical. If the stitch fails on these IRIs, it exposes differing internal logic between the models.

2. Functional Latent Alignment (FuLA)

Standard stitching typically aligns models using hard labels or soft probabilities. The authors introduce FuLA, an objective that forces the stitched composition to mimic the internal activation flow of the original "end" model across multiple latent layers. This constraint prevents the stitch from "cheating" by discovering new shortcuts during the alignment process.

Experimental Setup

The framework was evaluated across several computer vision benchmarks, including CIFAR-10, LS-ImageNet-10, and higher-resolution datasets like ImageNet-100 and ImageNetB-100. Crucially, the researchers also engineered Shortcut Variants—custom datasets containing class-correlated pixel shortcuts—to test whether the stitching method could distinguish between models relying on genuine features versus those exploiting "cheats."

Key Findings

By grounding similarity in shared invariances, the authors uncovered several critical insights:

  • Exposing Shortcut Reliance: In "cross-bias" experiments, where a model relying on shortcuts is stitched to one that does not, standard stitching falsely reported high similarity. In contrast, invariance-aware stitching correctly demonstrated that the similarity was near random chance.
  • Mitigating Unseen Cues: Standard stitching often achieves "excessive agreement" by exploiting information present in the data that neither original model actually utilized. The invariance-aware approach significantly reduces this phenomenon, offering a much cleaner measure of true learned representations.
  • Revisiting Model Robustness: Previous literature suggested that robust models (trained to resist adversarial attacks) and non-robust models were functionally similar. This paper proves that this was merely an illusion of forward compatibility. Once invariances are accounted for, robust and non-robust models are shown to be fundamentally different. Conversely, robust models are found to be highly functionally similar to each other, suggesting that adversarial training forces models to converge toward a more universal internal representation.

Limitations and Future Work

While invariance-aware stitching provides a far more principled approach to evaluating functional similarity, it is not without limitations. First, generating IRIs requires a computationally expensive optimization step for every data point. Second, the current study is limited to image classification; extending these dynamics to other modalities, such as Large Language Models, or tasks like object detection remains a vital next step. Finally, the "oracle" problem persists: because there is no perfect ground truth for functional similarity, definitively quantifying the exact similarity between two black-box models remains an open challenge.

Summary updated

BibTeX
@inproceedings{athanasiadis2026grounding,
  author = {Ioannis Athanasiadis and Anmar Karmush and Michael Felsberg},
  title = {{Grounding Functional Similarity by Invariance-Aware Model Stitching}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=yUEFOa32CG},
}
Figure