arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.01749cs.CL
收藏

Stack Attention:提升 Transformer 建模层次模式的能力

Stack Attention: Improving the Ability of Transformers to Model Hierarchical Patterns

University of Notre Dame(圣母大学);ETH Zürich(苏黎世联邦理工学院)

Brian DuSell, David Chiang

AI总结:

本文提出结合栈机制的 stack attention,使 Transformer 无需句法监督即可建模任意深度层次结构,并在困难 CFL、语言建模和机器翻译任务上验证其优势。

摘要:

注意力机制,尤其是缩放点积注意力,已被证明对自然语言有效,但它没有处理任意嵌套深度的层次模式的机制,这限制了其识别某些句法结构的能力。为解决这一缺陷,我们提出 stack attention:一种结合栈的注意力算子,其灵感来自栈与上下文无关语言(CFL)之间的理论联系。我们表明,stack attention 类似于标准注意力,但带有一个潜在句法模型,且不需要句法监督。我们提出两个变体:一个与确定性下推自动机(PDA)相关,另一个基于非确定性 PDA,后者使 Transformer 能够识别任意 CFL。我们表明,带有 stack attention 的 Transformer 在学习标准 Transformer 难以处理的 CFL 时非常有效,并在一个具有理论最大解析难度的 CFL 上取得强劲结果。我们还表明,在受限参数预算下,stack attention 在自然语言建模方面更有效,并且我们纳入了机器翻译结果。

英文摘要:

Attention, specifically scaled dot-product attention, has proven effective for natural language, but it does not have a mechanism for handling hierarchical patterns of arbitrary nesting depth, which limits its ability to recognize certain syntactic structures. To address this shortcoming, we propose stack attention: an attention operator that incorporates stacks, inspired by their theoretical connections to context-free languages (CFLs). We show that stack attention is analogous to standard attention, but with a latent model of syntax that requires no syntactic supervision. We propose two variants: one related to deterministic pushdown automata (PDAs) and one based on nondeterministic PDAs, which allows transformers to recognize arbitrary CFLs. We show that transformers with stack attention are very effective at learning CFLs that standard transformers struggle on, achieving strong results on a CFL with theoretically maximal parsing difficulty. We also show that stack attention is more effective at natural language modeling under a constrained parameter budget, and we include results on machine translation.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑