Macformer: Transformer with Random Maclaurin Feature Attention

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Guo, Yuhan, Ding, Lizhong, Yuan, Ye, Wang, Guoren
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866913475852238848
author Guo, Yuhan
Ding, Lizhong
Yuan, Ye
Wang, Guoren
author_facet Guo, Yuhan
Ding, Lizhong
Yuan, Ye
Wang, Guoren
contents 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 Macformer with different dot-product kernels. Experiment results of Macformer are consistent with our theoretical analysis.
format Preprint
id arxiv_https___arxiv_org_abs_2408_11656
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Macformer: Transformer with Random Maclaurin Feature Attention
Guo, Yuhan
Ding, Lizhong
Yuan, Ye
Wang, Guoren
Machine Learning
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 Macformer with different dot-product kernels. Experiment results of Macformer are consistent with our theoretical analysis.
title Macformer: Transformer with Random Maclaurin Feature Attention
topic Machine Learning
url https://arxiv.org/abs/2408.11656