What Does Attention Transfer Transfer? Attention Structure and Robustness in Vision Transformers
Organizations: Johns Hopkins University
Abstract
Vision transformers (ViTs) trained to copy a pretrained teacher's attention maps recover most of fine-tuning's in-distribution accuracy yet fall measurably short of it under distribution shift, as recent work has shown. What the copy delivers has never been measured directly in the attention structure and tied to robustness. We build that instrumentation for ViT-S students of a self-supervised teacher on ImageNet-100, and report three findings that triangulate one conclusion. First, the transfer is essentially perfect and permanently so: the distilled student's attention ends up roughly two orders of magnitude closer to the teacher's than fine-tuning does, and does not drift with additional training. Second, the gap is real at 14 fewer parameters and 10 less data than previously studied, but it has a time axis. It tracks training maturity, and completing the schedules that the stopping rule interrupted closes it below our pre-registered threshold in two of three seeds, with comparisons at equal accuracy giving the same result. The endpoint gap at this scale is substantially a training-maturity artifact: robustness matures later than accuracy, and stopping rules tuned to accuracy undersample it. Third, forcing cross-row redundancy down by half the structural separation between the distilled and fine-tuned conditions produces no detectable robustness response under two registered ways of matching accuracy. Verified transfer, a gap that closes while the structure never moves, and a null under direct intervention are together consistent with the deficit residing in features, not in the visible attention structure. This is elimination plus intervention, and its scope is the regime we measured. In this regime, attention overlays show where a model looks, not what it knows.
Figures & tables
| Student | KL(t s) (nats) | Cosine | |
|---|---|---|---|
| Attention transfer | 0.0170 (0.0124–0.0217) | 0.989 (0.986–0.992) | 3 |
| + ADL | 0.0135 (0.0126–0.0141) | 0.991 (0.990–0.991) | 3 |
| Weight transfer | 1.6545 (1.6243–1.6800) | 0.499 (0.494–0.507) | 3 |
| Scratch | 2.1482 (2.0881–2.2270) | 0.342 (0.339–0.345) | 3 |
| Model | Entropy | Top- | Redundancy | Stability |
|---|---|---|---|---|
| Teacher (MAE) | 3.596 | 0.418 | 0.4665 | – |
| Attention transfer | 3.610 | 0.415 | 0.4683 | 0.810 |
| Weight transfer | 4.136 | 0.305 | 0.5128 | 0.742 |
| Scratch | 4.338 | 0.257 | 0.5837 | 0.750 |
| Condition | Seed | Stop epoch | ID top-1 | Eff. robustness [95% CI] |
|---|---|---|---|---|
| Scratch | s0 | 300 (cap) | 0.8498 | 0.4199 [0.4070, 0.4332] |
| s1 | 300 (cap) | 0.8496 | 0.4168 [0.4038, 0.4301] | |
| s2 | 290 (early stop) | 0.8462 | 0.4188 [0.4053, 0.4324] | |
| Weight transfer (ft) | s0 | 200 (cap) | 0.8916 | 0.4943 [0.4814, 0.5073] |
| s1 | 200 (early stop) | 0.8896 | 0.4913 [0.4785, 0.5044] | |
| s2 | 200 (cap) | 0.8926 | 0.4964 [0.4836, 0.5092] |
| Seed | Endpoint gap | Completed-schedule gap |
|---|---|---|
| s0 | +0.0575 [0.0445, 0.0703] | +0.0044 [-0.0059, 0.0148] |
| s1 | +0.0323 [0.0209, 0.0442] | +0.0013 [-0.0096, 0.0122] |
| s2 | +0.0181 [0.0073, 0.0289] | +0.0110 [0.0003, 0.0217] |
| Own-level rung | Top rung | |||
|---|---|---|---|---|
| Seed | level | gap | level | gap |
| s0 | 0.8248 | +0.0237 | 0.8850 | +0.0037 |
| s1 | 0.8618 | -0.0145 | 0.8794 | -0.0030 |
| s2 | 0.8812 | +0.0049 | 0.8832 | +0.0049 |
| Dose | s0 | s1 | s2 | Mean SD |
|---|---|---|---|---|
| -0.0022 | -0.0025 | -0.0027 | -0.0025 0.0002 | |
| -0.0035 | -0.0048 | -0.0030 | -0.0038 0.0009 | |
| -0.0095 | -0.0105 | -0.0100 | -0.0100 0.0005 | |
| -0.0246 | -0.0252 | -0.0241 | -0.0247 0.0006 |
| Per-pair | Iso-level | |||||||
|---|---|---|---|---|---|---|---|---|
| Dose | s0 | s1 | s2 | mean | s0 | s1 | s2 | mean |
| +0.0154 | +0.0017 | -0.0259 | -0.0029 | +0.0154 | +0.0054 | -0.0380 | -0.0057 | |
| +0.0196 | +0.0010 | +0.0019 | +0.0075 | +0.0196 | +0.0180 | -0.0132 | +0.0082 | |
| +0.0236 | -0.0176 | +0.0010 | +0.0023 | +0.0236 | +0.0025 | -0.0373 | -0.0037 | |
| +0.0166 | -0.0163 | -0.0013 | -0.0003 | +0.0166 | +0.0039 | -0.0370 | -0.0055 | |
| Model | Role | IN-C eff. rob. |
|---|---|---|
| distill_s0 (e145 endpoint) | canonical | 0.6453 |
| finetune_s0 | canonical | 0.7548 |
| scratch_s0 | canonical | 0.7220 |
| distill+ADL 1.0_s0 | canonical | 0.7101 |
| distill_s0 continuation (e300) | maturity contrast | 0.7067 |
| distill_s1 continuation (e300) | maturity contrast | 0.7098 |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | IN-A | IN-R | IN-Sk | IN-V2 | Mean [95% CI] |
|---|---|---|---|---|---|
| scratch_vit_s_s0 | 0.1088 | 0.3871 | 0.3199 | 0.8637 | 0.4199 [0.4070, 0.4332] |
| scratch_vit_s_s1 | 0.1196 | 0.3919 | 0.3107 | 0.8451 | 0.4168 [0.4038, 0.4301] |
| scratch_vit_s_s2 | 0.1303 | 0.3922 | 0.3122 | 0.8402 | 0.4188 [0.4053, 0.4324] |
| finetune_vit_s_s0 | 0.1453 | 0.4953 | 0.4405 | 0.8961 | 0.4943 [0.4814, 0.5073] |
| finetune_vit_s_s1 | 0.1564 | 0.4805 | 0.4302 | 0.8982 | 0.4913 [0.4785, 0.5044] |
| finetune_vit_s_s2 | 0.1433 | 0.4965 | 0.4440 | 0.9019 | 0.4964 [0.4836, 0.5092] |
| Analysis | Model | Val top-1 | Epoch | Residual |
|---|---|---|---|---|
| dose per-pair 0.1 | sweep s0 | 0.8234 | 129 | -0.0014 |
| dose per-pair 0.1 | baseline s0 | 0.8248 | 119 | +0.0000 |
| dose per-pair 0.1 | sweep s1 | 0.8622 | 219 | +0.0004 |
| dose per-pair 0.1 | baseline s1 | 0.8618 | 219 | +0.0000 |
| dose per-pair 0.1 | sweep s2 | 0.8596 | 189 | +0.0000 |
| dose per-pair 0.1 | baseline s2 | 0.8598 | 224 | +0.0002 |
| Baseline population | (stop, residual) | ft distill endpoint residual gap | ||
|---|---|---|---|---|
| s0 | s1 | s2 | ||
| all 24 endpoint models | -0.562 | -0.0181 | -0.0122 | +0.0525 |
| fine-tune + scratch | -0.854 | -0.0841 | -0.0464 | +0.0421 |
| ft + scratch + dose-zero distill | -0.689 | -0.0335 | -0.0255 | +0.0515 |
| Peak LR | Warmup (epochs) | Horizon (epochs) | |
|---|---|---|---|
| Scratch, distill, and dose arms | 20 | 300 | |
| Fine-tune | 5 | 200 | |
| MAE teacher (pretraining) | 40 | 400 (probe-stopped) |