Timezone: »

Block-Recurrent Transformers
DeLesley Hutchins · Imanol Schlag · Yuhuai Wu · Ethan Dyer · Behnam Neyshabur

Tue Nov 29 09:00 AM -- 11:00 AM (PST) @ Hall J #300

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.

Author Information

DeLesley Hutchins (Google)
DeLesley Hutchins

DeLesley Hutchins received his PhD from the University of Edinburgh, under the direction of Philip Wadler, with a dissertation on programming language semantics and type theory. DeLesley joined Google in 2011, and worked on the C++ compiler team for several years, developing Clang Thread Safety Analysis. He transferred to Google Research in 2015, and currently works with the n2formal team at Google on improvements to transformers.

Imanol Schlag (IDSIA)
Yuhuai Wu (Google)
Ethan Dyer (Blueshift, Google Research)
Behnam Neyshabur (Google)

More from the Same Authors