Combiner: Full Attention Transformer with Sparse Computation CostThanks: indicates equal contribution. The work was completed during HR’s internship at Google Brain.
Mengjiao Yang Affiliation: Hongyu Ren, Hanjun Dai, Zihang Dai Affiliation: Google Research, Brain Team, Jure Leskovec Affiliation: Stanford University, Dale Schuurmans Affiliation: Hongyu Ren, Hanjun Dai, Zihang Dai Affiliation: Google Research, Brain Team, Affiliation: University of Alberta Bo Dai Affiliation: Hongyu Ren, Hanjun Dai, Zihang Dai Affiliation: Google Research, Brain Team,
Abstract
Transformers provide a class of expressive architectures that are extremely effective for sequence modeling. However, the key limitation of transformers is their quadratic memory and time complexity $\mathcal{O}(L^{2})$ with respect to the sequence length in attention layers, which restricts application in extremely long sequences. Most existing approaches leverage sparsity or low-rank assumptions in the attention matrix to reduce cost, but sacrifice expressiveness. Instead, we propose Combiner, which provides full attention capability in each attention head while maintaining low computation and memory complexity. The key idea is to treat the self-attention mechanism as a conditional expectation over embeddings at each location, and approximate the conditional distribution with a structured factorization. Each location can attend to all other locations, either via direct attention, or through indirect attention to abstractions, which are again conditional expectations of embeddings from corresponding local regions. We show that most sparse attention patterns used in existing sparse transformers are able to inspire the design of such factorization for full attention, resulting in th
原文 arXiv:2107.05768;中英对照 + 大白话阅读 https://aha.fim.ai/paper/2107.05768v2