MetaLA: Unified Optimal Linear Approximation to Softmax Attention Map

Yuhong Chou, Man Yao, Kexin Wang, Yuqi Pan, Ruijie Zhu +5 more
11/16/2024
cs.LGcs.AI

No official code found. Best implementation: BICLab/MetaLA (36 stars, last commit 2025-01-18).

Abstract

Various linear complexity models, such as Linear Transformer (LinFormer), State Space Model (SSM), and Linear RNN (LinRNN), have been proposed to replace the conventional softmax attention in Transformer structures. However, the optimal design of these linear models is still an open question. In this work, we attempt to answer this question by finding the best linear approximation to softmax attention from a theoretical perspective. We start by unifying existing linear complexity models as the linear attention form and then identify three conditions for the optimal linear attention design: 1) Dynamic memory ability; 2) Static approximation ability; 3) Least parameter approximation. We find that none of the current linear models meet all three conditions, resulting in suboptimal performance. Instead, we propose Meta Linear Attention (MetaLA) as a solution that satisfies these conditions. Our experiments on Multi-Query Associative Recall (MQAR) task, language modeling, image classification, and Long-Range Arena (LRA) benchmark demonstrate that MetaLA is more effective than the existing linear models.

View on arXivView PDF

Code Implementations(1)

BICLab/MetaLACommunity100%

Offical implementation of "MetaLA: Unified Optimal Linear Approximation to Softmax Attention Map" (NeurIPS2024 Oral)

363PythonDec 11, 20241 years ago
linear-attentionllm

Similar Papers

Cite this paper

@article{chou2024metala,
  title  = {MetaLA: Unified Optimal Linear Approximation to Softmax Attention Map},
  author = {Yuhong Chou and Man Yao and Kexin Wang and Yuqi Pan and Ruijie Zhu and Yiran Zhong and Yu Qiao and Jibin Wu and Bo Xu and Guoqi Li},
  year   = {2024},
  eprint = {2411.10741},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2411.10741},
  url    = {http://arxiv.org/abs/2411.10741v1},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2411.10741.svg)](https://codeofpaper.com/paper/2411.10741)

Discussion