Attention Transfer Is Not Universally Effective for Vision Transformers

Attention is sufficient only when the student architecture matches the teacher
Huaiyuan Qin1 Muli Yang1 Gabriel James Goenawan2† Peng Hu3 Chen Gong4 Xi Peng3 Hongyuan Zhu1✉

1Institute of Advanced Intelligence and Computing (IAIC), A*STAR, Singapore
2Intrinsic, Google 3School of Artificial Intelligence, Sichuan University
4School of Automation and Intelligent Sensing, Shanghai Jiao Tong University
†Work done while at A*STAR   ✉Corresponding author

NeurIPS 2026

Figure 1
Figure 1. Attention Transfer is not universally effective.

Abstract

A recent work shows that Attention Transfer, which transfers only the attention patterns from a pre-trained teacher Vision Transformer (ViT) to a randomly initialized standard student ViT, is sufficient to recover the full benefit of the teacher's pre-trained weights. We revisit this finding on a comprehensive benchmark of 20 teachers from 11 well-known ViT families and reveal that Attention Transfer is not universally effective. While 7 families transfer successfully, 4 consistently fail, falling up to 5.1% below the from-scratch no-transfer baseline. Further results demonstrate that this failure is family-consistent across model sizes, and persists under extended training durations, different transfer datasets, and out-of-distribution evaluations. Controlled analyses then consistently localize the problem to the attention-routing channel, indicating that the key issue is not whether the student can match the teacher's attention patterns, but whether the matched patterns remain functional for the student. Crucially, we identify architectural mismatch between the pre-trained teacher and the standard student as the primary mechanism. By adding only the teacher's native architectural components to the student in a randomly initialized state, we completely reverse the failure for all 4 families. Notably, these components alone do not improve from-scratch training, confirming that they specifically unlock the usability of the teacher's attention. We further show that this failure is not explained by the inadequate choice of transfer loss, differences in pre-training recipes, or the intrinsic quality of attention maps. Our findings refine the prevailing understanding of attention in ViT representations: attention is sufficient only when the student architecture matches the teacher.

What is Attention Transfer?

Following Li et al. (2024), we study Attention Transfer, where a randomly initialized student Vision Transformer (ViT) is trained to inherit the full benefit of a pre-trained teacher without loading the teacher’s full pre-trained weights. We study two forms of Attention Transfer from a pre-trained teacher ViT to a standard student of the same size: Attention Copy, which directly copies the teacher’s attention projection weights and keeps them frozen; and Attention Distillation, which trains the student to match the teacher’s attention patterns through an auxiliary transfer objective.

Attention Copy and Attention Distillation
Attention Copy (left) and Attention Distillation (right). Figure from Li et al. (2024).

Model Zoo. We revisit Attention Transfer on a comprehensive model zoo which consists of 20 pre-trained weights from 11 well-known ViT families, including DeiT, DINO, MoCov3, MAE, iBOT, SigLIP2, SAM, DINOv2, DINOv2-wr, CLIP, and BEiTv2, spanning three model sizes: Tiny, Small, and Base. All Attention Transfer experiments are conducted on ImageNet-1K classification with the default protocol in Li et al. (2024) using the standard teacher-student architecture.

No-Transfer Baseline. As a primary reference, we define the No-Transfer (NoT) baseline, where the same standard ViT is randomly initialized and trained from scratch for 20 epochs. Attention Transfer from one given pre-trained weights is considered a “failure” when the final accuracy falls below this baseline, indicating that imposing attention patterns from the teacher is less effective than learning from scratch under the same student architecture.

Attention Transfer Is Not Universally Effective

The results reveal a clear family-dependent split, and this split boundary is consistent across model sizes rather than driven by isolated pre-trained weights. Specifically, 7 families, including DeiT, DINO, MoCov3, MAE, iBOT, SigLIP2, and SAM, improve over the No-Transfer baseline, with gains reaching 13.9% for DeiT-T under Attention Copy. In contrast, 4 families: DINOv2, DINOv2-wr, CLIP, and BEiTv2, consistently fall into the failure region. The worst case is DINOv2-wr-B, which underperforms the No-Transfer baseline by 5.1% under Attention Copy. Notably, all teachers evaluated in Li et al. (2024) belong exclusively to our success group, while the failure families are absent from their evaluations.

Figure 2
Figure 2. Extended training robustness.

Extended Training Robustness. A natural counter-hypothesis is that the failure families might suffer from slower convergence under the transferred attention patterns. We extend the training schedule from 20 to 100 epochs for both the success and failure families. The performance gap persists throughout the entire extended learning process. While successful families maintain strong positive gains over the No-Transfer baseline, the failure families remain consistently negative even with substantially longer training.

NoTDeiTDINODINOv2DINOv2-wr
IN-1K63.175.6 +12.475.1 +12.061.7 −1.562.2 −0.9
iNat 201726.644.7 +18.146.0 +19.424.4 −2.224.5 −2.1
iNat 201835.050.2 +15.251.2 +16.333.1 −1.933.8 −1.2
iNat 201940.156.8 +16.755.7 +15.538.1 −2.138.7 −1.4
Table 1. Dataset robustness.

Dataset Robustness. We then test whether the observed failure is merely an artifact of the ImageNet-1K transfer dataset. Table 1 reports the performance of Attention Distillation on three fine-grained iNaturalist variants under the standard 20-epoch protocol. The same success/failure split appears consistently across all three year splits, matching the ImageNet-1K results.

NoTDeiTDINODINOv2DINOv2-wr
IN-A9.217.6 +8.417.2 +8.06.0 −3.25.8 −3.4
IN-R35.942.3 +6.442.8 +6.932.8 −3.132.2 −3.7
IN-S22.129.7 +7.629.4 +7.319.5 −2.619.0 −3.1
IN-V263.969.5 +5.569.9 +6.061.4 −2.561.6 −2.4
Table 2. Out-of-distribution robustness.

Out-of-Distribution Robustness. This observed success/failure split also persists under the out-of-distribution evaluation. Table 2 shows that on four ImageNet-1K distribution-shift benchmarks, Attention Distillation preserves the same positive/negative pattern observed in the in-distribution settings.

These results show that Attention Transfer is not universally effective under the standard teacher-student transfer protocol.

Localizing the Failure

Having established the robust failure of Attention Transfer for specific teacher families, we now investigate exactly where the transferred pre-trained weights harm the student. We diagnose this problem systematically through the three-level analysis below.

Attn.MLPDeiT-SDINOv2-SCLIP-B
66.065.370.3
✓71.7 +5.763.7 −1.669.4 −0.9
✓77.7 +11.769.2 +3.974.7 +4.4
✓✓79.3 +13.371.0 +5.780.1 +9.8
Table 3. Component-level decomposition.

Component-Level Decomposition. We selectively initialize the attention and MLP blocks from representative teachers under a component-level decomposition setup with full fine-tuning. As shown in Table 3, MLP-only initialization is consistently beneficial for both the success teacher (DeiT-S) and the failure teachers (DINOv2-S and CLIP-B). In contrast, Attention-only initialization preserves the success/failure split. This shows that the failure families do not suffer from a generic inability to benefit from the pre-trained weights as a whole. Instead, the failure is consistently localized to the attention pathway.

Figure 3
Figure 3. Layer-wise decomposition.

Layer-wise Decomposition. We transfer attention from the top or bottom k layers of one representative failure teacher, DINOv2-S, under both Attention Copy and Attention Distillation. No layer subset recovers the positive gains observed for success families. Instead, performance remains below the No-Transfer baseline across all tested transfer depths. This rules out a single problematic depth as the source of failure and suggests that the failure is distributed broadly across the transferred attention patterns.

DeiT-S (NoT: 63.1)DINOv2-S (NoT: 63.1)
CopyDistillCopyDistill
Q78.1 +15.077.0 +13.957.9 −5.259.0 −4.1
K78.7 +15.676.7 +13.657.4 −5.758.7 −4.4
V78.4 +15.378.0 +14.947.3 −15.954.9 −8.3
Attn.75.3 +12.275.6 +12.459.9 −3.261.7 −1.5
Table 4. QKV decomposition.

QKV Decomposition. Across both Attention Copy and Attention Distillation, Table 4 shows that transferring any of Q, K, or V alone remains beneficial for the success teacher DeiT-S. However, the same single-component transfer is harmful for the failure teacher DINOv2-S, with V producing the largest drop. Together with the previous layer-wise analysis, this further confirms that the failure is not confined to one specific layer or one isolated attention subcomponent, but is distributed broadly throughout the overall attention pathway.

This shows that the key issue is not simply whether the student can match the teacher’s attention patterns, but whether the matched patterns remain functional in the student’s attention routing. This naturally raises a sharper question: what determines this functional usability across teacher families?

Architectural Compatibility Is the Key

Motivation. This leads us to hypothesize that the missing factor is architectural compatibility in the default protocol: transferred attention remains usable only when the student preserves the architectural components under which the teacher originally learned its attention patterns. Concretely, each failure family contains one or more such components that are absent from the standard student architecture: LayerScale in DINOv2 and DINOv2-wr, PreLayerNorm in CLIP, and LayerScale together with RelativePositionBias in BEiTv2. These native components define the scaling, normalization, and positional context under which the teacher’s attention was learned.

Native-architecture Rescue. We augment the student architecture by adding only the teacher-native missing components. The inserted components are initialized randomly and trained jointly with the student, with no pre-trained weights loaded.

Figure 4
Figure 4. Architectural compatibility rescues ineffective Attention Transfer.
DINOv2-SCLIP-BBEiTv2-B
Standard-arch63.169.069.0
Native-arch60.1 −3.066.7 −2.366.3 −2.7
Table 5. No-Transfer baseline comparison.

Results & Analysis. Figure 4 demonstrates a clear and consistent performance flip for both Attention Transfer methods across the 4 failure families: transfer is harmful with the standard student architecture, while beneficial once teacher-native components are added. One natural concern is that these gains could come from the added components’ own capacity, rather than from restored compatibility with the teacher’s attention patterns. As shown in Table 5, native-arch NoT baselines yield worse performance than standard-arch ones for all failure families, indicating that the added components do not by themselves improve performance. The rescue effect therefore comes specifically from restoring architectural compatibility and unlocking effective Attention Transfer.

Why Architectural Mismatch Causes Failure. To explain why this rescue is effective, we further test the architectural compatibility hypothesis directly at the attention level. We measure this via per-layer KL divergence between the transferred student’s attention and the teacher’s native attention, for both standard-arch and native-arch students under Attention Distillation. The standard-arch student matches the early layers almost perfectly with near-zero KL across all three failure families, but exhibits a sharp divergence spike in the last three layers. By contrast, the native-architecture student remains consistently low and smooth across all layers, without any collapse for transferring attention.

Figure 5
Figure 5. Layer-wise teacher-to-student KL divergence.
Together, these results support architectural compatibility as the primary mechanism behind Attention Transfer’s effectiveness: attention is sufficient to recover the full benefit of the teacher’s pre-trained weights only when the student architecture provides the same attention routing as the teacher’s.

Ruling Out Alternative Explanations

We now ask whether simpler explanations could account for the observed failure. We therefore investigate three natural alternative explanations below.

Figure 6
Figure 6. Ablation on behaviors of MSE loss vs. default CE loss.

Not the Transfer Loss. MSE exhibits the same family-level trends as CE when the two losses’ magnitudes are matched by adjusting λ. For success teachers (DeiT-S, DINO-S), both losses produce monotonic improvements as λ increases. For failure teachers (DINOv2-S, DINOv2-wr-S), both losses instead produce monotonic degradation as λ increases. These results rule out the inadequate choice of transfer loss as the primary explanation for the observed failure.

Not the Pre-training Recipe. As shown in Table 6, for each candidate explanation from the failure families, we can identify at least one counter-example with that property from the success families, or one teacher that lacks it but still fails. Overall, none of these single-factor recipe properties predicts the observed family-level failure boundary. This rules out pre-training recipe differences as the primary explanation.

HypothesisFailureCounter-example
Pre-training signalDINOv2 (Self-Distillation)DINO (Self-Distillation)
CLIP (Contrastive)SigLIP2 (Contrastive)
BEiTv2 (Masked Image Modeling)iBOT/MAE (Masked Image Modeling)
Data sourceDINOv2 (Non-ImageNet Data)SAM (Non-ImageNet Data)
CLIP (Multi-Modal Data)SigLIP2 (Multi-Modal Data)
Special attributeDINOv2 (with Attention Sink)DeiT (with Attention Sink)
DINOv2 (patch 14→16 to fit standard-arch)CLIP (native patch 16, also fails)
Table 6. Counter-examples for potential pre-training recipe properties.
DINO-BDINOv2-BCLIP-BDeiT-B
MaxBoxAccV279.969.868.951.6
Table 7. Attention map quality comparison before Attention Transfer.

Not the Attention Map Quality. We measure the quality of attention maps with the object localization protocol of SimPool: MaxBoxAccV2 on 2,000 ImageNet-1K validation images with ground-truth boxes. As shown in Table 7, the success teacher DINO-B scores higher than both failure teachers, while the other success teacher DeiT-B scores below them: the quality ranking is interleaved with the success/failure split. The intrinsic quality of the teacher’s attention maps therefore does not predict the family-dependent failure.

DINOv2-SCLIP-BBEiTv2-B
w/o rescue76.172.068.2
w/ rescue83.7 +7.667.9 −4.151.6 −16.6
Table 8. Attention map quality comparison of transferred students w/ and w/o the rescue.

Furthermore, the proposed native-arch rescue does not work through attention map quality. As shown in Table 8, the rescue has no consistent effect direction on the attention map quality: it raises the measured quality under DINOv2-S but lowers it for CLIP-B and BEiTv2-B. In contrast, this rescue can reverse the transfer failure for all three weights.

After ruling out the inadequate choice of transfer loss, differences in pre-training recipe, and the quality of attention maps, we find that none of these alternatives accounts for the family-level failure boundary. Our findings refine the prevailing understanding of attention in ViT representations: attention is not architecture-agnostically transferable, and is sufficient only when the student architecture preserves the same attention routing as the teacher’s.

BibTeX

@inproceedings{qin2026attention,
  title     = {Attention Transfer Is Not Universally Effective for Vision Transformers},
  author    = {Qin, Huaiyuan and Yang, Muli and Goenawan, Gabriel James and
               Hu, Peng and Gong, Chen and Peng, Xi and Zhu, Hongyuan},
  booktitle = {Advances in Neural Information Processing Systems (NeurIPS)},
  year      = {2026}
}

Acknowledgements

This research is supported by the NSF of China (Grant No. 62336003, 12371510) and the Shanghai Municipal Special Program for Basic Research on General AI Foundation Models (Grant No. 2025SHZDZX025G12), and is conducted in collaboration with ST Engineering Geo-Insights Pte Ltd. We thank the anonymous reviewers and area chairs for their valuable feedback and constructive comments. This page is adapted from the ECHO project page, itself built on the Nerfies template.

References

  1. Alexander C. Li, Yuandong Tian, Beidi Chen, Deepak Pathak, and Xinlei Chen. On the surprising effectiveness of attention transfer for vision transformers. Advances in Neural Information Processing Systems (NeurIPS), 2024.