Learning to Focus: Focal Attention for Selective and Scalable Transformers
Attention is a core component of transformer architecture, whether encoder-only, decoder-only, or encoder-decoder model. However, the standard softmax attention often produces noisy probability distribution, which can impair effective feature selection at every layer of these models, particularly for long contexts. We propose Focal Attention, a simple yet effective modification that sharpens the attention distribution by controlling the softmax temperature, either as a fixed hyperparameter or as a learnable parameter during training. This sharpening enables the model to concentrate on the most relevant tokens while suppressing irrelevant ones. Empirically, Focal Attention scales more favorably than standard transformer with respect to model size, training data, and context length. Across diverse benchmarks, it achieves the same accuracy with up to 42% fewer parameters or 33% less training data. On long-context tasks, it delivers substantial relative improvements ranging from 17% to 82%, demonstrating its effectiveness in real world applications.
Code (0)
등록된 구현이 없습니다.
Similar Papers 제목 키워드 기반
Focal Modulation Networks
We propose focal modulation networks (FocalNets in short), where self-attention (SA) is completely replaced by a focal modulation mechanism for modeling token interactions in vision. Focal modulation comprises three comp…
image-classificationImage ClassificationObject DetectionPanoptic Segmentation+2Focal Attention for Long-Range Interactions in Vision Transformers
Recently, Vision Transformer and its variants have shown great promise on various computer vision tasks. The ability to capture local and global visual dependencies through self-attention is the key to its success. But i…
image-classificationImage Classificationobject-detectionObject Detection+1Hybrid Focal and Full-Range Attention Based Graph Transformers
The paradigm of Transformers using the self-attention mechanism has manifested its advantage in learning graph-structured data. Yet, Graph Transformers are capable of modeling full range dependencies but are often defici…
FViT: A Focal Vision Transformer with Gabor Filter
Vision transformers have achieved encouraging progress in various computer vision tasks. A common belief is that this is attributed to the capability of self-attention in modeling the global dependencies among feature to…
Computational EfficiencyInductive BiasFocal Self-attention for Local-Global Interactions in Vision Transformers
Recently, Vision Transformer and its variants have shown great promise on various computer vision tasks. The ability of capturing short- and long-range visual dependencies through self-attention is arguably the main sour…
image-classificationImage ClassificationInstance Segmentationobject-detection+2