When trained on language data, do transformers learn some arbitrary computation that utilizes the full capacity of the architecture or do they learn a simpler, tree-like computation, hypothesized to underlie compositional meaning systems like human languages? There is an apparent tension between compositional accounts of human language understanding, which are based on a restricted bottom-up computational process, and the enormous success of neural models like transformers, which can route information arbitrarily between different parts of their input. One possibility is that these models, while extremely flexible in principle, in practice learn to interpret language hierarchically, ultimately building sentence representations close to those predictable by a bottom-up, tree-structured model. To evaluate this possibility, we describe an unsupervised and parameter-free method to \emph{functionally project} the behavior of any transformer into the space of tree-structured networks. Given an input sentence, we produce a binary tree that approximates the transformer's representation-building process and a score that captures how "tree-like" the transformer's behavior is on the input. While calculation of this score does not require training any additional models, it provably upper-bounds the fit between a transformer and any tree-structured approximation. Using this method, we show that transformers for three different tasks become more tree-like over the course of training, in some cases unsupervisedly recovering the same trees as supervised parsers. These trees, in turn, are predictive of model behavior, with more tree-like models generalizing better on tests of compositional generalization.
翻译:语言数据培训后, 变压器会学会一些任意的计算, 使用结构的全部能力, 或者学习一种更简单的、 树类式的计算, 假设它能成为像人类语言这样的组成含义体系的基础? 人类语言理解的构成账户, 其基础是有限的自下而上计算过程, 以及任何变压器等神经模型的巨大成功, 它可以任意在输入的不同部分之间传递信息。 一种可能性是, 这些模型, 原则上极其灵活, 在实践中学会按等级来解释语言, 最终用一个自下而上、 树类结构化模型来构建句子代表那些可以预测的句子。 为了评估这种可能性, 我们描述一种非超上和无参数的方法, 来描述任何变压的和无参数的方法, 任何变压的变压的树型模型, 以及任何变压的变压式的树型模型, 成为一种不固定的变压的树型模型。