Exploiting Biases in Attention for Transformers

Charles Herr, Gabriele Spadaro, Enzo Tartaglione
11/3/2026
cs.LG
transformer-attention

No confident code implementation found for this paper.

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.

Show full abstract

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.

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. Any repos shown below are weak matches — 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{herr2026exploiting,
  title  = {Exploiting Biases in Attention for Transformers},
  author = {Charles Herr and Gabriele Spadaro and Enzo Tartaglione},
  year   = {2026},
  eprint = {2611.04657},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.04657v1}
}

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/2611.04657.svg)](https://codeofpaper.com/paper/2611.04657)

Discussion