训练 Transformer 时打破对称性
Breaking Symmetry When Training Transformers
AI总结:
本文分析无位置编码 Transformer 的序列建模能力,论证因果注意力通过打破输入 token 排列对称性使模型识别顺序,且残差连接促使各垂直切片表示同一位置。
摘要:
正如我们在本文中所展示的,如果 Transformer 架构缺少位置编码和因果注意力机制中的任意一种,其对输出 token n+1 的预测对于输入 token 1、2、……、n-1 的排列是不变的。通常这两种机制都会被采用,从而打破关于输入 token 的对称性。最近已有研究表明,可以在没有位置编码的情况下训练 Transformer。这必定是由因果注意力机制实现的。本文进一步阐述了如下论点:因果连接机制必定是 Transformer 能够对顺序至关重要的输入序列进行建模的原因。Transformer 的垂直“切片”都被促使表示输入序列中的同一位置 k。我们假设残差连接促成了这一现象,并给出了相关证据。
英文摘要:
As we show in this paper, the prediction for output token $n+1$ of Transformer architectures without one of the mechanisms of positional encodings and causal attention is invariant to permutations of input tokens $1, 2, ..., n-1$. Usually, both mechanisms are employed and the symmetry with respect to the input tokens is broken. Recently, it has been shown that one can train Transformers without positional encodings. This must be enabled by the causal attention mechanism. In this paper, we elaborate on the argument that the causal connection mechanism must be responsible for the fact that Transformers are able to model input sequences where the order is important. Vertical "slices" of Transformers are all encouraged to represent the same location $k$ in the input sequence. We hypothesize that residual connections contribute to this phenomenon, and demonstrate evidence for this.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。