Performer is an efficient Transformer architecture that approximates softmax attention using random feature maps through the FAVOR+ (Fast Attention Via positive Orthogonal Random features) mechanism, achieving linear $O(N\cdot d)$ complexity in sequence length while providing an unbiased estimator of the full softmax attention matrix. Performer decomposes the softmax kernel into a product of random feature maps, enabling the attention computation to be rearranged for linear-time execution.
Why Performer Matters in AI/ML:
Performer provides a theoretically principled approximation to softmax attention with provable approximation guarantees, enabling linear-time Transformer training and inference without sacrificing the softmax attention's non-negative weighting and normalization properties.
• FAVOR+ mechanism — Softmax attention is approximated via random features: $\exp(q^T k/\sqrt{d}) \approx \phi (q)^T \phi (k)$, where $\phi (x) = \exp(-\lVert{x}\rVert^{2/2})/\sqrt{m} \cdot [\exp(\omega_1^T x)$, ..., $\exp(\omega_m^T x)$] uses $m$ random projection vectors $\omega_i \sim N(0, I_d)$; the positive random features ensure non-negative attention weights
• Orthogonal random features — Using orthogonal (rather than i.i.d.) random projection vectors reduces the variance of the kernel approximation, providing tighter approximation bounds with fewer features; orthogonalization is achieved via Gram-Schmidt on the random vectors
• Linear complexity derivation — With feature maps $\phi (\cdot ) \in ℝ^m$, attention becomes: Attn $= \mathrm{diag}(\phi (Q)\cdot (\phi (K)^T\cdot 1))^{-1} \cdot \phi (Q) \cdot (\phi (K)^T \cdot V)$; computing $\phi (K)^T \cdot V$ first ($m\times d$ matrix) then multiplying with $\phi (Q) (N\times m)$ costs $O(N\cdot m\cdot d)$ instead of $O(N^2\cdot d)$
• Bidirectional and causal modes — The FAVOR+ mechanism supports both bidirectional (encoding) and causal (autoregressive) attention; causal mode uses prefix sums to maintain the causal mask while preserving linear complexity
• Approximation quality — The quality of approximation improves with more random features $m$; typically $m=256-512$ provides good accuracy for $d=64-128$ dimensional heads, with the error decreasing as $O(1/\sqrt{m})$
| Parameter | Typical Value | Effect |
|---|---|---|
| Random Features $(m)$ | 256-512 | More = better approximation, higher cost |
| Orthogonal Features | Yes | Lower variance, better quality |
| Complexity | $O(N\cdot m\cdot d)$ | Linear in $N$ |
| Memory | $O(N\cdot d + m\cdot d)$ | Linear in $N$ |
| Softmax Approximation | Unbiased | Converges to exact with $m\to \infty $ |
| Causal Support | Yes (prefix sums) | Autoregressive generation |
Performer provides the theoretically rigorous framework for linear-time attention through random feature decomposition of the softmax kernel, demonstrating that softmax attention can be approximated with provable guarantees while enabling linear complexity in sequence length, making it a foundational contribution to efficient Transformer design.