TL;DR
Current methods for measuring how "similar" two neural networks are—specifically through model stitching—are often too forgiving, allowing models that rely on completely different visual cues to appear identical. This paper introduces Invariance-aware Functional Latent Alignment (I-FuLA), a new framework that forces the "stitching layer" to respect the internal transitions and invariances of the models, providing a much more honest assessment of functional similarity.
What Problem Does This Paper Address?
In deep learning, we often want to know if two models (say, a ResNet and a ViT) have learned the same thing. A popular way to test this is model stitching: you take the first half of Model A (the "front"), the second half of Model B (the "end"), and connect them with a simple trainable "stitching layer." If the hybrid model performs well, we conclude the models are functionally similar.
However, the authors point out a major flaw: the stitching layer is often too good at its job. It can learn to exploit "shortcuts" or unintended cues to bridge the gap between two very different models. For example, if Model A relies on color and Model B relies on shape, a standard stitching layer might learn to translate color information into shape features, making the models look similar when they actually perceive the world differently. The authors argue that true similarity requires two things:
- Forward Compatibility: The internal representations should follow similar transitions through the layers.
- Backward Compatibility: If the front model thinks two different inputs are identical (invariance), the end model should treat them that way too.
Methods
The authors propose two main innovations to fix model stitching:
- Functional Latent Alignment (FuLA): Instead of just training the stitching layer to match the final output (Task Loss Matching) or the immediate next layer (Direct Matching), FuLA optimizes the stitching layer to mimic the internal processes of the standalone end model all the way up to the penultimate layer. It uses "Hints" (L2 distances between feature maps) to ensure the data "flows" through the second model as intended.
- Invariance-Aware Stitching (The "I-" Prefix): To probe backward compatibility, the authors use Identically Represented Inputs (IRIs). These are pairs of images that look different to us but produce the exact same representation in the front model. By training the stitching layer on these IRIs, they ensure the alignment respects the front model's specific invariances.
By combining these, they arrive at I-FuLA, which they test against traditional methods like Task Loss Matching (TLM) and Soft Label Matching (SLM).
Datasets
The study uses several standard and modified image classification datasets:
- CIFAR-10 & LS-ImageNet-10: Used for low-resolution experiments.
- ImageNet-100 & ImageNetB-100: Used for high-resolution scaling.
- Information Variants: They created specific versions of these datasets to test "cues," such as grayscale versions and "pixel-injected" versions where a tiny, class-correlated pixel pattern acts as a shortcut.
Key Insights and Ideas
- Stitching is a "Learner," not just a "Matcher": The most surprising finding is that standard stitching layers can learn to use predictive cues that neither the front nor the end model originally used. This "excessive agreement" creates a false sense of similarity.
- The Multi-View Hypothesis: The paper supports the idea that models can achieve high accuracy by looking at different "views" of the data. Standard stitching hides this, while I-FuLA exposes it.
- Robustness Breeds Similarity: When using I-FuLA, the authors found that models trained with Adversarial Training (robust models) are significantly more similar to one another than standard models are. This suggests that making models robust forces them to converge toward a more "universal" functional behavior.
- CNNs vs. Transformers: The optimal stitching setting depends on the architecture. I-FuLA is the clear winner for convolutional models (ResNet, VGG), whereas I-SLM (Invariance-aware Soft Label Matching) performs slightly better for Vision Transformers (ViTs).
Key Results
- Exposing Shortcuts: In experiments where a "pixel shortcut" was added to the data, traditional TLM stitching showed nearly 100% agreement between models. I-FuLA correctly identified the functional discrepancy, showing a sharp drop in agreement because the models were using different information.
- Sanity Checks: The authors performed "identical stitching" (stitching a model to itself). I-FuLA passed this test with near-perfect agreement, proving that the added constraints don't break the alignment when the models are truly the same.
- Functional vs. Representational: The authors compared I-FuLA to CKA (Centered Kernel Alignment), a popular metric for representation similarity. They found that I-FuLA provides unique insights into how a model behaves that CKA misses, especially when dealing with adversarial robustness.
Limitations and Future Work
- Lack of an "Oracle": The authors admit there is no ground-truth "Gold Standard" for functional similarity, so they rely on intuitive sanity checks (like the pixel shortcut) to validate their metric.
- Task Scope: The study is currently limited to image classification. The authors suggest that exploring these compatibility requirements in other domains, like Natural Language Processing or cross-modal tasks, is a vital next step.
- Computational Cost: Generating IRIs and calculating latent hints across multiple layers is more computationally expensive than simple task-loss training.
Summary updated