Learning to Focus: Focal Attention for Selective and Scalable Transformers

Dhananjay Ram, Wei Xia, Stefano Soatto
11/10/2025
cs.CLcs.LG

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{ram2025learning,
  title  = {Learning to Focus: Focal Attention for Selective and Scalable Transformers},
  author = {Dhananjay Ram and Wei Xia and Stefano Soatto},
  year   = {2025},
  eprint = {2511.06818},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2511.06818v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2511.06818.svg)](https://codeofpaper.com/paper/2511.06818)

Discussion