Macformer: Transformer with Random Maclaurin Feature Attention
Yuhan Guo, Lizhong Ding, Ye Yuan, Guoren Wang

TL;DR
Macformer introduces a novel Transformer architecture using Random Maclaurin features to efficiently approximate dot-product kernels, significantly accelerating attention computations for long sequences while maintaining accuracy.
Contribution
It proposes Macformer, a new Transformer model employing RMF for kernel approximation, with a novel regularization mechanism, improving efficiency and accuracy for long sequence processing.
Findings
Macformer accelerates attention computation on long sequences.
RMFA provides an unbiased approximation of kernelized attention.
Experimental results align with theoretical analysis, confirming effectiveness.
Abstract
Random feature attention (RFA) adopts random fourier feature (RFF) methods to approximate the softmax function, resulting in a linear time and space attention mechanism that enables the construction of an efficient Transformer. Inspired by RFA, we propose Macformer, a Transformer architecture that employs random Maclaurin features (RMF) to approximate various dot-product kernels, thereby accelerating attention computations for long sequence. Macformer consists of Random Maclaurin Feature Attention (RMFA) and pre-post Scaling Batch Normalization (ppSBN), the former is an unbiased approximation for dot-product kernelized attention and the later is a two-stage regularization mechanism guaranteeing the error of RMFA. We conducted toy experiments to demonstrate the efficiency of RMFA and ppSBN, and experiments on long range arena (LRA) benchmark to validate the acceleration and accuracy of…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsImage Retrieval and Classification Techniques · Face and Expression Recognition · Advanced Image and Video Retrieval Techniques
MethodsLinear Layer · Residual Connection · Multi-Head Attention · Adam · Layer Normalization · Attention Is All You Need · Position-Wise Feed-Forward Layer · Dense Connections · Byte Pair Encoding · Absolute Position Encodings
