arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2203.07852cs.LGcs.AIcs.NE
收藏

块循环Transformers

Block-Recurrent Transformers

Google Research(谷歌研究院);The Swiss AI Lab IDSIA(瑞士人工智能实验室IDSIA);SUPSI(瑞士南方应用科学大学);USI(瑞士意大利语区大学)

DeLesley Hutchins, Imanol Schlag, Yuhuai Wu, Ethan Dyer, Behnam Neyshabur

摘要:

我们介绍了块递归Transformer,它适用于一个Transformer层在一个经常性的方式沿序列,并具有线性复杂度相对于序列长度。我们的循环单元在训练过程中对令牌块而不是单个令牌进行操作,并利用块内的并行计算来有效利用加速器硬件。细胞本身非常简单。它只是一个Transformer层:它使用自我注意力和交叉注意力来有效地计算大量状态向量和令牌上的循环函数。我们的设计部分受到了LSTM单元的启发,它使用了LSTM风格的门,但它将典型的LSTM单元放大了几个数量级。我们的递归实现与传统的Transformer层在计算时间和参数计数方面具有相同的成本,但在非常长的序列上提供了显着改善的语言建模任务的困惑。我们的模型的性能远远超过长距离Transformer XL基线,同时运行速度是其两倍。我们在PG19(书籍),arXiv论文和GitHub源代码上证明了它的有效性。我们的代码已作为开源发布。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑