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 about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 812a816a-81a5-4e86-a629-59d49d410385Cited 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
