Learning to Focus: Focal Attention for Selective and Scalable Transformers

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Ram, Dhananjay, Xia, Wei, Soatto, Stefano
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866918193472208896
author Ram, Dhananjay
Xia, Wei
Soatto, Stefano
author_facet Ram, Dhananjay
Xia, Wei
Soatto, Stefano
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2511_06818
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Learning to Focus: Focal Attention for Selective and Scalable Transformers
Ram, Dhananjay
Xia, Wei
Soatto, Stefano
Computation and Language
Machine Learning
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.
title Learning to Focus: Focal Attention for Selective and Scalable Transformers
topic Computation and Language
Machine Learning
url https://arxiv.org/abs/2511.06818