通过关注结构化量化嵌入来诱导Transformer的系统性
Inducing Systematicity in Transformers by Attending to Structurally Quantized Embeddings
AI总结:
针对Transformer在低复杂度数据上过拟合的问题,提出SQ-Transformer,通过结构化量化嵌入和系统性注意力层,在低复杂度数据集上实现更强的组合泛化能力。
摘要:
Transformer在复杂数据集上训练后能够泛化到新的结构和实体组合,但在复杂度不足的数据集上容易过拟合。我们观察到,当训练集足够复杂时,模型会使用一种系统性的注意力模式来编码具有共同句法结构的句子。受此观察启发,我们提出了SQ-Transformer(结构化量化),即使在低复杂度的训练集上,也能在嵌入和注意力层显式地鼓励系统性。在嵌入层面,我们引入了面向结构的向量量化(SoVQ),将词嵌入聚类为几类结构等价的实体。在注意力层面,我们设计了系统性注意力层(SAL)以及另一种替代方案——系统性正则化层(SRL),它们作用于量化后的词嵌入,使得相同结构的句子以不变或相似的注意力模式进行编码。实验上,我们展示了SQ-Transformer在多个低复杂度的语义解析和机器翻译数据集上比原始Transformer取得了更强的组合泛化能力。在我们的分析中,我们表明SoVQ确实学习了一个句法聚类的嵌入空间,并且SAL/SRL诱导了可泛化的注意力模式,从而提高了系统性。
英文摘要:
Transformers generalize to novel compositions of structures and entities after being trained on a complex dataset, but easily overfit on datasets of insufficient complexity. We observe that when the training set is sufficiently complex, the model encodes sentences that have a common syntactic structure using a systematic attention pattern. Inspired by this observation, we propose SQ-Transformer (Structurally Quantized) that explicitly encourages systematicity in the embeddings and attention layers, even with a training set of low complexity. At the embedding level, we introduce Structure-oriented Vector Quantization (SoVQ) to cluster word embeddings into several classes of structurally equivalent entities. At the attention level, we devise the Systematic Attention Layer (SAL) and an alternative, Systematically Regularized Layer (SRL) that operate on the quantized word embeddings so that sentences of the same structure are encoded with invariant or similar attention patterns. Empirically, we show that SQ-Transformer achieves stronger compositional generalization than the vanilla Transformer on multiple low-complexity semantic parsing and machine translation datasets. In our analysis, we show that SoVQ indeed learns a syntactically clustered embedding space and SAL/SRL induces generalizable attention patterns, which lead to improved systematicity.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。