arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.09728cs.CLcs.AIcs.CC
收藏

用Transformer模拟序列和树上的加权自动机

Simulating Weighted Automata over Sequences and Trees with Transformers

Mila(米拉人工智能研究所);DIRO(蒙特利尔大学计算机科学与运筹学系);McGill University(麦吉尔大学);Université de Montréal(蒙特利尔大学)

Michael Rizvi, Maude Lizaire, Clara Lacroce, Guillaume Rabusseau

AI总结:

本研究证明Transformer能模拟加权有限自动机(WFA)和加权树自动机(WTA),给出模型规模上界,并通过合成实验验证其可经梯度训练学习,扩展了Transformer的推理能力。

摘要:

Transformer是自然语言处理(NLP)社区中无处不在的模型,并在过去几年中展示了令人印象深刻的经验性成功。然而,人们对它们如何推理以及其计算能力的极限知之甚少。这些模型不按顺序处理数据,却优于诸如RNN之类的顺序神经模型。最近的工作表明,这些模型可以紧凑地模拟确定性有限自动机(DFA)的顺序推理能力。这引出了以下问题:Transformer能否模拟更复杂的有限状态机的推理?在这项工作中,我们表明Transformer可以模拟加权有限自动机(WFA),这是一类包含DFA的模型,以及加权树自动机(WTA),这是加权自动机对树结构输入的推广。我们正式证明了这些主张,并提供了所需Transformer模型大小(作为目标自动机状态数的函数)的上界。在实验上,我们进行了合成实验,表明Transformer能够通过标准的基于梯度的训练学习这些紧凑的解决方案。

英文摘要:

Transformers are ubiquitous models in the natural language processing (NLP) community and have shown impressive empirical successes in the past few years. However, little is understood about how they reason and the limits of their computational capabilities. These models do not process data sequentially, and yet outperform sequential neural models such as RNNs. Recent work has shown that these models can compactly simulate the sequential reasoning abilities of deterministic finite automata (DFAs). This leads to the following question: can transformers simulate the reasoning of more complex finite state machines? In this work, we show that transformers can simulate weighted finite automata (WFAs), a class of models which subsumes DFAs, as well as weighted tree automata (WTA), a generalization of weighted automata to tree structured inputs. We prove these claims formally and provide upper bounds on the sizes of the transformer models needed as a function of the number of states the target automata. Empirically, we perform synthetic experiments showing that transformers are able to learn these compact solutions via standard gradient-based training.

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

↑