Performer

The paper introduced FAVOR+ random features to approximate softmax attention with linear time and memory complexity.

Metadata

FieldValue
PaperRethinking Attention with Performers
AuthorsKrzysztof 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
Year2020 preprint; ICLR 2021
VenueICLR 2021
arXiv2009.14794
OpenReviewUa6zuk0WRH
Google ResearchRethinking Attention with Performers
Statusverified

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

ItemContract
Inputtoken sequence represented by
Baseline operationsoftmax self-attention
ReplacementFAVOR+ approximate attention
Main efficiency goalavoid explicit attention matrix
Complexity targetlinear in sequence length for fixed feature dimension
Key assumptionattention kernel can be approximated by positive random features
Main riskapproximation 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 TypeTime ShapeMemory ShapeMain Bottleneck
full softmax attentionpairwise attention matrix
sparse/local attentiondepends on window/sparsitydepends on patternchosen connectivity
Performer attentionroughly linear in for fixed no explicit matrixrandom-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:

ApproachHow Cost Is ReducedRisk
local attentionattend only nearby tokensmisses distant relations unless stacked or shifted
block sparse attentionattend selected blockspattern design matters
Linformercompress keys and values along sequence lengthrank assumption may fail
Performerrandom-feature kernel approximationapproximation 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.

AxisPerformerMamba / SSM
starting pointTransformer attentionstate-space recurrence
sequence scalinglinear for fixed feature countlinear scan
memory mechanismkernelized all-token aggregationlearned state transition and selective updates
exact softmax attentionapproximatenot attention
core questioncan 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:

EvidenceWhat It Supports
approximation theoryFAVOR+ estimates attention kernels with guarantees
long-sequence experimentslinear attention is useful when quadratic attention is costly
comparisons to sparse/dense efficient attentionthe method is competitive with other efficiency routes
kernel comparisonsdifferent attention kernels can be studied at larger scale
protein sequence taskslong 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:

QuestionWhy 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:

  1. What pairwise similarity should attention use?
  2. Can that similarity be approximated without building scores?
  3. Does the approximation preserve the task-relevant interaction?

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.