CLAug 20, 2021

Fastformer: Additive Attention Can Be All You Need

arXiv:2108.09084v6154 citations
AI Analysis

This addresses the problem of slow text processing for AI researchers and practitioners by offering a more efficient alternative to standard Transformers, though it is incremental in improving existing methods.

The paper tackles the inefficiency of Transformers due to quadratic complexity by proposing Fastformer, an additive attention model with linear complexity, achieving comparable or better performance on long text modeling across five datasets.

Transformer is a powerful model for text understanding. However, it is inefficient due to its quadratic complexity to input sequence length. Although there are many methods on Transformer acceleration, they are still either inefficient on long sequences or not effective enough. In this paper, we propose Fastformer, which is an efficient Transformer model based on additive attention. In Fastformer, instead of modeling the pair-wise interactions between tokens, we first use additive attention mechanism to model global contexts, and then further transform each token representation based on its interaction with global context representations. In this way, Fastformer can achieve effective context modeling with linear complexity. Extensive experiments on five datasets show that Fastformer is much more efficient than many existing Transformer models and can meanwhile achieve comparable or even better long text modeling performance.

Code Implementations13 repos

Data from Papers with Code (CC-BY-SA-4.0)

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes