arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2206.04301cs.LGcs.AIcs.CL
收藏

使用LEGO揭开Transformers:合成推理任务

Unveiling Transformers with LEGO: a synthetic reasoning task

Microsoft Research(微软研究院)

Yi Zhang, Arturs Backurs, Sébastien Bubeck, Ronen Eldan, Suriya Gunasekar, Tal Wagner

摘要:

我们提出了一个综合推理任务,乐高(学习平等和组操作),封装的问题,以下的推理链,我们研究了如何学习这个任务的Transformer架构。我们特别关注数据效果,例如预训练(在看似无关的NLP任务上)和数据集组成(例如,在训练和测试时不同的链长度),以及架构变体,如权重绑定层或添加卷积组件。我们研究了经过训练的模型最终是如何成功完成任务的,特别是,我们设法了解了一些注意力头部以及信息在网络中的流动方式。特别是,我们已经确定了一个新的\emph{association}模式,全球只关注相同的令牌。基于这些观察,我们提出了一个假设,即由于某些结构化注意力模式,预训练有助于乐高任务,并且我们通过实验验证了这一假设。我们还观察到,在一些数据制度的训练Transformer找到“捷径”的解决方案,以遵循链的推理,这阻碍了模型的鲁棒性,此外,我们提出了方法来防止它。我们的结构化注意力模式的研究结果的动机,我们提出了乐高注意力模块,香草注意力头的下降,在替代品。这种架构上的改变显著地减少了Flop,并在大规模预训练中保持甚至\emph{improves}模型的性能。

英文摘要:

We propose a synthetic reasoning task, LEGO (Learning Equality and Group Operations), that encapsulates the problem of following a chain of reasoning, and we study how the Transformer architectures learn this task. We pay special attention to data effects such as pretraining (on seemingly unrelated NLP tasks) and dataset composition (e.g., differing chain length at training and test time), as well as architectural variants such as weight-tied layers or adding convolutional components. We study how the trained models eventually succeed at the task, and in particular, we manage to understand some of the attention heads as well as how the information flows in the network. In particular, we have identified a novel \emph{association} pattern that globally attends only to identical tokens. Based on these observations we propose a hypothesis that here pretraining helps for LEGO tasks due to certain structured attention patterns, and we experimentally verify this hypothesis. We also observe that in some data regime the trained transformer finds ``shortcut" solutions to follow the chain of reasoning, which impedes the model's robustness, and moreover we propose ways to prevent it. Motivated by our findings on structured attention patterns, we propose the LEGO attention module, a drop-in replacement for vanilla attention heads. This architectural change significantly reduces Flops and maintains or even \emph{improves} the model's performance at large-scale pretraining.

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

↑