We propose a synthetic 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 are able to understand (to some extent) some of the attention heads as well as how the information flows in the network. Based on these observations we propose a hypothesis that here pretraining helps merely due to being a smart initialization rather than some deep knowledge stored in the network. 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 ability to generalize to simple variants of the main task, and moreover we find that one can prevent such shortcut with appropriate architecture modification or careful data preparation. Motivated by our findings, we begin to explore the task of learning to execute C programs, where a convolutional modification to transformers, namely adding convolutional structures in the key/query/value maps, shows an encouraging edge.
翻译:我们提议了一个合成任务,即 " 学习平等和团体行动 " (LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEGO)(LEAGO)(LEGO)(LAGO(LAGO(LEGOLEGO)和集团行动))),它包涵括了遵循一个推理链条的问题,我们研究了经过训练的模型最终如何成功完成这项任务,特别是,我们发现(在某种程度上)一些负责人以及网络的信息流动,我们基于适当的结构修改或仔细的数据准备,我们开始探索一个关键的变换图的变换图。