arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2103.03457cs.CLcs.AI
收藏

IOT:面向Transformer结构的实例级层重排

IOT: Instance-wise Layer Reordering for Transformer Structures

University of Science and Technology of China(中国科学技术大学);Microsoft Research(微软研究院)

Jinhua Zhu, Lijun Wu, Yingce Xia, Shufang Xie, Tao Qin, Wengang Zhou, Houqiang Li, Tie-Yan Liu

摘要:

Transformer具有顺序堆叠的自注意、(可选的)编码器-解码器注意和前馈层,在自然语言处理(NLP)中取得了巨大成功,并且已经提出了许多变体。目前,几乎所有这些模型都假设层顺序是固定的,并且在数据样本中保持相同。我们观察到,不同的数据样本实际上有利于不同的层的顺序。基于这一观察,在这项工作中,我们打破了Transformer中固定层顺序的假设,并将实例层重新排序引入模型结构。我们的实例有序Transformer(IOT)可以通过重新排序的层来建模变量函数,这使得每个样本能够在几乎相同数量的参数约束下选择更好的一个来提高模型性能。为了实现这一点,我们引入了一个轻预测器,其参数和推理成本可以忽略不计,以决定任何输入序列的最有能力和最有利的层顺序。在3个任务(神经机器翻译、抽象摘要和代码生成)和9个数据集上的实验证明了我们的方法的一致改进。我们进一步表明,我们的方法也可以适用于其他架构以外的Transformer。我们的代码在Github上发布。

英文摘要:

With sequentially stacked self-attention, (optional) encoder-decoder attention, and feed-forward layers, Transformer achieves big success in natural language processing (NLP), and many variants have been proposed. Currently, almost all these models assume that the layer order is fixed and kept the same across data samples. We observe that different data samples actually favor different orders of the layers. Based on this observation, in this work, we break the assumption of the fixed layer order in the Transformer and introduce instance-wise layer reordering into the model structure. Our Instance-wise Ordered Transformer (IOT) can model variant functions by reordered layers, which enables each sample to select the better one to improve the model performance under the constraint of almost the same number of parameters. To achieve this, we introduce a light predictor with negligible parameter and inference cost to decide the most capable and favorable layer order for any input sequence. Experiments on 3 tasks (neural machine translation, abstractive summarization, and code generation) and 9 datasets demonstrate consistent improvements of our method. We further show that our method can also be applied to other architectures beyond Transformer. Our code is released at Github.

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

↑