Performer
The paper introduced FAVOR+ random features to approximate softmax attention with linear time and memory complexity.
Metadata
| Field | Value |
|---|---|
| Paper | Rethinking Attention with Performers |
| Authors | Krzysztof Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamas Sarlos, Peter Hawkins, Jared Davis, Afroz Mohiuddin, Lukasz Kaiser, David Belanger, Lucy Colwell, Adrian Weller |
| Year | 2020 preprint; ICLR 2021 |
| Venue | ICLR 2021 |
| arXiv | 2009.14794 |
| OpenReview | Ua6zuk0WRH |
| Google Research | Rethinking Attention with Performers |
| Status | verified |
Question
Standard Transformer attention builds an all-pairs attention matrix. For a sequence of length , this creates quadratic time and memory pressure:
The attention matrix has shape:
The core question is:
Performer answers this with a kernelized attention view and a random-feature approximation called FAVOR+.
Main Claim
Performer estimates regular softmax attention with linear time and memory complexity in sequence length, without requiring sparsity or low-rank assumptions over the attention matrix.
The claim can be summarized as:
where is a positive random feature map.
Then attention can be rearranged:
so the large matrix does not need to be formed.
The durable architecture idea is:
Architecture Contract
| Item | Contract |
|---|---|
| Input | token sequence represented by |
| Baseline operation | softmax self-attention |
| Replacement | FAVOR+ approximate attention |
| Main efficiency goal | avoid explicit attention matrix |
| Complexity target | linear in sequence length for fixed feature dimension |
| Key assumption | attention kernel can be approximated by positive random features |
| Main risk | approximation quality and implementation constants matter |
Performer is a Transformer-compatible attention replacement. It is not a new language-model objective, tokenizer, or data recipe.
Standard Attention Cost
Let:
Softmax attention is:
The score matrix costs:
to compute and:
to store.
For long sequences, the dominant problem is not the projection layers. It is the pairwise token-token matrix.
Kernel Attention View
If the attention kernel can be written as:
then unnormalized attention can be written:
By associativity:
The sum over keys and values can be computed once:
Then:
This changes the computation order:
The first expression forms an matrix. The second does not.
Normalization
Softmax attention is row-normalized. Kernelized attention needs a corresponding denominator:
Using associativity:
This is the key linear-attention structure. The numerator and denominator use prefix-like or full-sequence summaries rather than an explicit pairwise matrix.
FAVOR+
FAVOR+ stands for Fast Attention Via positive Orthogonal Random features. The method approximates the softmax kernel with positive random features and uses orthogonal random features to reduce variance.
The ideal identity is:
In practice, a finite number of random features is used:
The approximation improves as grows, but compute and memory also grow:
depending on the implementation details and value dimension.
The paper’s important contribution is not merely “use random features.” It is a positive, low-variance random feature construction suitable for attention normalization.
Complexity Comparison
For sequence length , head dimension , value dimension , and feature count :
| Attention Type | Time Shape | Memory Shape | Main Bottleneck |
|---|---|---|---|
| full softmax attention | pairwise attention matrix | ||
| sparse/local attention | depends on window/sparsity | depends on pattern | chosen connectivity |
| Performer attention | roughly linear in for fixed | no explicit matrix | random-feature dimension and kernel quality |
The architecture tradeoff is:
This is useful when is large enough that quadratic attention is the main constraint.
Relation to Transformer
Performer keeps the Transformer skeleton:
The replacement is inside the attention operator:
This makes it an attention-mechanism paper rather than a full-stack language-model paper.
Relation to Sparse Attention
Sparse attention reduces cost by restricting which token pairs interact:
Performer does not choose a sparse pattern. It approximates dense attention through a kernel map:
| Approach | How Cost Is Reduced | Risk |
|---|---|---|
| local attention | attend only nearby tokens | misses distant relations unless stacked or shifted |
| block sparse attention | attend selected blocks | pattern design matters |
| Linformer | compress keys and values along sequence length | rank assumption may fail |
| Performer | random-feature kernel approximation | approximation variance and kernel mismatch |
The reading point is that “efficient attention” is not one method family. Each method changes the connectivity or approximation contract differently.
Relation to Mamba and SSMs
Mamba and other state-space sequence models reduce sequence cost by replacing attention with recurrent/scan-like state updates. Performer keeps an attention-style kernelized aggregation.
| Axis | Performer | Mamba / SSM |
|---|---|---|
| starting point | Transformer attention | state-space recurrence |
| sequence scaling | linear for fixed feature count | linear scan |
| memory mechanism | kernelized all-token aggregation | learned state transition and selective updates |
| exact softmax attention | approximate | not attention |
| core question | can dense attention be approximated cheaply? | can sequence modeling avoid attention? |
This makes Performer a useful bridge between vanilla Transformer attention and non-attention sequence architectures.
Evidence to Read
Performer was evaluated across tasks where long inputs or dense attention cost matter, including image/pixel-style sequences, language modeling, and protein sequence modeling.
Read the evidence around these questions:
| Evidence | What It Supports |
|---|---|
| approximation theory | FAVOR+ estimates attention kernels with guarantees |
| long-sequence experiments | linear attention is useful when quadratic attention is costly |
| comparisons to sparse/dense efficient attention | the method is competitive with other efficiency routes |
| kernel comparisons | different attention kernels can be studied at larger scale |
| protein sequence tasks | long biological sequences can benefit from efficient attention |
The strongest evidence is not only final task score. It is the combination of:
What to Watch in the Ablations
Efficient attention papers are easy to misread. Check:
| Question | Why It Matters |
|---|---|
| Is sequence length large enough? | quadratic attention may not be the bottleneck at small |
| Is the implementation optimized? | asymptotic complexity can lose to constants |
| Is memory or wall-clock speed reported? | FLOPs alone may hide kernel overhead |
| How many random features are used? | approximation quality and compute both depend on |
| Is the baseline exact softmax or another efficient method? | the claim changes with the comparator |
| Does the task require sharp token-token alignment? | approximation may blur important interactions |
Failure Modes and Caveats
- Linear asymptotic complexity does not guarantee faster wall-clock time for every sequence length or hardware.
- Random-feature dimension introduces an accuracy/compute tradeoff.
- Approximate attention can behave differently from exact softmax attention in tasks requiring precise alignment.
- Kernel choice matters; Performer is a framework for kernelizable attention, not a universal replacement.
- Efficient attention claims should be read alongside implementation details, memory format, and batching.
Why This Matters for Architecture Reading
Performer makes attention a kernel approximation problem:
That lens is useful even when a later model does not use Performer directly. It separates three questions:
- What pairwise similarity should attention use?
- Can that similarity be approximated without building scores?
- Does the approximation preserve the task-relevant interaction?
Links
- Attention
- Transformer
- Computational complexity
- Inductive bias
- Linear algebra
- Attention Is All You Need
- Transformer-XL
- RoFormer
- Mamba
One-Line Memory
Performer is the linear-attention paper that treats softmax attention as a kernel and uses FAVOR+ random features to avoid forming the quadratic attention matrix.