Methods › General › Attention Modules › Attention Free Transformer
Attention Free Transformer
Introduced by Shuangfei Zhai et al. in An Attention Free Transformer
archive 2025-07-28 Description, source and code snippet are the archive's method entry.
Attention Free Transformer, or AFT, is an efficient variant of a multi-head attention module that eschews dot product self attention. In an AFT layer, the key and value are first combined with a set of learned position biases, the result of which is multiplied with the query in an element-wise fashion. This new operation has a memory complexity linear w.r.t. both the context size and the dimension of features, making it compatible to both large input and model sizes.
Given the input X, AFT first linearly transforms them into Q=X W^Q, K=X Wᴷ, V=X Wⱽ, then performs following operation:
Y=f(X) ; Yₜ=σ_q(Qₜ) ⊙(∑_(t^'=1)ᵀ exp(K_(t^')+w_(t, t^')) ⊙V_(t^'))/(∑_(t^'=1)ᵀ exp(K_(t^')+w_(t, t^')))
where ⊙ is the element-wise product; σ_q is the nonlinearity applied to the query with default being sigmoid; w ∈R^(T ×T) is the learned pair-wise position biases.
Explained in words, for each target position t, AFT performs a weighted average of values, the result of which is combined with the query with element-wise multiplication. In particular, the weighting is simply composed of the keys and a set of learned pair-wise position biases. This provides the immediate advantage of not needing to compute and store the expensive attention matrix, while maintaining the global interactions between query and values as MHA does.
Papers archive 2025-07-28
3 shown of 3, newest first. Repository counts are the archive's code-links table. A Syntology line states what Syntology ran from that paper's harvested code; it is per sample and not a correctness claim.
-
A Dot Product Attention Free Transformer 29 Sep 2021 · 0 repositories
-
The 2021 Hotel-ID to Combat Human Trafficking Competition Dataset 10 Jun 2021 · 0 repositories · arXiv:2106.05746
-
An Attention Free Transformer 28 May 2021 · 11 repositories · arXiv:2105.14103Syntology ran 0 of 1 samples · 1 unverified
Tasks archive 2025-07-28
4 tasks the archive attaches to papers tagged with this method, by distinct papers. A task without a page in the catalog is plain text.
| Task | Papers |
|---|---|
| Fine-Grained Image Classification | 1 |
| Image Classification | 1 |
| Language Modelling | 1 |
| Position | 1 |
Usage over time archive 2025-07-28
Components: the archive holds no method-to-method composition, so PwC's Components table cannot be rebuilt; the Papers list carries no Results column for the same reason (the archive does not join its leaderboard rows to method tags).
Categories archive 2025-07-28
Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections