LGAINEMar 11, 2022

Block-Recurrent Transformers

arXiv:2203.07852v3146 citationsh-index: 44Has Code
Originality Highly original
AI Analysis

This addresses efficiency and performance issues in long-sequence language modeling for applications like books, papers, and code, representing a novel method rather than an incremental improvement.

The paper tackles the problem of scaling transformers to very long sequences by introducing the Block-Recurrent Transformer, which applies a transformer layer recurrently with linear complexity, resulting in dramatically improved perplexity and running twice as fast than a Transformer XL baseline.

We introduce the Block-Recurrent Transformer, which applies a transformer layer in a recurrent fashion along a sequence, and has linear complexity with respect to sequence length. Our recurrent cell operates on blocks of tokens rather than single tokens during training, and leverages parallel computation within a block in order to make efficient use of accelerator hardware. The cell itself is strikingly simple. It is merely a transformer layer: it uses self-attention and cross-attention to efficiently compute a recurrent function over a large set of state vectors and tokens. Our design was inspired in part by LSTM cells, and it uses LSTM-style gates, but it scales the typical LSTM cell up by several orders of magnitude. Our implementation of recurrence has the same cost in both computation time and parameter count as a conventional transformer layer, but offers dramatically improved perplexity in language modeling tasks over very long sequences. Our model out-performs a long-range Transformer XL baseline by a wide margin, while running twice as fast. We demonstrate its effectiveness on PG19 (books), arXiv papers, and GitHub source code. Our code has been released as open source.

Code Implementations3 repos
Foundations

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

Your Notes