Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Rethinking Attention with Performers

  • Problem Regular softmax attention builds an L by L attention matrix, so its time and memory grow quadratically with sequence length L, which blocks long inputs.
  • Method Writes each attention kernel as an expectation of a feature inner product, then reorders the matrix products with positive random features so the cost is linear in L.
  • Results Reached about 24% accuracy on concatenated TrEMBL at L = 8192, where a 3-layer Transformer plateaued near 19%.

Why exact attention is expensive for long inputs

Transformers rely on a trainable attention mechanism that finds dependencies between the elements of an input sequence. The cost of that mechanism grows quadratically with the number of tokens L, which is expensive for large L even at moderate sizes. Bidirectional attention forms the L by L attention matrix A explicitly, so its time is O(L2d) and its space is O(L2+Ld).

Because the matrix must be stored, this form of dot-product attention does not fit end-to-end processing of long sequences.

Sparse and structured remedies restrict attention to local neighborhoods, sliding windows or clusters, or impose sparsity patterns. The authors argue that these methods lack rigorous guarantees on the representational power they keep, and that sparsity patterns are often checked only empirically. Locality sensitive hashing, one such sparse approach, has O(Ld2 logL) time complexity, which is the comparison point the paper uses for its own bound.

Attention as a kernel with random features

Each entry of the attention matrix is a kernel value K(qi, kj) between a query row and a key row. If the kernel can be written as an expectation of an inner product of feature vectors, K(x, y) = E[φ(x)ᵀφ(y)], then the features of all queries and keys can be stacked into matrices Q′ and K′. The paper restricts the feature map to nonnegative outputs, φ mapping Rd into the nonnegative orthant of dimension r.

The normalizer is computed from the same features as \(\hat{D}=\mathrm{diag}(Q'((K')^\top 1_L))\), so no L by L matrix is needed. This order of computation needs O(Lr+Ld+rd) space and O(Lrd) time, against O(L2+Ld) space and O(L2d) time for regular attention.

The mechanism has two parts: the feature-based computation just described, and a second part that asks whether such a feature model can approximate softmax and how to implement it robustly. The second part also covers whether the number of features r can be kept much smaller than L while still giving the desired gains.

Choosing features for the softmax kernel

The softmax-kernel is SM(x, y) = exp(xᵀy), and it defines the regular attention matrix; the paper omits the scaling by the square root of d because queries and keys can be renormalized instead. Since SM(x, y) = exp(‖x‖²/2) Kgauss(x, y) exp(‖y‖²/2), a trigonometric feature map with h(x) = exp(‖x‖²/2), l = 2, f1 = sin and f2 = cos gives an unbiased approximation of the softmax-kernel, written SMtrig.

Attention forms each output as a convex combination of value vectors, with weights taken from kernel scores, so the kernel scores must be nonnegative. Trigonometric features can take negative values, and the paper reports that this leads to unstable behaviour during training. Positive softmax features with feature redrawing are the variant that the paper reports as matching regular Transformers on PG-19.

The paper states that the resulting estimator is unbiased or nearly unbiased, with uniform convergence, and that it has lower variance of the approximation than the alternatives it compares. Proofs of these properties are part of the theoretical material, and they are not reproduced in the units read here.

Protein modeling on TrEMBL

The protein experiments train a 36-layer model on TrEMBL sequences, in both the (U) and (B) cases. All runs used the model parameters (nheads, nlayers, dff, d) = (8, 36, 1024, 512) taken from Madani et al., on 16x16 TPU-v2 hardware.

Reformer and Linformer drop noticeably in accuracy on this dataset. Performer-RELU, which takes f = ReLU in the generalized attention form, reaches the highest accuracy in both the (U) and (B) cases.

The softmax approximation of the Performer reaches the same accuracy as the exact-softmax Transformer, which the authors read as confirming the tightness claimed in their theory.

Long-length training on ImageNet64 and concatenated TrEMBL

On ImageNet64 with L = 12288, the regular Transformer is unfeasible, so the models share the same heads and feed-forward size and differ only in number of layers. Performer/6-layers matches Reformer/12-layers, and Performer/12-layers matches Reformer/24-layers.

The Performer trains at a batch size of 8 per chip with the standard (8, 6, 2048, 512) architecture. The authors describe this as a proof of principle for predicting interactions among groups of proteins.

The 3-layer Transformer is bounded at about 19%, while the Performer keeps training to about 24%. Depending on hardware and with Jax optimizations, the Performer can be 2x faster than the Reformer in the (U) setting.

Feature choice and weight transfer on PG-19

The original pretrained Transformer's weights were transferred into the Performer, which starts at a non-zero 0.07 accuracy and recovers in a small fraction of the original gradient steps. The comparison covers trigonometric features, positive features without redrawing, Linformer with redrawn projections, and positive features with redrawing.

On PG-19, trigonometric softmax approximation becomes highly unstable during training. Positive features without redrawing and Linformer with redrawn projections plateau at the same perplexity. The authors state that positive softmax features with feature redrawing are necessary to match the Transformer, and that the regularization SMREG allows faster convergence.

Ablations across attention kernels show that trigonometric random features can produce NaN values during training.

Limitations

The concatenated TrEMBL comparison uses a smaller regular Transformer as baseline, because the full-size regular model overloads memory. The 2x speed-up over the Reformer depends on hardware and on Jax optimizations, and it is reported for the (U) setting only.

The main analysis is written for bidirectional attention; the unidirectional case is described as analogous through prefix sums, with details in the appendix. Without feature redrawing, the positive features plateau instead of matching the regular Transformer on PG-19.

Paper info

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
Venue
arXiv · Preprint
First published
2020-9-30
Added
2026-10-20
Updated
2022-11-19
Version
v4
arXiv
2009.14794
Category
cs.LG · cs.CL · stat.ML
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

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 (2020). Rethinking Attention with Performers. arXiv:2009.14794v4. https://arxiv.org/abs/2009.14794v4

BibTeX
@misc{choromanski2020rethinking,
  title = {{Rethinking Attention with Performers}},
  author = {Krzysztof Choromanski and Valerii Likhosherstov and David Dohan and Xingyou Song and Andreea Gane and Tamas Sarlos and Peter Hawkins and Jared Davis and Afroz Mohiuddin and Lukasz Kaiser and David Belanger and Lucy Colwell and Adrian Weller},
  year = {2020},
  eprint = {2009.14794},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2009.14794v4}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up