Attention Temperature Matters in ViT-Based Cross-Domain Few-Shot Learning
Yixiong Zou, Ran Ma, Yuhua Li, Ruixuan Li
Abstract
Cross-domain few-shot learning (CDFSL) is proposed to transfer knowledge from large-scale source-domain datasets to downstream target-domain datasets with only a few training samples. However, Vision Transformer (ViT), as a strong backbone network to achieve many top performances, is still under-explored in the CDFSL task in its transferability against large domain gaps. In this paper, we find an interesting phenomenon of ViT in the CDFSL task: by simply multiplying a temperature (even as small as 0) to the attention in ViT blocks, the target-domain performance consistently increases, even though the attention map is downgraded to a uniform map. In this paper, we delve into this phenomenon for an interpretation. Through experiments, we interpret this phenomenon as a remedy for the ineffective target-domain attention caused by the query-key attention mechanism under large domain gaps. Based on it, we further propose a simple but effective method for the CDFSL task to boost ViT’s transferability by resisting the learning of query-key parameters and encouraging that of non-query-key ones. Experiments on four CDFSL datasets validate the rationale of our interpretation and method, showing we can consistently outperform state-of-the-art methods. Our codes are available at https://github.com/Zoilsen/Attn_Temp_CDFSL.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
17 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Emerging Properties in Self-Supervised Vision Transformers cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Emerging Properties in Self-Supervised Vision Transformers cites Training data-efficient image transformers & distillation through attention
- Multiscale Vision Transformers cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Multiscale Vision Transformers cites Training data-efficient image transformers & distillation through attention
- Multiscale Vision Transformers cites Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNet
- Interpretable Cross-Domain Few-Shot Learning with Rectified Target-Domain Local Alignment cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Interpretable Cross-Domain Few-Shot Learning with Rectified Target-Domain Local Alignment cites Mind the Discriminability Trap in Source-Free Cross-domain Few-shot Learning
- Interpretable Cross-Domain Few-Shot Learning with Rectified Target-Domain Local Alignment cites Reclaiming Lost Text Layers for Source-Free Cross-Domain Few-Shot Learning
- Addressing Exacerbated Attention Sink for Source-Free Cross-Domain Few-Shot Learning cites Mind the Discriminability Trap in Source-Free Cross-domain Few-shot Learning
- Addressing Exacerbated Attention Sink for Source-Free Cross-Domain Few-Shot Learning cites Reclaiming Lost Text Layers for Source-Free Cross-Domain Few-Shot Learning
- Training data-efficient image transformers & distillation through attention cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNet cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNet cites Training data-efficient image transformers & distillation through attention
Cited by top-tier papers17
- Attention Smoothing Is All You Need For UnlearningSaleh Zare Zade, Xiangyu Zhou, Sijia Liu, Dongxiao ZhuICLR 2026 · 7 citations
- Reclaiming Lost Text Layers for Source-Free Cross-Domain Few-Shot LearningZhenyu Zhang, Guangyao Chen, Yixiong Zou, Yuhua Li et al.CVPR 2026 · 7 citations
- Mind the Discriminability Trap in Source-Free Cross-domain Few-shot LearningZhenyu Zhang, Yixiong Zou, Yuhua Li, Ruixuan Li et al.CVPR 2026 · 6 citations
- Interpretable Cross-Domain Few-Shot Learning with Rectified Target-Domain Local AlignmentYaze Zhao, Yixiong Zou, Yuhua Li, Ruixuan LiCVPR 2026 · 5 citations
- Addressing Exacerbated Attention Sink for Source-Free Cross-Domain Few-Shot LearningShuai Yi, Yixiong Zou, Yuhua Li, Ruixuan LiCVPR 2026 · 3 citations
Builds on20
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
- Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa et al.ICML 2021 · 8,974 citations
- Emerging Properties in Self-Supervised Vision TransformersMathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou et al.ICCV 2021 · 8,921 citations
- Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNetLi Yuan, Yunpeng Chen, Tao Wang, Weihao Yu et al.ICCV 2021 · 2,462 citations
- Multiscale Vision TransformersHaoqi Fan, Bo Xiong, Karttikeya Mangalam, Yanghao Li et al.ICCV 2021 · 1,611 citations
Related papers
- A Closer Look at the CLS Token for Cross-Domain Few-Shot LearningYixiong Zou, Shuai Yi, Yuhua Li, Ruixuan LiNeurIPS 2024 · 40 citations
- Random Registers for Cross-Domain Few-Shot LearningShuai Yi, Yixiong Zou, Yuhua Li, Ruixuan LiICML 2025
- Revisiting Continuity of Image Tokens for Cross-domain Few-shot LearningShuai Yi, Yixiong Zou, Yuhua Li, Ruixuan LiICML 2025
- Task-Adaptive Prompted Transformer for Cross-Domain Few-Shot LearningJiamin Wu, Xin Liu, Xiaotian Yin, Tianzhu Zhang et al.AAAI 2024 · 14 citations
- Flatten Long-Range Loss Landscapes for Cross-Domain Few-Shot LearningYixiong Zou, Yicong Liu, Yiman Hu, Yuhua Li et al.CVPR 2024 · 17 citations
