Can Circuit Alignment Predict OOD Generalization?
Organizations: Computer Vision Center, Universitat Autònoma de Barcelona · Fujitsu Research of Europe · Indian Statistical Institute, Kolkata · University of Surrey
Abstract
Can out-of-distribution (OOD) generalization be predicted from a trained model's weights alone, without any target-domain data? Existing representational similarity metrics (CKA, SVCCA, RSA) compare activations rather than forecast generalization. We show they are provably insensitive to structural rerouting in the computational graph, the very change distribution shift induces. We close this gap with the Circuit Alignment Score (CAS), which compares class-specific circuits across domains via graph kernels, decomposed into same-class coherence and cross-class confusion. Casting CAS as a Lebesgue integral over the domain distribution, we prove its Monte Carlo estimate recovers the ground-truth ranking of learners by OOD accuracy, with pairwise inversion error vanishing at rate , where is the number of sampled domains. Across learners on PACS, CAS attains rank correlation with OOD accuracy, versus (CKA), (SVCCA), and (RSA), with similar trends on other benchmarks and even against data-dependent methods, making it the first provably consistent predictor of distributional robustness requiring neither target-domain data nor labels. The code is available at: https://github.com/ayanban011/ACE
Figures & tables
| Condition | CKA | SVCCA | RSA | CAS |
|---|---|---|---|---|
| P1: Structural sensitivity | ✗ | ✗ | ✗ | ✓ |
| P2: Class-conditional resolution | ✗ | ✗ | ❍ | ✓ |
| P3: Semantic consistency | ✗ | ✗ | ✗ | ✓ |
| Method | Tgt: Photo | Tgt: Art | Tgt: Cartoon | Tgt: Sketch | Mean |
|---|---|---|---|---|---|
| ATC Garg et al. (2022) | 0.65 | 0.54 | 0.62 | 0.51 | 0.58 |
| ProjNorm Yu et al. (2022) | 0.72 | 0.61 | 0.68 | 0.55 | 0.64 |
| ALine-D Baek et al. (2022) | 0.79 | 0.70 | 0.78 | 0.61 | 0.72 |
| CKA Kornblith et al. (2019) | 0.81 | 0.48 | 0.58 | 0.45 | 0.58 |
| SVCCA Raghu et al. (2017) | 0.28 | 0.21 | 0.21 | 0.22 | 0.23 |
| RSA Kriegeskorte et al. (2008) | 0.12 | 0.14 | 0.19 | 0.11 | 0.14 |
| Method | Input modality | Needs target data? | Extra training? | MAE (%) | |
|---|---|---|---|---|---|
| ATC Garg et al. (2022) | Softmax outputs | Unlabeled | None | 0.58 | 5.31 |
| ProjNorm Yu et al. (2022) | Model weights | Unlabeled | retrain ‡ | 0.64 | 5.72 |
| ALine-D Baek et al. (2022) | Predictions ( 3 models) † | Unlabeled | None | 0.72 | 4.85 |
| CKA (cross-domain) Kornblith et al. (2019) | Activations | Source only | None | 0.58 | 7.18 |
| SVCCA (cross-domain) Raghu et al. (2017) | Activations | Source only | None | 0.23 | 8.04 |
| RSA (cross-domain) Kriegeskorte et al. (2008) | Activations | Source only | None | 0.14 | 7.63 |
Appendix figures & tables17 assets
Supplementary material from the paper’s appendix.
Appendix
| Architecture | Adapter Sites | Insertion Logic | Attn Heads | |
|---|---|---|---|---|
| VGG-19 | features.{28,30,32} | 512 | After final three conv layers | — |
| ResNet-50 | layer4.{0,1,2} | 2048 | After each block in layer4 | — |
| MobileNetV2 | features.{16,17,18} | 1280 | After last inverted-residual blocks | — |
| ViT-B/16 | encoder.layer.{4,8,11} | 768 | After selected transformer blocks | ✓ |
| Deep MLP | layers.{-3,-2,-1} | After last three hidden layers | — |
| Architecture | MLP neurons | Stage 1 (MLP) | Stage 1 (Attn) | Stage 2 |
|---|---|---|---|---|
| VGG-19 | 512 | — | ||
| ResNet-50 | 2048 | — | ||
| MobileNetV2 | 1280 | — | ||
| ViT-B/16 | 768 |
| Domains | CKA ( ) | SVCCA ( ) | RSA ( ) | CAS (TK) ( ) |
|---|---|---|---|---|
| A - P | 0.65 | 0.04 | 0.39 | 0.62 |
| A - C | 0.83 | 0.25 | 0.08 | 0.59 |
| C - P | 0.80 | 0.37 | 0.46 | 0.58 |
| A - S | 0.77 | 0.23 | 0.17 | 0.45 |
| C - S | 0.68 | 0.02 | 0.27 | 0.37 |
| P - S | 0.77 | 0.10 | 0.04 | 0.28 |