学习可解释的位置编码在Transformer中的效果取决于初始化
Learning interpretable positional encodings in transformers depends on initialization
AI总结:
本研究探讨了Transformer中可学习位置编码的初始化对其学习可解释编码及提升泛化能力的影响,通过三个实验验证了小范数初始化的优势。
摘要:
在Transformer中,位置编码(PE)提供了区分序列中标记位置和顺序的关键信息。以往关于PE对泛化影响的研究大多针对一维输入序列,如自然语言中的序列,其中相邻标记(如单词)高度相关。相比之下,许多现实世界任务涉及具有高度非平凡位置排列的数据集,例如按多个空间维度组织的数据集,或真实位置未知的数据集。在此,我们发现可学习PE的初始化选择极大地影响其学习可解释PE的能力,进而影响泛化性能的提升。我们通过三个实验实证验证了我们的发现:1)一个二维关系推理任务;2)一个非线性随机网络模拟;3)一个真实世界的三维神经科学数据集,并应用可解释性分析来验证准确PE的学习。总体而言,我们发现从小范数分布初始化的可学习PE能够:1)揭示在多个维度上反映真实位置的可解释PE,2)带来更好的泛化性能。这些结果说明了学习可识别且可解释的PE以增强泛化能力的可行性。
英文摘要:
In transformers, the positional encoding (PE) provides essential information that distinguishes the position and order amongst tokens in a sequence. Most prior investigations of PE effects on generalization were tailored to 1D input sequences, such as those presented in natural language, where adjacent tokens (e.g., words) are highly related. In contrast, many real world tasks involve datasets with highly non-trivial positional arrangements, such as datasets organized in multiple spatial dimensions, or datasets for which ground truth positions are not known. Here we find that the choice of initialization of a learnable PE greatly influences its ability to learn interpretable PEs that lead to enhanced generalization. We empirically demonstrate our findings in three experiments: 1) A 2D relational reasoning task; 2) A nonlinear stochastic network simulation; 3) A real world 3D neuroscience dataset, applying interpretability analyses to verify the learning of accurate PEs. Overall, we find that a learned PE initialized from a small-norm distribution can 1) uncover interpretable PEs that mirror ground truth positions in multiple dimensions, and 2) lead to improved generalization. These results illustrate the feasibility of learning identifiable and interpretable PEs for enhanced generalization.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。