带掩码的硬注意力Transformer可精确识别无星语言
Masked Hard-Attention Transformers Recognize Exactly the Star-Free Languages
AI总结:
该研究通过形式语言识别刻画硬注意力掩码Transformer的表达能力,证明严格掩码无位置嵌入时其等价于定义无星语言的LTL,并借助Boolean RASP中间语言分析了位置嵌入等因素对表达能力的提升作用。
摘要:
Transformer在任意大小输入上的表达能力可通过其识别形式语言类别的能力来研究。本文对具备硬注意力(所有注意力恰好聚焦于一个位置)和注意力掩码(每个位置仅能关注一侧的位置)的Transformer建立了精确刻画。在严格掩码(每个位置不能关注自身)且无位置嵌入的条件下,这类Transformer的表达能力等价于线性时序逻辑(LTL),而LTL恰好定义了无星语言。研究的一项关键技术是使用Boolean RASP(布尔随机存取存储程序)作为Transformer与LTL之间的便利中间语言。随后我们将众多已知的LTL结论应用于Transformer,阐明了位置嵌入、严格掩码以及网络深度均会提升其表达能力。
英文摘要:
The expressive power of transformers over inputs of unbounded size can be studied through their ability to recognize classes of formal languages. In this paper, we establish exact characterizations of transformers with hard attention (in which all attention is focused on exactly one position) and attention masking (in which each position only attends to positions on one side). With strict masking (each position cannot attend to itself) and without position embeddings, these transformers are expressively equivalent to linear temporal logic (LTL), which defines exactly the star-free languages. A key technique is the use of Boolean RASP as a convenient intermediate language between transformers and LTL. We then take numerous results known for LTL and apply them to transformers, showing how position embeddings, strict masking, and depth all increase expressive power.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。