TL;DR
Model stitching—connecting the early layers of one model to the later layers of another via a trained adapter—is widely used to measure whether representations are functionally interchangeable. By generalizing stitching across different layer shapes and depths in ResNets, this paper uncovers an unexpected flaw: any late-stage layer can successfully stitch into almost any earlier layer with high task accuracy. This suggests that naive model stitching may not be measuring true representational similarity, but rather that the adapter is "hacking" downstream layers using shortcuts.
What Problem Does This Paper Address?
Understanding whether two neural networks learn similar internal representations remains an open question in interpretability. While geometric and statistical metrics (like CKA or canonical correlation analysis) check whether representation vectors are numerically aligned, they struggle to capture functional equivalence—whether two representations actually serve the same computational purpose.
Prior work by Bansal et al. used model stitching to test functional similarity by training a lightweight adapter ("stitch") between identical layers of identically structured models. If the spliced network maintains high accuracy, the representations are considered interchangeable. However, that setup was restricted to layers with identical tensor shapes. This paper asks:
- Can we expand model stitching across layers with differing shapes, depths, and architectures?
- Does high stitching performance genuinely mean two intermediate representations are functionally equivalent?
Methods
- Cross-Shape Stitching: To bridge layers of different spatial resolutions and channel counts across 16 small ResNet variants (ranging from ResNet-10 to ResNet-18) and standard ResNet-18/34 architectures, the authors introduced dimension-adapting stitches:
- Downsampling: Strided convolutions ($2\times2$, $4\times4$).
- Upsampling: Nearest-neighbor upsampling followed by a $1\times1$ convolution.
- Vanilla Task Stitching: The sender model $A$ is frozen up to layer $i$, and receiver model $B$ is frozen after layer $j$. The stitch $S$ is trained via standard backpropagation on the classification loss.
- Controls & Sanity Checks:
- Randomized controls: Stitching into/out of randomly initialized, untrained networks to verify the stitch itself cannot solve the task from scratch.
- Similarity-trained stitches: Training the stitch to minimize Mean Squared Error (MSE) between $S(A_{\le i}(x))$ and the true expected activation $B_{\le j}(x)$, comparing its task accuracy and error distribution against task-trained stitches.
- Image inversion: Stitching intermediate representations back into the input layer to inspect what features the stitch reconstructs.
Datasets
- CIFAR-10: All small ResNets and ResNet-18/34 models were trained and evaluated on CIFAR-10 (achieving $>90\%$ baseline accuracy). No new datasets or benchmarks were introduced.
Key Insights and Ideas
- The "Lower Triangle" Mystery: If stitching reflected genuine one-to-one layer correspondence, the similarity matrix across layers should form a narrow diagonal band. Instead, stitching produced a dense lower-left triangle: whenever the sender layer came later in depth than the receiver layer ($j \le i$), the stitched model achieved high accuracy ($\sim85\text{--}93\%$), even across distant layers.
- The "Hacking" Hypothesis: The standard assumption in deep learning is that deeper layers lose granular spatial details in favor of high-level semantic abstractions. How, then, can a deep layer substitute for an early layer? The authors hypothesize that the stitch does not reconstruct the receiver's expected representations; rather, it synthesizes generic, class-salient shortcut signals that fool the frozen receiver's downstream layers into predicting the correct label.
- Direct Alignment Fails at the Task: When stitches were trained directly to minimize MSE against the receiver’s representations (without task loss), the stitched networks collapsed to chance accuracy ($\sim10\%$). This highlights that point-wise spatial closeness does not guarantee task functionality, likely because only small, specific subspaces govern final predictions.
Key Results
- Systematic Asymmetry: Across all $16 \times 16 = 256$ pairs of small ResNet variants, any configuration where sender depth $i \ge$ receiver depth $j$ reached classification accuracies between $85\%$ and $94\%$.
- Generalization to Deeper Models: The same asymmetric triangular pattern emerged when stitching between full-sized ResNet-18 and ResNet-34.
- Control Validation: Random sender/receiver pairs dropped to baseline performance ($\sim10\%$ accuracy across most internal blocks), confirming that the adapter convolutions alone were not overly expressive.
Limitations and Future Work
- Inconclusive Proof of Hacking: Numerical MSE comparisons and image reconstruction from stitches showed degradation of spatial detail but could not definitively confirm the exact shortcut mechanisms the stitch exploits.
- Limited Scope: Experiments were restricted to ResNet variants trained on CIFAR-10. Behavior on more complex datasets (e.g., ImageNet) or non-convolutional architectures (e.g., Vision Transformers) remains unexplored.
- Future Directions: The paper cautions against using naive task-based model stitching as a standalone proxy for representation similarity. Future metrics will need stricter inductive biases or explicit information-theoretic constraints to prevent the adapter from taking unfaithful shortcuts.
Summary updated