Exploiting Biases in Attention for Transformers
Abstract
Attention is known to be sparse in vision transformers. In particular, we analyze the unequal relevance of attention-matrix columns to the final computation and show that this phenomenon becomes increasingly pronounced with network depth. This can be interpreted as saying that tokens have an absolute importance for the attention process, independently of queries. Inspired by this, we propose a reformulation of the attention formula that makes this phenomenon explicit by adding an input-dependent bias to the query-key dot product. We show that this new term gives each token a scalar value indicating its anticipated influence on other tokens during the attention process, and can thus serve as a proxy for pruning attention maps. Across multiple transformer model sizes, this allows us to substantially reduce the computational cost of attention, in terms of both FLOPs and inference latency, while retaining most of the original classification accuracy. We publicly released the code and models at https://github.com/EIDOSLAB/AttentionWithBias.
Create a lesson
Metadata
- Comments
- 23 pages, 21 figures, accepted at WACV 2027
Related papers
Quaternion-Tucker ZigZag Networks: Halving Transformer Backbone Parameters and Enabling Exact 2D Zero-Loss Continual Scaling
Shared title terminologycs.LGShubham Barmase
DuoMI: Dual Mutual Information Regularization for Expert Reuse in Looped Transformers
Shared title terminologycs.LGXinlai Kang, Zhenhe Wu, Haoyu Wang et al.
State Space Attention: Learning Context-Dependent Memory Retention
Shared title terminologycs.LGEge Çakar, Cengiz Pehlevan
One Token, Many Lessons: Sliding-Window Attention within Gated Delta Networks
Shared title terminologycs.LGYuchen Song, Yangbin Chen
FERRETS: A Scalable Symbolic Transform for Time Series Classification
Shared title terminologycs.LGAntoine Guillaume
A Bias in Disguise: Tiny Gradient Edits Stop a Small Language Model's Thinking Loops and Complement a Frontier Model's Weight Edit
Shared title terminologycs.LGHussamuddin Syed